File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/84/p84-1073_metho.xml
Size: 7,758 bytes
Last Modified: 2025-10-06 14:11:44
<?xml version="1.0" standalone="yes"?> <Paper uid="P84-1073"> <Title>LR Pa rse rs For Natural Languages,</Title> <Section position="3" start_page="354" end_page="354" type="metho"> <SectionTitle> 3 MLR Parsers </SectionTitle> <Paragraph position="0"> of different parses have in the chart parsing method \[10, 11\]. The idea should be made clear by the following example.</Paragraph> <Paragraph position="1"> An example grammar and its MLR parsing table produced by the construction algorithm are shown in fig. 1 and 2, respectively. The MLR parsing table construction algorithm is exactly the same as the algorithm for LR parsers. Only the difference is that an MLR parsing table may have multiple entries. Grammar symbols starting with ..... represent pre-terminals. &quot;sh n&quot; in the action table (the left part of the table) indicates the action &quot;shift one word from input buffer onto the stack, and go to state n&quot;. &quot;re n&quot; indicates the action &quot;reduce constituents on the stack using rule n&quot;. &quot;acc&quot; stands for tile action &quot;accept&quot;, and blank spaces represent &quot;error&quot;. Goto table (the right part of the table) decides to what state the parser should go aftera reduce action. The exact definition and operation of LR parsers can be found in Aho and Ulhnan \[4\].</Paragraph> <Paragraph position="2"> We can see that there are two multiple entries ir~ the table; on the rows of state tt and 12 at the column of &quot;'prep&quot;. As mentioned above, once a parsing table has multiple entries, deterministic parsing is no longer possible; some kind of non-determinism is necessary. We .~hali see that our dynamic programming approach, which is described below, is much more efficient than conventional breath-first or depth-first search, and makes MLR parsing feasible.</Paragraph> </Section> <Section position="4" start_page="354" end_page="355" type="metho"> <SectionTitle> 4 An Example </SectionTitle> <Paragraph position="0"> In this section, we demonstrate, step by step, how our MLR parser processes the sentence: I SAW A MAN WITH A TELESCOPE using the grammar and the parsing table shown in fig t and 2. This sentence is ambiguous, and the parser should accept the sentence in two ways.</Paragraph> <Paragraph position="1"> Until the system finds a multiple entry, it behaves in tile exact same manner as a conventional LR parser, as shown in fig 3-a below. The number on the top (ri.qhtmost) of the stack indicates the current state. Initially, the current state is 0. Since the parser is looking at the word &quot;1&quot;, whose category is &quot;*n&quot;, the next action &quot;shift and goto state 4&quot; is determined from the parsing table. &quot;\]he. parser takes the word &quot;1&quot; away from the input buffer, and pushes the preterminal &quot;*n&quot; onto tile stack. The next word the parser is looking at is &quot;SAW&quot;, whose category is &quot;'v&quot;, and &quot;reduce using rule 3&quot; is determined as the next action. After reducing, the parser determines the current state, 2, by looking at the intersection of the row of state 0 and the column of &quot;NP deg', and so on.</Paragraph> <Paragraph position="2"> Our approach is basically pseudo-parallelism (breath-first search). When a process encounters a multiple entry with n different actions, the process is split into n processes, and they are executed individually and parallelly. Each process is continued until either an &quot;error&quot; or an &quot;accept&quot; action is found. The processes are, however, synchronized in the following way: When a process &quot;shifts&quot; a word, it waits until all other processes &quot;shift&quot; the word. Intuitively, all processes always look at the same word. After all processes shift a word, the system may find that two or more processes are in the ~lnle state; that is, some processes have a common state number on the top of their stacks. These processes would do the exactly same thing until that common state number is popped from their stacks by some &quot;reduce&quot; action. In our parser, this common part is processed only once. As soon as two or more processes in a common state are found, they are combined into one process. This combining mechanism guarantees that any part of an input sentence is parsed no more than once in the same manner.&quot; This makes the parsing much more efficient than simple breath-first or depth-first search. Our method has the same effect in terms of parsing efficiency that posting and recognizing common subconstituents At this point, tile system finds a multiple entry with two different actions, &quot;reduce 7&quot; and &quot;.3hilt g&quot;. Both actions are processed in parallel, as shown in fig 3-b.</Paragraph> <Paragraph position="3"> State *det *n *v &quot;prep $ NP PP VP S .................................................................... (2) S --> S PP 4 (3) NP --> =n 5 (4) NP --> *det *n 6 (5) NP --> NP PP 7 (6) PP --> =prep NP 8 (7) VP --> &quot;v NP 9 .......................... 10 This process is also finished by the action &quot;accept&quot;. The system has accepted the input sentence in both ways. It is important to note that any part of the input sentence, including the prepositional phrase &quot;WITH A TELESCOPE&quot;, is parsed only once in the same way, without maintaining a chart.</Paragraph> <Paragraph position="4"> Here, the system finds that both processes have the common state number, 6, on the top of their slacks. It combines two proces:;os into one, and operates as if there is only one process, as shown in fig 3-c.</Paragraph> </Section> <Section position="5" start_page="355" end_page="355" type="metho"> <SectionTitle> 5 Another Example </SectionTitle> <Paragraph position="0"> Some English words belong to more than one gramillatical category. When such a word is encountered, tile MLR parsing table can immediately tell which of its cutegories are legal and which are not. When more than one of its categories are legal, tile parser behaves as if a multiple entry were encountered. The idea should be'made clear by the following example.</Paragraph> <Paragraph position="1"> Consider the word &quot;that&quot; in the sentence: That information is important is doubtful.</Paragraph> <Paragraph position="2"> A ~3ample grammar and its parsing table are shown in Fig. 4 and 5, respectively. Initially, the parser is at state O. The first word &quot;that&quot; can be either &quot;&quot;det&quot; or &quot;*that&quot;, and the parsing table tells us that both categories are legal. Thus, the parser processes &quot;sh 5&quot; and &quot;sh 3&quot; in parallel, as shown below.</Paragraph> <Paragraph position="3"> The action &quot;reduce 6&quot; pops the common state number 6, and the system can no longer operate the two processes as one. The two processes are, again, operated in parallel, as shown in fig At this point, the parser founds that both processes are in the same state, namely state 2, and they are combined as one process.</Paragraph> <Paragraph position="4"> Fig 3-e (1) S --> NP VP 2 (2) NP --> &quot;det *n 3 (3) NP --> &quot;n 4 (4) NP --) *that S 5 (5) VP --> &quot;be &quot;adj 6 Finally, the sentence has been parsed in only one way. We emphasize again that, &quot;in spite of pseudo-parallelism, each part of the sentence was parsed only once in the same way.</Paragraph> </Section> class="xml-element"></Paper>