File size: 55,731 Bytes
6fa4bc9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 | {
"paper_id": "P95-1003",
"header": {
"generated_with": "S2ORC 1.0.0",
"date_generated": "2023-01-19T08:33:57.540158Z"
},
"title": "The Replace Operator",
"authors": [
{
"first": "Lauri",
"middle": [],
"last": "Karttunen",
"suffix": "",
"affiliation": {
"laboratory": "",
"institution": "chemin de Maupertuis",
"location": {
"postCode": "F-38240",
"settlement": "Meylan",
"country": "France"
}
},
"email": "karttunen@xerox@fr"
}
],
"year": "",
"venue": null,
"identifiers": {},
"abstract": "This paper introduces to the calculus of regular expressions a replace operator and defines a set of replacement expressions that concisely encode alternate variations of the operation. Replace expressions denote regular relations, defined in terms of other regular expression operators. The basic case is unconditional obligatory replacement. We develop several versions of conditional replacement that allow the operation to be constrained by context",
"pdf_parse": {
"paper_id": "P95-1003",
"_pdf_hash": "",
"abstract": [
{
"text": "This paper introduces to the calculus of regular expressions a replace operator and defines a set of replacement expressions that concisely encode alternate variations of the operation. Replace expressions denote regular relations, defined in terms of other regular expression operators. The basic case is unconditional obligatory replacement. We develop several versions of conditional replacement that allow the operation to be constrained by context",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Abstract",
"sec_num": null
}
],
"body_text": [
{
"text": "Linguistic descriptions in phonology, morphology, and syntax typically make use of an operation that replaces some symbol or sequence of symbols by another sequence or symbol. We consider here the replacement operation in the context of finite-state grammars.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "O. Introduction",
"sec_num": null
},
{
"text": "Our purpose in this paper is twofold. One is to define replacement in a very general way, explicitly allowing replacement to be constrained by input and output contexts, as in two-level rules (Koskenniemi 1983) , but without the restriction of only single-symbol replacements. The second objective is to define replacement within a general calculus of regular expressions so that replacements can be conveniently combined with other kinds of operations, such as composition and union, to form complex expressions.",
"cite_spans": [
{
"start": 192,
"end": 210,
"text": "(Koskenniemi 1983)",
"ref_id": "BIBREF6"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "O. Introduction",
"sec_num": null
},
{
"text": "Our replacement operators are close relatives of the rewrite-operator defined in Kaplan and Kay 1994 , but they are not identical to it. We discuss their relationship in a section at the end of the paper.",
"cite_spans": [
{
"start": 81,
"end": 100,
"text": "Kaplan and Kay 1994",
"ref_id": "BIBREF2"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "O. Introduction",
"sec_num": null
},
{
"text": "The replacement operators are defined by means of regular expressions. Some of the operators we use to define them are specific to Xerox implementations of the finite-state calculus, but equivalent formulations could easily be found in other notations.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "The table below describes the types of expressions and special symbols that are used to define the replacement operators.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "[1] (A) option ( The order in the above table corresponds to the precedence of the operations. The prefix operators (-, \\, and $) bind more tightly than the postfix operators (*, +, and/), which in turn rank above concatenation. Union, intersection, and relative complement are considered weaker than concatenation but stronger than crossproduct and composition. Operators sharing the same precedence are interpreted left-to-right. Our new replacement operator goes in a class between the Boolean operators and composition. Taking advantage of all these conventions, the fully bracketed expression",
"cite_spans": [
{
"start": 4,
"end": 7,
"text": "(A)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "[2]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "[[[~[all* [[b]/x]] I el .x. d ;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "can be rewritten more concisely as",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "~a* b/x I c .x. d [31",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "Expressions that contain the crossproduct (. x.) or the composition (. o.) operator describe regular relations rather than regular languages. A regular relation is a mapping from one regular language to another one. Regular languages correspond to simple finite-state automata; regular relations are modeled by finite-state transducers. In the relation a .",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "x. B, we call the first member, A, the upper language and the second member, B, the lower language.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "To make the notation less cumbersome, we systematically ignore the distinction between the language A and the identity relation that maps every string of A to itself. Correspondingly, a simple automaton may be thought of as representing a language or as a transducer for its identity relation. For the sake of convenience, we also equate a language consisting of a single string with the string itself. Thus the expression abc may denote, depending on the context, (i) the string abc, (ii) the language consisting of the string abc, and (iii) the identity relation on that language.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "We recognize two kinds of symbols: simple symbols (a, b, c, etc.) and fst pairs (a : b, y : z, etc.). An fst pair a : b can be thought of as the crossproduct of a and b, the minimal relation consisting of a (the upper symbol) and b (the lower symbol). Because we regard the identity relation on A as equivalent to A, we write a : a as just a. There are two special symbols",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "1. Simple regular expressions",
"sec_num": "0."
},
{
"text": "0 epsilon (the empty string). ? any symbol in the known alphabet and its extensions.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[4]",
"sec_num": null
},
{
"text": "The escape character, %, allows letters that have a special meaning in the calculus to be used as ordinary symbols. Thus %& denotes a literal ampersand as opposed to &, the intersection operator; %0 is the ordinary zero symbol.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[4]",
"sec_num": null
},
{
"text": "The following simple expressions appear frequently in our formulas: ",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[4]",
"sec_num": null
},
{
"text": "? C:~ a C:X -- Figure 1: a b I c -> x",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[4]",
"sec_num": null
},
{
"text": "Every pair of strings in the relation corresponds to a path from the initial 0 state of the transducer to a final state. The abaca to xaxa path is 0-1-0-2-0-2, where the 2-0 transition is over a c : x arc.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[4]",
"sec_num": null
},
{
"text": "In case a given input string matches the replacement relation in two ways, two outputs are produced. For example, The corresponding transducer paths in Figure 2 are 0-1-3-0 and 0-2-0-0, where the last 0-0 transition is over a c arc.",
"cite_spans": [],
"ref_spans": [
{
"start": 152,
"end": 160,
"text": "Figure 2",
"ref_id": null
}
],
"eq_spans": [],
"section": "[4]",
"sec_num": null
},
{
"text": "If this ambiguity is not desirable, we may write two replacement expressions and compose them to indicate which replacement should be preferred if a choice has to be made. For example, if the ab match should have precedence, we write",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[4]",
"sec_num": null
},
{
"text": "[13] ab->x o0o b c -> x ; a:x X X Figure3: a b -> x .o. b c -> x",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[4]",
"sec_num": null
},
{
"text": "This composite relation produces the same output as the previous one except for strings like abc where it unambiguously makes only the first replacement, giving xc as the output. The abe to xc path in Figure 3 is 0-2-0-0. ",
"cite_spans": [],
"ref_spans": [
{
"start": 201,
"end": 209,
"text": "Figure 3",
"ref_id": null
}
],
"eq_spans": [],
"section": "[4]",
"sec_num": null
},
{
"text": "The inverse replacement operator.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Inverse replacement",
"sec_num": "1.3."
},
{
"text": "UPPER <-LOWER [18]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Inverse replacement",
"sec_num": "1.3."
},
{
"text": "is defined as the inverse of the relation LOWER -> UPPER.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Inverse replacement",
"sec_num": "1.3."
},
{
"text": "An optional version of unconditional replacement is derived simply by augmenting LOWER with UP-PER in the replacement relation.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Optional replacement",
"sec_num": "1.4."
},
{
"text": "[19]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Optional replacement",
"sec_num": "1.4."
},
{
"text": "UPPER (->) LOWER is defined as UPPER -> [LOWER [ UPPER]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Optional replacement",
"sec_num": "1.4."
},
{
"text": "[20]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Optional replacement",
"sec_num": "1.4."
},
{
"text": "The optional replacement relation maps UPPER to both LOWER and UPPER. The optional version of <is defined in the same way.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Optional replacement",
"sec_num": "1.4."
},
{
"text": "We now extend the notion of simple replacement by allowing the operation to be constrained by a left and a right context. A conditional replacement expression has four components: UPPER, LOWER, LEFT, and RIGHT. They must all be regular expressions that describe a simple language. We write the replacement part UPPER -> LOWER, as before, and the context part as LEFT _ RIGHT, where the underscore indicates where the replacement takes place.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "In addition, we need a separator between the replacement and the context part. We use four alternate separators, [ I, //, \\ \\ and \\/, which gives rise to four types of conditional replacement expressions:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "[21l (1) Upward-oriented: UPPER -> LOWER J[ LEFT RIGHT ;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "(2) Right-oriented:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "UPPER-> LOWER // LEFT RIGHT ;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "(3) Left-oriented:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "UPPER -> LOWER \\\\ LEFT RIGHT ;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "(4) Downward-oriented:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "UPPER -> LOWER \\/ LEFT RIGHT ;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "All four kinds of replacement expressions describe a relation that maps UPPER to LOWER between LEFT and RIGHT leaving everything else unchanged. The difference is in the intelpretation of '%etween LEFT and RIGHT.\"",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conditional replacement",
"sec_num": "2."
},
{
"text": "We define UPPER-> LOWER l[ LEFT RIGHT and the other versions of conditional replacement in terms of expressions that are already in our regular expression language, including the unconditional version just defined. Our general intention is to make the conditional replacement behave exactly like unconditional replacement except that the operation does not take place unless the specified context is present.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Overview: divide and conquer",
"sec_num": "2.1."
},
{
"text": "This may seem a simple matter but it is not, as Kaplan and Kay 1994 show. There are several sources of complexity. One is that the part that is being replaced may at the same time serve as the context of another adjacent replacement. Another complication is the fact just mentioned: there are several ways to constrain a replacement by a context.",
"cite_spans": [
{
"start": 48,
"end": 67,
"text": "Kaplan and Kay 1994",
"ref_id": "BIBREF2"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Overview: divide and conquer",
"sec_num": "2.1."
},
{
"text": "We solve both problems using a technique that was originally invented for the implementation of phonological rewrite rules Kay 1981, 1994) and later adapted for two-level rules (Kaplan, Karttunen, Koskenniemi 1987; Karttunen and Beesley 1992) . The strategy is first to decompose the complex relation into a set of relatively simple components, define the components independently of one another, and then define the whole operation as a composition of these auxiliary relations.",
"cite_spans": [
{
"start": 123,
"end": 138,
"text": "Kay 1981, 1994)",
"ref_id": null
},
{
"start": 177,
"end": 214,
"text": "(Kaplan, Karttunen, Koskenniemi 1987;",
"ref_id": "BIBREF3"
},
{
"start": 215,
"end": 242,
"text": "Karttunen and Beesley 1992)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Overview: divide and conquer",
"sec_num": "2.1."
},
{
"text": "We need six intermediate relations, to be defined shortly: [22] (1) InsertBrackets (2) ConstrainBrackets (3) LeftContext (4) RightContext (5) Replace (6) RemoveBrackets Relations (1), (5), and (6) involve the unconditional replacement operator defined in the previous section.",
"cite_spans": [
{
"start": 59,
"end": 63,
"text": "[22]",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Overview: divide and conquer",
"sec_num": "2.1."
},
{
"text": "Two auxiliary symbols, < and >, are introduced in (1) and (6). The left bracket, <, indicates the end of a left context. The right bracket, >, marks the beginning of a complete right context. The distribution of the auxiliary brackets is controlled by (2), (3), and (4). The relations (1) and (6) that introduce the brackets internal to the composition at the same time remove them from the result.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Overview: divide and conquer",
"sec_num": "2.1."
},
{
"text": "The full spedfication of the six component relations is given below. Here UPPER, LOWER, LEFT, and RIGHT are placeholders for regular expressions of any complexity.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Basic definition",
"sec_num": "2.2."
},
{
"text": "In each case we give a regular expression that precisely defines the component followed by an English sentence describing the same language or relation. In our regular expression language, we have to prefix the auxiliary context markers with the escape symbol % to distinguish them from other uses of < and >.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Basic definition",
"sec_num": "2.2."
},
{
"text": "[23] (1) InsertBrackets",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Basic definition",
"sec_num": "2.2."
},
{
"text": "The relation that eliminates from the upper side language all context markers that appear on the lower side.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "[24]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "(2) ConstrainBrackets",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "~$ [%< %>] ;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "The language consisting of strings that do not contain <> anywhere.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "[2s]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "(3) LeftContext",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "-[-[...LEFT] [<...]] & ~[ [...LEFT] ~[<...]] ;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "The language in which any instance of < is immediately preceded by LEFT, and every LEFT is ii~iediately followed by <, ignoring irrelevant brackets. [26]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "(4) RightContext ~[ [...>] -[RIGHT...] & ~[~[...>] [RIGHT...] ;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "The language in which any instance of > is immediately followed by RIGHT, and any RIGHT is immediately preceded by >, ignoring irrelevant brackets. The unconditional replacement of <UPPER> by <LOWER>, ignoring irrelevant brackets.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "The redundant brackets on the lower side are important for the other versions of the operation.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "[28] The relation that maps the strings of the upper language to the same strings without any context markers.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "The upper side brackets are eliminated by the inverse replacement defined in (1).",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "[] <-%< 1%> ;",
"sec_num": null
},
{
"text": "The complete definition of the first version of conditional replacement is the composition of these six relations: ",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Four ways of using contexts",
"sec_num": "2.3."
},
{
"text": "The composition with the left and right context constraints prior to the replacement means that any instance of UPPER that is subject to replacement is surrounded by the proper context on the upper side. Within this region, replacement operates just as it does in the unconditional case.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "RemoveBrackets ;",
"sec_num": null
},
{
"text": "Three other versions of conditional replacement can be defined by applying one, or the other, or both context constraints on the lower side of the relation. It is done by varying the order of the three middle relations in the composition. In the rightoriented version (//), the left context is checked on the lower side of replacement:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "RemoveBrackets ;",
"sec_num": null
},
{
"text": "[30] UPPER -> LOWER // LEFT RIGHT ; \u00b0o. RightContext \u00b0Oo Replace oOo LeftContext \u00b0.o",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "RemoveBrackets ;",
"sec_num": null
},
{
"text": "The left-oriented version applies the constraints in the opposite order:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "RemoveBrackets ;",
"sec_num": null
},
{
"text": "UPPER -> LOWER \\\\ LEFT RIGHT [31]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "RemoveBrackets ;",
"sec_num": null
},
{
"text": ".\u00b0\u00b0",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "RemoveBrackets ;",
"sec_num": null
},
{
"text": ".O.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "LeftContext",
"sec_num": null
},
{
"text": ".o.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Replace",
"sec_num": null
},
{
"text": "The first three versions roughly correspond to the three alternative interpretations of phonological rewrite rules discussed in Kaplan and Kay 1994 . The upward-oriented version corresponds to simultaneous rule application; the right-and leftoriented versions can model rightward or leftward iterating processes, such as vowel harmony and assimilation.",
"cite_spans": [
{
"start": 128,
"end": 147,
"text": "Kaplan and Kay 1994",
"ref_id": "BIBREF2"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "\u00b0 \u00b0 \u00b0",
"sec_num": null
},
{
"text": "The fourth logical possibility is that the replacement operation is constrained by the lower context.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u00b0 \u00b0 \u00b0",
"sec_num": null
},
{
"text": "[32]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u00b0 \u00b0 \u00b0",
"sec_num": null
},
{
"text": "UPPER -> LOWER \\/ LEFT RIGHT ; \u00b0 o o",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u00b0 \u00b0 \u00b0",
"sec_num": null
},
{
"text": ".O.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Replace",
"sec_num": null
},
{
"text": ".",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "RightContext",
"sec_num": null
},
{
"text": "When the component relations are composed together in this manner, UPPER gets mapped to LOWER just in case it ends up between LEFT and RIGHT in the output string.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 \u00b0",
"sec_num": null
},
{
"text": "Let us illustrate the consequences of these definitions with a few examples. We consider four versions of the same replacement expression, starting with the upward-oriented version The second and the third occurrence of ab are replaced by x here because they are between ab and",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Examples",
"sec_num": "2.4."
},
{
"text": "x on the upper side language of the relation\u2022 A transducer for the relation is shown in Figure 4 .",
"cite_spans": [],
"ref_spans": [
{
"start": 88,
"end": 96,
"text": "Figure 4",
"ref_id": null
}
],
"eq_spans": [],
"section": "Examples",
"sec_num": "2.4."
},
{
"text": "?l x '<!/",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "Figure4: a b -> x II a b _ a",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "The path through the network that maps abababa to abxxa is 0-1-2-5-7-5-6-3.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "The right-oriented version, [35] by the path 0-1-2-3-4-5-6-3.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "[36]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "following the path 0-1-2-5-6-1-2-3. The last occurrence of ab must remain unchanged because it does not have the required left context on the lower side.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "The left-oriented version of the rule shows the opposite behavior because it constrains the left context on the upper side of the replacement relation and the right context on the lower side.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "[37]",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "a b -> x \\\\ a b a ;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "The first two occurrences of ab remain unchanged because neither one has the proper right context on the lower side to be replaced by x.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "Finally, the downward-oriented fourth version: Path 0-1-2-5-6-1-2-3 yields abxaba, path 0-1-2-3-4-5-6-1 gives us ababxa",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "It is easy to see that if the constraint for the replacement pertains to the lower side, then in this case it can be satisfied in two ways.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 x b",
"sec_num": null
},
{
"text": "Our definition of replacement is in its technical aspects very closely related to the way phonological rewrite-rules are defined in Kaplan and Kay 1994 but there are important differences. The initial motivation in their original 1981 presentation was to model a left-to-right deterministic process of rule application. In the course of exploring the issues, Kaplan and Kay developed a more abstract notion of rewrite rules, which we exploit here, but their 1994 paper retains the procedural point of view.",
"cite_spans": [
{
"start": 132,
"end": 151,
"text": "Kaplan and Kay 1994",
"ref_id": "BIBREF2"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Phonological rewrite rules",
"sec_num": "3.1."
},
{
"text": "Our paper has a very different starting point. The basic case for us is unconditional obligatory replacement, defined in a purely relational way without any consideration of how it might be applied. By starting with obligatory replacement, we can easily define an optional version of the operator. For Kaplan and Kay, the primary notion is optional rewriting. It is quite cumbersome for them to provide an obligatory version. The results are not equivalent.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Phonological rewrite rules",
"sec_num": "3.1."
},
{
"text": "Although people may agree, in the case of simple phonological rewrite rules, what the outcome of a deterministic rewrite operation should be, it is not clear that this is the case for replacement expressions that involve arbitrary regular languages. For that reason, we prefer to define the replacement operator in relational terms without relying on an uncertain intuition about a particular procedure.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Phonological rewrite rules",
"sec_num": "3.1."
},
{
"text": "Our definition of replacement also has a close connection to two-level rules. A two-level rule always specifies whether a context element belongs to the input (= lexical) or the output (= surface) context of the rule. The two-level model also shares our pure relational view of replacement as it is not concerned about the application procedure. But the two-level formalism is only defined for symbol-tosymbol replacements.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Two-level rules",
"sec_num": "3.2."
},
{
"text": "The goal of this paper has been to introduce to the calculus of regular expressions a replace operator, ->, with a set of associated replacement expressions that concisely encode alternate variations of the operation.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conclusion",
"sec_num": "4."
},
{
"text": "We defined unconditional and conditional replacement, taking the unconditional obligatory replacement as the basic case. We provide a simple declarative definition for it, easily expressed in terms of the other regular expression operators, and extend it to the conditional case providing four ways to constrain replacement by a context.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conclusion",
"sec_num": "4."
},
{
"text": "These definitions have already been implemented. The figures in this paper correspond exactly to the output of the regular expression compiler in the Xerox finite-state calculus.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conclusion",
"sec_num": "4."
}
],
"back_matter": [
{
"text": "This work is based on many years of productive collaboration with Ronald M. Kaplan and Martin Kay. I am particularly indebted to Kaplan for writing a very helpful critique, even though he strongly prefers the approach of Kaplan and Kay 1994 . Special thanks are also due to Kenneth R. Beesley for technical help on the definitions of the replace operators and for expert editorial advice. I am grateful to Pasi Tapanainen, Jean-Pierre Chanod and Annie Zaenen for helping to correct many terminological and rhetorical weaknesses of the initial draft.",
"cite_spans": [
{
"start": 221,
"end": 240,
"text": "Kaplan and Kay 1994",
"ref_id": "BIBREF2"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Acknowledgments",
"sec_num": null
}
],
"bib_entries": {
"BIBREF1": {
"ref_id": "b1",
"title": "Phonological Rules and Finite-State Transducers. Paper presented at the Annual Meeting of the Linguistic Society of America",
"authors": [],
"year": null,
"venue": "",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Phonological Rules and Finite-State Transducers. Paper presented at the Annual Meeting of the Linguistic Society of America. New York.",
"links": null
},
"BIBREF2": {
"ref_id": "b2",
"title": "Regular Models of Phonological Rule Systems. Computational Linguistics",
"authors": [
{
"first": "Ronald",
"middle": [
"M"
],
"last": "Kaplan",
"suffix": ""
},
{
"first": "Martin",
"middle": [],
"last": "Kay",
"suffix": ""
}
],
"year": 1994,
"venue": "",
"volume": "20",
"issue": "",
"pages": "3--331",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Kaplan, Ronald M. and Kay, Martin (1994). Regular Models of Phonological Rule Systems. Computa- tional Linguistics. 20:3 331-378. 1994.",
"links": null
},
"BIBREF3": {
"ref_id": "b3",
"title": "A Compiler for Twolevel Phonological Rules",
"authors": [
{
"first": "Lauri",
"middle": [],
"last": "Karttunen",
"suffix": ""
},
{
"first": "Kimmo",
"middle": [],
"last": "Koskenniemi",
"suffix": ""
},
{
"first": "Ronald",
"middle": [
"M"
],
"last": "Kaplan",
"suffix": ""
}
],
"year": 1987,
"venue": "Report No. CSLI-87-108",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Karttunen, Lauri, Koskenniemi, Kimmo, and Kaplan, Ronald M. (1987) A Compiler for Two- level Phonological Rules. In Report No. CSLI-87- 108. Center for the Study of Language and In- formation. Stanford University.",
"links": null
},
"BIBREF5": {
"ref_id": "b5",
"title": "Two-level Rule Compiler",
"authors": [],
"year": null,
"venue": "",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Two-level Rule Compiler. Technical Report. ISTL- 92-2. Xerox Palo Alto Research Center.",
"links": null
},
"BIBREF6": {
"ref_id": "b6",
"title": "Two-level Morphology: A General Computational Model for Word-Form Recognition and Production",
"authors": [
{
"first": "Kimmo",
"middle": [],
"last": "Koskenniemi",
"suffix": ""
}
],
"year": 1983,
"venue": "",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Koskenniemi, Kimmo (1983). Two-level Morphology: A General Computational Model for Word-Form Re- cognition and Production. Department of General Linguistics. University of Helsinki.",
"links": null
}
},
"ref_entries": {
"FIGREF1": {
"num": null,
"text": "Figure 2: a b [ b c -> x maps abc to both ax and xc:",
"uris": null,
"type_str": "figure"
},
"FIGREF3": {
"num": null,
"text": "Figure5: a b -> x // a b _ a givesusadifferentresult:",
"uris": null,
"type_str": "figure"
},
"FIGREF4": {
"num": null,
"text": "Figure7: a b -> x \\/ a b _ a This time, surprisingly, we get two outputs from the same input: [40] ab abab a , ab ab aba a b x a b a a b a b x a",
"uris": null,
"type_str": "figure"
},
"TABREF1": {
"num": null,
"content": "<table><tr><td/><td/><td>?*</td><td colspan=\"2\">the universal (\"sigma-star\") language: all</td></tr><tr><td/><td/><td/><td colspan=\"2\">possible strings of any length including the</td></tr><tr><td/><td/><td/><td colspan=\"2\">empty string.</td></tr><tr><td/><td/><td colspan=\"3\">1. Unconditional replacement</td></tr><tr><td/><td/><td colspan=\"3\">To the regular-expression language described</td></tr><tr><td/><td/><td colspan=\"3\">above, we add the new replacement operator. The</td></tr><tr><td/><td/><td colspan=\"3\">unconditional replacement of UPPER by LOWER is</td></tr><tr><td/><td/><td>written</td><td/></tr><tr><td/><td/><td/><td/><td>[6]</td></tr><tr><td/><td/><td>UPPER</td><td colspan=\"2\">-> LOWER</td></tr><tr><td/><td/><td colspan=\"3\">Here UPPER and LOWER are any regular expres-</td></tr><tr><td/><td/><td colspan=\"3\">sions that describe simple regular languages. We</td></tr><tr><td/><td/><td colspan=\"3\">define this replacement expression as</td></tr><tr><td/><td/><td/><td/><td>[71</td></tr><tr><td/><td/><td colspan=\"2\">[ NO UPPER</td><td>[UPPER</td><td>.x. LOWER]</td><td>] *</td></tr><tr><td/><td/><td colspan=\"2\">NO UPPER</td><td>;</td></tr><tr><td/><td/><td colspan=\"3\">where NO UPPER abbreviates ~$ [UPPER -[] ].</td></tr><tr><td/><td/><td colspan=\"3\">The defi~ion describes a regular relation whose</td></tr><tr><td/><td/><td colspan=\"3\">members contain any number (including zero) of</td></tr><tr><td/><td/><td colspan=\"3\">iterations of [UPPER . x. LOWER], possibly alter-</td></tr><tr><td/><td/><td colspan=\"3\">nating with strings not containing UPPER that are</td></tr><tr><td/><td/><td colspan=\"3\">mapped to themselves.</td></tr><tr><td/><td/><td colspan=\"2\">1.1. Examples</td></tr><tr><td/><td/><td colspan=\"3\">We illustrate the meaning of the replacement op-</td></tr><tr><td/><td/><td colspan=\"3\">erator with a few simple examples. The regular</td></tr><tr><td/><td/><td colspan=\"2\">expression</td></tr><tr><td/><td/><td/><td/><td>[8]</td></tr><tr><td/><td/><td colspan=\"3\">a b I c -> x ;</td></tr><tr><td/><td/><td colspan=\"3\">(same as [[a b]</td><td>[ c] -> x)</td></tr><tr><td/><td/><td colspan=\"3\">describes a relation consisting of an infinite set of</td></tr><tr><td/><td/><td colspan=\"2\">pairs such as</td></tr><tr><td/><td/><td/><td/><td>[9]</td></tr><tr><td/><td/><td colspan=\"2\">abaca</td></tr><tr><td/><td/><td>x</td><td>a x a</td></tr><tr><td/><td/><td colspan=\"3\">where all occurrences of ab and c are mapped to x</td></tr><tr><td/><td/><td colspan=\"3\">interspersed with unchanging pairings. It also in-</td></tr><tr><td/><td/><td colspan=\"3\">dudes all possible pairs like</td></tr><tr><td/><td/><td/><td/><td>[101</td></tr><tr><td/><td/><td colspan=\"2\">x a x a</td></tr><tr><td/><td/><td colspan=\"2\">xaxa</td></tr><tr><td/><td>[5]</td><td colspan=\"3\">that do not contain either ab or c anywhere.</td></tr><tr><td>[ ]</td><td>the empty string language.</td><td/><td/></tr><tr><td colspan=\"2\">~ $ [ ] the null set.</td><td/><td/></tr></table>",
"type_str": "table",
"html": null,
"text": "For convenience we represent identity pairs by a single symbol; for example, we write a : a as a. The symbol ? represents here the identity pairs of symbols that are not explicitly present in the network. In this case, ? stands for any identity pair other than a : a, b : b, c : c, and x : x. Transitions that differ only with respect to the label are collapsed into a single multiply labelled arc. The state labeled 0 is the start state. Final states are distinguished by a double circle."
},
"TABREF2": {
"num": null,
"content": "<table><tr><td colspan=\"3\">the LOWER part is irrelevant because there is no</td></tr><tr><td colspan=\"3\">replacement. This expression is a description of the</td></tr><tr><td colspan=\"2\">sigma-star language.</td></tr><tr><td colspan=\"3\">If LOWER describes the empty set, replacement be-</td></tr><tr><td colspan=\"3\">comes deletion. For example,</td></tr><tr><td/><td/><td>[16]</td></tr><tr><td>a I b-></td><td>[]</td></tr><tr><td colspan=\"3\">removes all as and bs from the input.</td></tr><tr><td colspan=\"3\">If LOWER describes the null set, as in</td></tr><tr><td/><td/><td>[17]</td></tr><tr><td colspan=\"2\">a [ b -> ~$[]</td><td>;</td></tr><tr><td colspan=\"3\">all strings containing UPPER, here a or b, are ex-</td></tr><tr><td colspan=\"3\">cluded from the upper side language. Everything</td></tr><tr><td colspan=\"3\">else is mapped to iiself. An equivalent expression is</td></tr><tr><td>~$ [a [ b].</td><td/></tr><tr><td/><td/><td>[141</td></tr><tr><td/><td/><td>[] -> a [ b</td></tr><tr><td/><td/><td>the expression compiles to a transducer that freely</td></tr><tr><td/><td/><td>inserts as and bs in the input string.</td></tr><tr><td/><td/><td>If UPPER describes the null set, as in,</td></tr><tr><td/><td/><td>[151</td></tr><tr><td/><td/><td>~$[] -> a [ b</td><td>;</td></tr></table>",
"type_str": "table",
"html": null,
"text": "Let us illustrate the meaning of the replacement operator by considering what our definition implies in a few spedal cases.If UPPER is the empty set, as in"
}
}
}
} |