ACL-OCL / Base_JSON /prefixP /json /P95 /P95-1003.json
Benjamin Aw
Add updated pkl file v3
6fa4bc9
{
"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\">-&gt; 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 -&gt; x ;</td></tr><tr><td/><td/><td colspan=\"3\">(same as [[a b]</td><td>[ c] -&gt; 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-&gt;</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 -&gt; ~$[]</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>[] -&gt; 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>~$[] -&gt; 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"
}
}
}
}