UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

An augmented transition network grammar for English Jervis, Jean E. 1974

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Notice for Google Chrome users:
If you are having trouble viewing or searching the PDF with Google Chrome, please download it here instead.

Item Metadata

Download

Media
831-UBC_1974_A6_7 J47_3.pdf [ 7.34MB ]
Metadata
JSON: 831-1.0051768.json
JSON-LD: 831-1.0051768-ld.json
RDF/XML (Pretty): 831-1.0051768-rdf.xml
RDF/JSON: 831-1.0051768-rdf.json
Turtle: 831-1.0051768-turtle.txt
N-Triples: 831-1.0051768-rdf-ntriples.txt
Original Record: 831-1.0051768-source.json
Full Text
831-1.0051768-fulltext.txt
Citation
831-1.0051768.ris

Full Text

AUGMENTED TRANSITION NETWORK GRAMMAR FOR ENGLISH by Jean E. J e r v i s B . S c , U n i v e r s i t y of B r i t i s h Columbia, 1972 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE i n the Department of COMPUTER SCIENCE We accept t h i s t h e s i s as conforming to the r e g u i r e d standard. The U n i v e r s i t y of B r i t i s h Columbia May 197*. In p r e s e n t i n g t h i s t h e s i s in p a r t i a l f u l f i l m e n t o f the requ i rement s f o r an advanced degree at the U n i v e r s i t y of B r i t i s h Co lumb ia , I a g ree t h a t the L i b r a r y s h a l l make i t f r e e l y a v a i l a b l e f o r r e f e r e n c e and s tudy . I f u r t h e r agree t h a t p e r m i s s i o n f o r e x t e n s i v e c o p y i n g o f t h i s t h e s i s f o r s c h o l a r l y purposes may be g r a n t e d by the Head o f my Department or by h i s r e p r e s e n t a t i v e s . It i s u n d e r s t o o d that c o p y i n g o r p u b l i c a t i o n o f t h i s t h e s i s f o r f i n a n c i a l g a i n s h a l l not be a l l o w e d w i thout my w r i t t e n p e r m i s s i o n . Department o f Computer Science The U n i v e r s i t y o f B r i t i s h Co lumbia Vancouver 8, Canada Date May 2k, 1974. i i ABSTRACT The use o f augmented t r a n s i t i o n network (ATM) gramaars f o r the a n a l y s i s of n a t u r a l language sentences i s d i s c u s s e d . A small sample grammar i s i l l u s t r a t e d and b r i e f l y d e s c r i b e d . An ATN grammar for E n g l i s h was implemented and i s d e s c r i b e d i n d e t a i l . T h i s grammar uses both semantic and s y n t a c t i c i n f o r m a t i o n t o guide the p a r s i n g . The value of the ATM model f o r n a t u r a l language a n a l y s i s i s c r i t i c a l l y e v a l u a t e d . i i i TABLE_OF_CONTENTS I. INTRODUCTION .1 I I . GENERAL OVERVIEW AND BACKGROUND 3 1. T r a n s i t i o n Network Grammars 3 2. Simple T r a n s i t i o n Network Grammar .5 3. Augmented T r a n s i t i o n Network (ATN) Grammars .8 4. The Implementation Of An ATN Grammar ....12 u.A Semantic Markers ...........13 4.B System Overview 14 4.C C a p a b i l i t i e s Of The Grammar .14 I I I . SYSTEM DESCRIPTION ..16 1. Pre-Scan Of The Input Sentence ..........16 1.A The D i c t i o n a r y ....17 1. B Morphemic A n a l y s i s 19 2. The Grammar ....21 2. A The Sentence L e v e l Network 27 2.A.1 D e c l a r a t i v e Sentences .27 T r a n s i t i v e Verbs 27 I n t r a n s i t i v e Verbs 29 I n d i r e c t Objects ..30 P r e d i c a t e A d j e c t i v e s 32 P r e d i c a t e A d j e c t i v e Complements 33 A u x i l i a r y Verbs 33 Negation 36 Verb P a r t i c l e s .39 i v "That" Ana "To" Verb Complements 40 2.A.2 Imperative Sentences ..41 2.A.3 Passive Sentences 42 Fi n d i n g The Agent Of P a s s i v e Sentences 43 2.A.4 Questions 45 Yes-No Questions ..46 Question Adverbs ........47 Question Pronouns ..48 Question Determiners 50 2.A.5 Conjoined Sentences ....51 2.A.6 Noun And P r e p o s i t i o n Phrase Utterances 53 2.B The Noun Phrase Network 54 2.B.1 B a s i c P a r s i n g S t r a t e g y ..54 2.B.2 Simple Noun Phrases ..........55 2.B.3 The Pre-Nominal M o d i f i e r s 56 Determiners .........56 O r d i n a l s 57 Q u a n t i f i e r s 57 A d j e c t i v e s 58 2.B.4 Post-Nominal M o d i f i e r s 59 P r e p o s i t i o n Phrases ....59 R e l a t i v e Clauses 60 2.B.5 Incomplete Noun Phrases 61 2.B.6 "Something" C o n s t r u c t i o n s .62 2.B.7 Conjoined Noun Phrases 63 2.C Extensions ..63 2.C.1 E x i s t e n t i a l "There" ...63 2.C.2 Subordinate Clauses 64 2.C.3 Comparatives .......65 2.C.4 D e c l a r a t i v e Questions 65 2.C.5 Coordinate Conjunctions 66 2.C.6 R e l a t i v e Clause Disambiguation ................66 2. C.7 Punctuation 66 3. The Semantic And Grammatical T e s t s 67 3. A Sentence Network 67 3. A.1 The Semantic T e s t s 67 3.A.2 Subject-Verb Number Agreement .................72 3.B Noun Phrase Network ........73 3.B.1 Semantic T e s t s ,73 3.B.2 Determiner-Noun Number Agreement ..............75 IV. COMMENTS 76 1. Use Of ATN Grammars 76 1.A Advantages 76 1.A.1 Ease Of W r i t i n g 76 1.A.2 F l e x i b i l i t y 77 1.A.3 Ca p t u r i n g R e g u l a r i t i e s .78 1.B C r i t i c i s m s ......79 1.B.1 Ordered Backup 80 1.B.2 Parsed C o n s t i t u e n t s ...........................82 1.B.3 Recursion ........83 1.B.4 Sentences Which F a i l To Parse .................85 1.B.5 Operation Of The Parser ........86 v i 2. Suggestions For P r o s p e c t i v e Grammar W r i t e r s ..........88 2.A Common Problems 88 2.B Ordering The Arcs .................................89 2.C C o n d i t i o n s On The Arcs .90 BIBLIOGRAPHY 92 APPENDIX 1 - HOW TO RUN .........9<l APPENDIX 2 - SAMPLE PARSES 96 APPENDIX 3 - THE GRAMMAR 118 APPENDIX 4 - THE DICTIONARY 139 APPENDIX 5 - THE MORPH TABLE 143 APPENDIX 6 - THE PREPASS ROUTINES .............. 14U APPENDIX 7 - THE SEMANTICS ROUTINES .......................148 APPENDIX 8 - THE AUXILIARY GRAMMAR ROUTINES ...............152 APPENDIX 9 - THE PARSER .........154 v i i TABLE OF FIGURES F i g u r e 1 - Simple T r a n s i t i o n Network Grammar ..............6 F i g u r e 2 - The Grammar 22 F i g u r e 3 - Parse of a Simple D e c l a r a t i v e Sentence 30 F i g u r e 4 - Parse of a Sentence with I n d i r e c t Object ,32 F i g u r e 5 - Parse of a Sentence i n Future P e r f e c t P r o g r e s s i v e Tense 35 F i g u r e 6 - Parse of a Sentence C o n t a i n i n g the Modal "Can" .36 F i g u r e 7 - Parse of an Imperative Sentence 41 F i g u r e 8 - Parse of a Pa s s i v e Sentence , ..43 F i g u r e 9 - Parse of a Yes-No Question .,. ,...,47 F i g u r e 10 - Parse of a Noun Phrase 55 v i i i ACKNOWLEDGEMENT I would l i k e t o thank my s u p e r v i s o r s . Dr. Raymond R e i t e r and Dr. Richard Rosenberg f o r o r i g i n a l l y i n t e r e s t i n g me i n computational l i n g u i s t i c s and f o r t h e i r many v a l u a b l e s u g g e s t i o n s and c r i t i c i s m s . The f i n a n c i a l support of the N a t i o n a l Research C o u n c i l i s g r a t e f u l l y acknowledged. AN AUGMENTED TRANSITION NETWORK GRAMMAR FOR ENGLISH 1 1± INTRODUCTION The f i e l d of computational l i n g u i s t i c s i s p r i m a r i l y concerned with the study of machine understanding of n a t u r a l language. The term " n a t u r a l language" i n t h i s t h e s i s r e f e r s to w r i t t e n E n g l i s h . T r a d i t i o n a l l y r e s e a r c h i n t o the s t r u c t u r e of language has been the domain of the f i e l d of l i n g u i s t i c s . L i n g u i s t i c s seeks to develop an all-encompassing theory of language, whereas the goals of computational l i n g u i s t i c s are somewhat more p r a c t i c a l . L i n g u i s t i c s attempts to c h a r a c t e r i z e the s t r u c t u r a l r e g u l a r i t i e s o f language by proposing grammatical t h e o r i e s which enable a l l well-formed sentences of the language to be generated. Computational l i n g u i s t i c s i s more concerned with the r e c o g n i t i o n of sentences; that i s , given a sentence determine i t s s t r u c t u r a l components and the r e l a t i o n s h i p among them. L i n g u i s t i c theory i s not of much help i n t h i s s i t u a t i o n . " P a t h o l o g i c a l " cases which may be of great importance to the l i n g u i s t g e n e r a l l y do not concern the computational l i n g u i s t who i s more i n t e r e s t e d i n a system which works a c c u r a t e l y and e f f i c i e n t l y on a " u s e f u l " subset of E n g l i s h . The primary o b j e c t i v e i n computational l i n g u i s t i c s i s understanding the i n f o r m a t i o n which i s being communicated; the form of the i n f o r m a t i o n i s of l e s s importance. The f i r s t step i n machine understanding of a sentence i s decomposing or p a r s i n g the sentence i n t o i t s s t r u c t u r a l 2 components. Many p a r s i n g schemes have been suggested^7 ]. T h i s t h e s i s i n v e s t i g a t e s the use of augmented t r a n s i t i o n network (ATN) grammars f o r the a n a l y s i s of E n g l i s h sentences. The ATN model of n a t u r a l language was developed by Hoods[11]. T h i s model i s capable of performing the e g u i v a l e n t of a t r a n s f o r m a t i o n a l a n a l y s i s of E n g l i s h sentences i n a c o m p u t a t i o n a l l y e f f i c i e n t manner. T h i s t h e s i s d i s c u s s e s the development of an ATN grammar f o r E n g l i s h which i d e n t i f i e s a subset of E n g l i s h t h a t would be used, f o r example, i n a g u e s t i o n answering system. Both semantic and s y n t a c t i c i n f o r m a t i o n are used to guide the p a r s i n g . 3 H i GENERAL OVERVIEW AND BACKGROUND The f i r s t s e c t i o n i n t h i s chapter d i s c u s s e s the use of t r a n s i t i o n networks f o r the a n a l y s i s of E n g l i s h sentences. In the next s e c t i o n a s m a l l sample grammar i s i l l u s t r a t e d and e x p l a i n e d . Augmented t r a n s i t i o n network (ATN) grammars are d i s c u s s e d i n the t h i r d s e c t i o n . The l a s t s e c t i o n g i v e s a b r i e f i n t r o d u c t i o n to the implementation d i s c u s s e d i n Chapter I I I . 1*. T r a n s i t i o n Network Grammars T h i s s e c t i o n d e s c r i b e s the t r a n s i t i o n network grammar model developed by Woods[11,12 ]. A t r a n s i t i o n network grammar model i s an extension of the i d e a of a f i n i t e s t a t e t r a n s i t i o n diagram. A t r a n s i t i o n network grammar c o n s i s t s of a network of nodes with a r c s connecting them. The nodes r e p r e s e n t the s t a t e s of the " p a r s i n g machine" and the a r c s connecting them r e p r e s e n t p o s s i b l e t r a n s i t i o n s . Each a r c i s l a b e l l e d with the events which permit a t r a n s i t i o n from t h a t s t a t e to the next. In a t r a n s i t i o n network grammar the events correspond to the occurrence of words i n the i n p u t . The network has a d i s t i n g u i s h e d s t a t e c a l l e d the s t a r t s t a t e and a s e t of d i s t i n g u i s h e d s t a t e s c a l l e d f i n a l s t a t e g . A s t a t e i s s a i d to accept or re c o g n i z e a s t r i n g i f the s t r i n g permits a seguence of t r a n s i t i o n s from that s t a t e t o a f i n a l s t a t e . The a r c s i n a a t r a n s i t i o n network grammar may be e i t h e r l e x i c a l a r c s which correspond to t r a n s i t i o n s permitted by s i n g l e words or r e c u r s i o n a r c s (PUSH arcs) which invoke r e c u r s i v e a p p l i c a t i o n s of the network to r e c o g n i z e a phrase of some kin d . Woods[11] c o n s i d e r s t h a t there are f i v e b a s i c a r c types -PUSH, POP, JUMP, TST, and CAT. A CAT a r c r e p r e s e n t s a t r a n s i t i o n t h a t may be taken i f the c u r r e n t word i n the i n p u t s t r i n g i s a member of the s y n t a c t i c category i n d i c a t e d on the a r c . A f t e r a CAT a r c i s f o l l o w e d the i n p u t s t r i n g i s advanced cau s i n g the next word i n the i n p u t to become the c u r r e n t word. A TST a r c i s s i m i l a r to a CAT arc except that the c o n d i t i o n s f o r the t r a n s i t i o n are s p e c i f i e d by the a r b i t r a r y c o n d i t i o n on the a r c . A CAT a r c i s a c t u a l l y a s p e c i a l case of a TST a r c , but because i t i s so commonly used i t i s given a s e p a r a t e name. A JUMP arc i s l i k e a TST a r c except the i n p u t s t r i n g i s not advanced. T h i s a r c i s u s e f u l f o r bypassing s t a t e s where o p t i o n a l c o n s t i t u e n t s are i d e n t i f i e d . A POP a r c i s a pseudo a r c because i t has no d e s t i n a t i o n s t a t e . I t i s c o n s i d e r e d to be an arc so that i t s order with r e s p e c t to the other a r c s l e a v i n g the s t a t e may be e s t a b l i s h e d . The POP a r c i n d i c a t e s that the s t a t e i s a f i n a l or a c c c e p t i n g s t a t e f o r the t r a n s i t i o n network. A PUSH a r c invokes a c a l l to the network whose name i s on 5 the a r c . The PUSH a r c permits a t r a n s i t i o n t o be made i f the s p e c i f i e d phrase can be recog n i z e d at the c u r r e n t p o s i t i o n i n the sentence. For example, i f the NP network i d e n t i f i e s noun phrases then the PUSH NP a r c must l o c a t e a noun phrase a t the c u r r e n t p o s i t i o n before the t r a n s i t i o n may be made. The PUSH a r c advances the i n p u t s t r i n g beyond the l a s t word of the rec o g n i z e d phrase. The p a r s i n g system a l s o r e c o g n i z e s two o t h e r types of a r c s . A HRD a r c permits a t r a n s i t i o n i f the c u r r e n t word i s the same as the word named on the a r c . A HEM a r c i s f o l l o w e d i f the c u r r e n t word i s a member of the l i s t of words given on the a r c . Zs. Simple T r a n s i t i o n Network Grammar A simple t r a n s i t i o n network grammar i s shown i n Fig u r e 1. T h i s network grammar r e c o g n i z e s simple d e c l a r a t i v e sentences with noun phrases c o n t a i n i n g determiners and a d j e c t i v e s . Consider the sentence: The b i g dog chased him. To r e c o g n i z e t h i s sentence, p r o c e s s i n g s t a r t s i n s t a t e S of the network. A t r a n s i t i o n may be made to s t a t e S-NP i f a phrase of the type recognized by the NP network ( i . e . a noun phrase) i s found. The PUSH a r c remembers the s t a t e of the top l e v e l computation and passes c o n t r o l to s t a t e NP. Ptgure 1 - Simple Transition Network Grammar 7 The parser now t r i e s to parse a noon phrase s t a r t i n g at s t a t e NP. The c u r r e n t word "the" i s a determiner so the CAT DET a r c permits a t r a n s i t i o n to s t a t e NP-DET, then the a d j e c t i v e " b i g " causes a t r a n s i t i o n to s t a t e NP-ADJ and the noun "dog" a t r a n s i t i o n t o s t a t e NP-NP. The POP a r c at s t a t e NP-NP causes a r e t u r n to the PUSH a r c a t s t a t e S. Since the PUSH was s u c c e s s f u l , a t r a n s i t i o n to s t a t e S-NP i s made. From S-NP the verb "chased" permits a t r a n s i t i o n to s t a t e S-V. Although S-V i s a f i n a l s t a t e the l a s t word of the in p u t has not been processed so the s t r i n g cannot be accepted here. The PUSH NP a r c i s taken to s t a t e S-S because the pronoun "him" i s recognized i n the NP network. S i n c e S-S i s a f i n a l s t a t e and "him" i s the l a s t word, the s t r i n g i s recognized as a sentence. 8 Augmented T r a n s i t i o n Network J ATN], Grammars The augmented t r a n s i t i o n network (ATN) parser d e s c r i b e d i n t h i s s e c t i o n was o r i g i n a l l y implemented at Harvard and subseguently extended at B o l t , Beranek, and Newman by Woods[ 11,12,13]. For more d e t a i l e d documentation of Hoods' parser p l e a s e r e f e r to Woods[12,13]. A simple v e r s i o n of t h i s parser was implemented a t the U n i v e r s i t y of B r i t i s h Columbia by R. B e i t e r . A complete l i s t i n g of t h i s parser may be found i n Appendix 9. The t r a n s i t i o n network grammar d e s c r i b e d above a c t s only as a sentence r e c o g n i z e r . In order f o r such a grammar to be.of any p r a c t i c a l value i t must a l s o be a b l e to provide a d e s c r i p t i o n of the s y n t a c t i c s t r u c t u r e of a recog n i z e d sentence. The ATN grammar prov i d e s t h i s c a p a b i l i t y by b u i l d i n g up a s t r u c t u r a l d e s c r i p t i o n of the sentence as i t proceeds from s t a t e to s t a t e . The components of t h i s d e s c r i p t i o n are placed i n r e g i s t e r s which are maintained at each l e v e l of the r e c u r s i v e network. Each POP a r c of the grammar has a form a s s o c i a t e d with i t which s p e c i f i e s how these r e g i s t e r s are to be assembled i n t o the s t r u c t u r a l r e p r e s e n t a t i o n which i s ret u r n e d from that s t a t e . S t r u c t u r e - b u i l d i n g a c t i o n s on the a r c s of the grammar may t e s t , s e t , or a l t e r the contents of the r e g i s t e r s . Each arc of the network may have an a r b i t r a r y c o n d i t i o n a s s o c i a t e d with i t which must be s a t i s f i e d b e f o r e the a r c i s f o l l o w e d . 9 The c o n d i t i o n s and s t r u c t u r e - b u i l d i n g a c t i o n s on the a r c s of the network p r o v i d e the t r a n s i t i o n network grammar with c a p a b i l i t i e s e q u i v a l e n t to those of a t r a n s f o r m a t i o n a l grammar[1 ]. By manipulating the contents of the r e g i s t e r s the grammar now has the a b i l i t y t o move, copy, and d e l e t e fragments of the sentence s t r u c t u r e . The c o n d i t i o n s on the a r c s and the r e g i s t e r t e s t i n g a c t i o n s permit the grammar to behave i n a context dependent manner. The design of the ATN grammar permits s t r u c t u r a l d e s c r i p t i o n s to be b u i l t up i n a f l e x i b l e manner. The pieces of sentence s t r u c t u r e are s t o r e d i n the r e g i s t e r s u n t i l the parser reaches the f i n a l s t a t e . Since the d e c i s i o n as t o the f i n a l s t r u c t u r e of the parse i s postponed u n t i l a l l the components have been i d e n t i f i e d , the components of the parse may be ordered d i f f e r e n t l y than the order i n which they occurred i n the i n p u t . A t e n t a t i v e d e c i s i o n as to the f u n c t i o n of a component may be r e v e r s e d and the r e g i s t e r s re-arranged i f a subsequent i n p u t i n d i c a t e s t h a t the d e c i s i o n was i n c o r r e c t . The VIR a r c and HOLD a c t i o n p r o v i d e a convenient method of d e a l i n g with d i s p l a c e d c o n s t i t u e n t s i n the i n p u t . Some tr a n s f o r m a t i o n s cause c o n s t i t u e n t s to be moved to the f r o n t of the sentence. For example, a simple yes-no q u e s t i o n such as: Is the man t a l k i n g ? i s i n t r o d u c e d by an a u x i l i a r y verb. The d i s p l a c e d c o n s t i t u e n t ("is") i s found f i r s t i n a l e f t to r i g h t parse and although i t 10 i s obvious t h a t i t i s d i s p l a c e d , i t s c o r r e c t p o s i t i o n i n the sentence i s as yet unknown. The HOLD a c t i o n a l l o w s the c o n s t i t u e n t ("is") t o be placed on a HOLD stack where i t w i l l remain u n t i l a s t a t e i s encountered where i t would normally be i d e n t i f i e d . At t h i s p o i n t the VIR a r c can remove the c o n s t i t u e n t from the HOLD stack and t r e a t i t as though i t had j u s t occurred i n the i n p u t . T h i s f e a t u r e i s very u s e f u l s i n c e i t a l l o w s the grammar w r i t e r to take f u l l advantage of the r e g u l a r i t i e s of n a t u r a l language. The t r a n s i t i o n network i s n o n - d e t e r m i n i s t i c ; the input does not uniguely determine a path through the network. Thus there w i l l be E n g l i s h sentences which have s e v e r a l d i s t i n c t paths through the network. These are s a i d to be ambiguous with r e s p e c t to the grammar. The p a r s i n g a l g o r i t h m should be capable of f o l l o w i n g a l l paths f o r a given sentence. The parser c o n s i d e r s the a r c s l e a v i n g a s t a t e i n the order i n which they occur. The f i r s t p o s s i b l e a r c i s f o l l o w e d . I f t h i s c h o i c e l a t e r t u r n s out to be u n s u c c e s s f u l the parser backs up, t r y i n g a l l other a l t e r n a t i v e s i n the order i n which they occur, u n t i l e i t h e r a path i s found through the network or i t i s determined t h a t no path e x i s t s . Sentences which are ambiguous with r e s p e c t to the grammar can be parsed i n more than one way. Consider the sentence: They are f l y i n g planes. T h i s sentence may be parsed i n two d i f f e r e n t ways. E i t h e r "are 11 f l y i n g " i s the p r o g r e s s i v e form of the verb " f l y " or " f l y i n g " i s used t o modify the noun "planes". The t r a n s i t i o n network w i l l r e t u r n the parse generated by the f i r s t path through the network. When common usage and context are taken i n t o c o n s i d e r a t i o n i t i s u s u a l l y c l e a r which of the parses of a s y n t a c t i c a l l y ambiguous sentence i s most l i k e l y intended. The problem, then, i s to f i n d the "most l i k e l y " path f i r s t . Even when ambiguous sentences are not i n v o l v e d , i t i s important f o r reasons o f e f f i c i e n c y t o t r y to f i n d the c o r r e c t path q u i c k l y , thereby minimizing the amount of s e a r c h i n g t h a t must be done. The o r d e r i n g of the a r c s l e a v i n g the s t a t e s and the c o n d i t i o n s on them allow the parser t o t r y the more common or more l i k e l y c o n s t r u c t i o n s f i r s t . The t r a n s i t i o n network parser i s w r i t t e n i n L i s p . T h i s programming language appears to be an e x c e l l e n t c h o i c e f o r t h i s a p p l i c a t i o n s i n c e r e c u r s i o n i s very n a t u r a l i n the language. L i s p i s an i n t e r p r e t e d language so i t i s p o s s i b l e to use a r b i t r a r y L i s p f u n c t i o n s as w e l l as the r e g i s t e r manipulating f u n c t i o n s s u p p l i e d by the parser f o r the c o n d i t i o n s and a c t i o n s on t h e a r c s . The L i s p environment a l s o makes s o p h i s t i c a t e d i n t e r a c t i v e debugging a i d s a v a i l a b l e to the grammar w r i t e r [ 2 ] . 12 i i i The Iff£lgrcgStatign of an ATN Grammar For many a p p l i c a t i o n s i n n a t u r a l language a n a l y s i s i t i s not necessary to o b t a i n a l l p o s s i b l e p a r s i n g s of the i n p u t sentence. Although a sentence may be ambiguous with r e s p e c t to the grammar, i t u s u a l l y w i l l not be ambiguous when the meaning of the words and the context i n which i t was u t t e r e d are taken i n t o c o n s i d e r a t i o n . Thus h e u r i s t i c s can be used i n an attempt t o s e l e c t the "most l i k e l y " parse i n a given c o n t e x t . In an ATN grammar t h i s can be done by o r d e r i n g the a r c s l e a v i n g each s t a t e i n the grammar so t h a t those corresponding to the most probable a n a l y s e s are t r i e d f i r s t . C o n d i t i o n s may be placed on the a r c s so t h a t t h e i r o r d e r i n g becomes dependent on the f e a t u r e s of the sentence being analyzed. Woods[11] mentions that these c o n d i t i o n s may i n c o r p o r a t e semantic as w e l l as s y n t a c t i c f e a t u r e s of the words. However he does not appear to use any semantic i n f o r m a t i o n to guide the p a r s i n g i n the LSNLIS system[ 13]. The ATN grammar d e s c r i b e d i n the next chapter i s an extended v e r s i o n of the HALT system grammar[3] using semantic markers to a i d i n the s e l e c t i o n of the "most l i k e l y " parse s t r u c t u r e . 13 4. A Semantic Markers The concept of semantic markers was f i r s t i n t roduced by Fodor and Katz i n "The S t r u c t u r e of a Semantic Theory". They comment t h a t : "... the semantic markers assigned to a l e x i c a l item i n a d i c t i o n a r y e n t r y are intended to r e f l e c t whatever s y s t e m a t i c semantic r e l a t i o n s hold between that item and the r e s t of the vocabulary of the language."* Thus semantic markers provide a semantic c l a s s i f i c a t i o n of words which may be used by the c o n d i t i o n s on the a r c s of the grammar to exclude s e m a n t i c a l l y meaningless parses. The d e t e r m i n a t i o n of the "most l i k e l y " p a r s i n g of some sentences r e q u i r e s knowledge of the context i n which the sentence occurred. T e s t s are used i n a d d i t i o n to the semantic markers f o r determining whether the parsed s t r u c t u r e i s reasonable i n terms of i t s c o n t e x t . » J . J . Katz and J . A. Fodor. "The S t r u c t u r e of a Semantic Theory." The S t r u c t u r e of Language: Readings i n the Philosophy of Language! Ed. J . A. Fodor and J . J . Katz. P r e n t i c e - H a l l , 1964, p. ~497. 14 4_j_B System Overview Before the p a r s i n g of a sentence i s attempted a PREPASS program scans the sentence to ensure that a l l the words are r e c o g n i z e d by the system. The PREPASS program must e s t a b l i s h c o r r e c t e n t r i e s i n the system d i c t i o n a r y f o r a l l the words i n the sentence. A morphemic a n a l y s i s r o u t i n e i s used to c r e a t e d i c t i o n a r y e n t r i e s f o r r e g u l a r l y i n f l e c t e d words whose r o o t forms are a l r e a d y i n the d i c t i o n a r y . C o n t r a c t i o n s and a b b r e v i a t i o n s are expanded to t h e i r f u l l forms at t h i s time. The r e s u l t i n g sentence i s passed to the parser f o r a n a l y s i s . An ATN grammar i s used to parse the sentence i n t o a deep s t r u c t u r e - l i k e r e p r e s e n t a t i o n . As d i s c u s s e d above, h e u r i s t i c s i n v o l v i n g semantic as w e l l as s y n t a c t i c i n f o r m a t i o n are used to guide the p a r s i n g . The d i c t i o n a r y which c o n t a i n s s y n t a c t i c and semantic i n f o r m a t i o n f o r each word i s accessed throughout the p a r s i n g p r o c e s s . {KC C a p a b i l i t i e s of the Grammar The grammar i d e n t i f i e s a subset of E n g l i s h c o n s t r u c t i o n s t h a t would be used, f o r example, i n a g u e s t i o n answering system. Many types of g u e s t i o n s and r e l a t i v e c l a u s e s as w e l l as d e c l a r a t i v e and i m p e r a t i v e sentences are r e c o g n i z e d . Verbs may have d i r e c t and i n d i r e c t o b j e c t s , p r e p o s i t i o n a l phrases, p r e d i c a t e a d j e c t i v e s , complements, or p a r t i c l e s i f a p p r o p r i a t e . 15 V a r i o u s tenses and modal forms of verbs are i d e n t i f i e d . Sentences may be i n the a c t i v e or pa s s i v e v o i c e . Some negative forms and c o n j o i n e d phrases are r e c o g n i z e d . Sentence fragments c o n s i s t i n g of noun or p r e p o s i t i o n phrases are i d e n t i f i e d . 16 I l l i SYSTEM DESCRIPTION The gen e r a l o r g a n i z a t i o n of the p a r s i n g system i s d i s c u s s e d i n t h i s chapter. The f i r s t s e c t i o n d e a l s with the pre-scan of the sentence, the second with the grammar i t s e l f , and the l a s t with the semantic t e s t s . Is. Pre^scan of the Inj)Ut Sentence Before the a c t u a l p a r s i n g of a sentence i s attempted, c o r r e c t d i c t i o n a r y e n t r i e s must be e s t a b l i s h e d f o r a l l the words i n the in p u t sentence. A morphemic an a l y s e r reduces the number of words necessary i n the i n i t i a l d i c t i o n a r y by removing s u f f i x e s from r e g u l a r l y i n f l e c t e d nouns, verbs, a d j e c t i v e s and adverbs. Numbers, l i s t s and other proper nouns are assig n e d s y n t a c t i c c a t e g o r i e s and entered i n t o the d i c t i o n a r y . C o n t r a c t i o n s and a b b r e v i a t i o n s are expanded at t h i s time i n t o t h e i r f u l l forms. Phrases which are con s i d e r e d as a u n i t by the system are c o l l a p s e d i n t o a s i n g l e hyphenated word. These f u n c t i o n s are a l l handled by the PREPASS r o u t i n e s . Please r e f e r to Appendix 6 f o r a complete l i s t i n g of the PREPASS f u n c t i o n s . 17 l i l The D i c t i o n a r y The d i c t i o n a r y e n t r y f o r a word i s found on the property l i s t of t h a t word. The property f l a g DICT i n d i c a t e s t h a t a word has a d i c t i o n a r y e n t r y . The d i c t i o n a r y c o n t a i n s both s y n t a c t i c and semantic i n f o r m a t i o n . The s y n t a c t i c i n f o r m a t i o n w i l l be c o n s i d e r e d f i r s t . I n f l e c t i o n a l f e a t u r e s of a word are s t o r e d on the word»s prop e r t y l i s t under the p r o p e r t y f l a g of the a p p r o p r i a t e s y n t a c t i c category (N, V, ADV, DET, e t c . ) . For the r o o t form of a word t h i s e n t r y i s an atom such as ER-EST, S-EC, e t c . T h i s e n t r y i s used by the morphemic a n a l y s e r . I n f l e c t e d word forms have an entry c o n s i s t i n g of a l i s t of i n f l e c t i o n a l f e a t u r e s . The f i r s t element of t h i s l i s t i s the r o o t form of the word, the other elements are i n f l e c t i o n a l f e a t u r e s such as number, case, person, e t c . For verbs a second l i s t under the f l a g FEATURES, has a l i s t of atoms s p e c i f y i n g s p e c i a l f e a t u r e s of the verb. These i n d i c a t e whether the verb may take a d i r e c t or i n d i r e c t o b j e c t or that-complement, whether i t may be p a s s i v i z e d or act as an a u x i l i a r y , modal or copula, e t c . Verbs such as " p i c k " which may be used with a p a r t i c l e (e.g. " p i c k up") have a l i s t c o n s i s t i n g of a d m i s s i b l e v e r b - p a r t i c l e combinations under the f l a g PARTICLES. Semantic i n f o r m a t i o n a l s o occurs i n the d i c t i o n a r y . T h i s i n f o r m a t i o n i s used i n p a r s i n g sentences to a i d i n the s e l e c t i o n of the most l i k e l y parse and to r e j e c t o b v i o u s l y n o n s e n s i c a l 18 i n p u t . Each noun may have a l i s t of semantic markers such as ANIMATE, PHYSOBJ, EVENT, e t c . under the f l a g N-TYPE. These markers may be very s p e c i f i c or they may d e s c r i b e only the g e n e r a l c l a s s i f i c a t i o n i n t o which the noun f a l l s . A L i s p p r e d i c a t e may be found on the p r o p e r t y l i s t of a noun under the f l a g N-SEMANTICS. T h i s p r e d i c a t e which i s e v a l u a t e d when a noun phrase i s i d e n t i f i e d may make more s p e c i f i c s y n t a c t i c or semantic checks on the components of the phrase. Pronouns, with the e x c e p t i o n of " i t " and "they", have semantic marker ANIMATE under the f l a g N-TYPE. An a d j e c t i v e may a l s o have a l i s t of semantic markers under the f l a g ADJ-TYPE d e s c r i b i n g the types of nouns that i t may modify. A verb may have semantic markers under the f l a g s SOBJ-TYPE, DO-TYPE, and INDO-TYPE d e s c r i b i n g the c l a s s e s of s u b j e c t s , d i r e c t and i n d i r e c t o b j e c t s r e s p e c t i v e l y t h a t can reasonably be expected to accompany t h i s verb. A L i s p p r e d i c a t e may be found on the property l i s t of a verb under the f l a g V-SEMANTICS. T h i s p r e d i c a t e can perform any type of semantic checks on the parse t r e e and i s evaluated a f t e r the parse i s completed. I f the semantic markers are absent then the word i s assumed to be compatible i n a l l s i t u a t i o n s . For example the a d j e c t i v e "good" has no semantic markers s i n c e i t may modify almost any type of noun. I n t e g e r s are entered i n t o the d i c t i o n a r y under the category INTEGER on an atom whose printname i s the same as the i n t e g e r . L i s t s are entered as proper nouns and are assigned a name (LIST 1, LIST2, etc.) by the PREPASS r o u t i n e . The r o o t form i n 19 the d i c t i o n a r y i s the l i s t i t s e l f . A word i n the d i c t i o n a r y may be fla g g e d SUBSTITUTE. I f t h i s word i s encountered i n an i n p u t sentence PREPASS w i l l r e p l a c e i t with the s u b s t i t u t e word or words. T h i s f e a t u r e may be used f o r a l t e r n a t i v e s p e l l i n g s , or expanding c o n t r a c t i o n s or a b b r e v i a t i o n s . For example, " c a n ' t " and "cannot" are both r e p l a c e d by "can not" f o r ease i n p r o c e s s i n g . The f l a g COMPOUND may a l s o be found on a word i n the d i c t i o n a r y . Under the f l a g COMPOUND there i s a l i s t of compounds t h a t t h i s word forms. I f t h i s word i s encountered i n an i n p u t sentence PREPASS searches the next words i n the s t r i n g to see i f any group of words i s the same as one of the p o s s i b l e compounds. I f so, PREPASS w i l l r e p l a c e the words by the compounded form. For example, "how many" i s compounded to "how-many" s i n c e the two words behave as one. The c u r r e n t system d i c t i o n a r y may be found i n Appendix 4. Ii5 Morphemic A n a l y s i s The morphemic a n a l y s i s f a c i l i t y reduces the number of i n i t i a l d i c t i o n a r y e n t r i e s needed i n the system. A r e g u l a r l y i n f l e c t e d noun, verb, a d j e c t i v e , or adverb r e g u i r e s only a s i n g l e d i c t i o n a r y entry c o n t a i n i n g i t s root form and a code i n d i c a t i n g the type of r e g u l a r i n f l e c t i o n the word uses. The 20 morphemic ana l y z e r then can r e c o g n i z e a l l r e g u l a r l y i n f l e c t e d forms of the roo t word and p l a c e the a p p r o p r i a t e entry i n the d i c t i o n a r y . The a n a l y s i s i s done by using a t a b l e c a l l e d HORPHTABLE. T h i s t a b l e i s a l i s t , each element of which c o n s i s t s of a s u f f i x to be removed from a word f o l l o w e d by a l i s t of p o s s i b l e s y n t a c t i c c a t e g o r i e s f o r the r e s u l t i n g word. The morphemic a n a l y s i s makes no attempt t o re c o g n i z e p r e f i x e s or more complicated s i t u a t i o n s such as the example below, where words move from one s y n t a c t i c category to another adding s u f f i x e s each time. Examples: t r a n s p o r t -> t r a n s p o r t a t i o n formal -> f o r m a l i z e -> f o r m a l i z a t i o n A l i s t i n g of HORPHTABLE may be found i n Appendix 5. The morphemic a n a l y s i s r o u t i n e s are l i s t e d i n Appendix 6. 21 2.±. The Grammar T h i s s e c t i o n d i s c u s s e s the o v e r a l l o r g a n i z a t i o n of the grammar and examines i n some d e t a i l the problems encountered and the s t r a t e g i e s used i n s o l v i n g these problems. Please see Chapter I I f o r a g e n e r a l d i s c u s s i o n of augmented t r a n s i t i o n network grammars and p a r s e r s . The t r a n s i t i o n network diagram of the grammar i n F i g u r e 2 w i l l be u s e f u l i n understanding t h i s s e c t i o n . The s t a t e names i n the grammar i n d i c a t e the l e v e l of the network being processed and the c o n s t i t u e n t s of t h a t network a l r e a d y i d e n t i f i e d . For example the s t a t e SP-N i n d i c a t e s t h a t the H P - l e v e l of the network i s being processed and that a noun has been i d e n t i f i e d , u n l e s s the order of the a r c s i s e x p l i c i t l y i n d i c a t e d by numbers on the a r c s , they are numbered clockwise from the top of the s t a t e . For f u r t h e r d e t a i l s concerning the t e s t s and a c t i o n s on the a r c s p l e a s e see the complete grammar l i s t i n g i n Appendix 3. The parses produced by the grammar are s i m i l a r to the deep s t r u c t u r e s produced by Woods[13]. B a s i c a l l y the parse of a sentence c o n s i s t s of the s u b j e c t , an a u x i l i a r y verb segment s p e c i f y i n g the tense and modality, and a verb phrase c o n t a i n i n g the main verb, and the d i r e c t and i n d i r e c t o b j e c t s , complements, p r e p o s i t i o n phrases and adverbs, i f any of these are present. The deep s t r u c t u r e of a p a s s i v e sentence i s i d e n t i c a l to i t s a c t i v e c o u n t e r p a r t . Questions are transformed to t h e i r F i g u r e 2 continued 25 Figure 2 continued CD 27 d e c l a r a t i v e forms. The exact s p e c i f i c a t i o n of the form of the deep s t r u c t u r e s i s contained i n the l i s t i n g of the s t r u c t u r e -b u i l d i n g r o u t i n e s i n Appendix 8 and i n the l i s t i n g of the grammar i n Appendix 3. Some sample parses may be found i n Appendix 2. 2..A The Sentence L e v e l Network The sentence or S - l e v e l network i s the main network i n the grammar. T h i s network i d e n t i f i e s the s u b j e c t , tense, main verb, and p o s t - v e r b a l m o d i f i e r s , i f any, of the sentence, checks the semantic agreement of the major components and b u i l d s the a s s o c i a t e d parse t r e e . The i n i t i a l s t a t e i n the grammar i s S. 2.A.I D e c l a r a t i v e Sentences The p a r s i n g of a simple d e c l a r a t i v e sentence embodies the b a s i c p a r s i n g s t r a t e g y . A l l the more complicated sentence types are handled with minor v a r i a t i o n s of t h i s s t r a t e g y . T r a n s i t i v e verbs Consider the sentence: The boy k i c k s the b a l l . The p a r s e r s t a r t s by comparing the s t r i n g to the grammar i n 28 s t a t e S. The f i r s t word "the" does not look l i k e the beginning of an E n g l i s h q u e s t i o n so the p r e d i c a t e s which t e s t f o r tensed a u x i l i a r y verbs and qu e s t i o n words f a i l and the f i r s t two JUMP ar c s are excluded. The i n p u t does not s t a r t with an untensed verb as an im p e r a t i v e does nor with an i n t r o d u c t o r y p r e p o s i t i o n phrase so the next two JUMP a r c s are a l s o excluded. The JUMP S-DCL a r c i s taken s i n c e the i n p u t does not begin l i k e a g u e s t i o n . How i t has been e s t a b l i s h e d t h a t the in p u t i s a d e c l a r a t i v e sentence, so the TYPE r e g i s t e r i s s e t to DCL. At s t a t e S-DCL the parser i s s t i l l l o o k i n g a t the word "the" s i n c e the JUMP a r c does not advance the input s t r i n g . In t h i s s t a t e the p a r s e r attempts t o l o c a t e the s u b j e c t noun phrase. The only a r c i s a PUSH to the noun phrase (NP) l e v e l which i s s u c c e s s f u l and the s t r u c t u r e : (NP (DET THE) (N BOY (NUMBER SG) ) (NU SG) ) i s r e t u r n e d . The parser proceeds to s t a t e S-NP to look f o r verbs. The c u r r e n t word i s " k i c k s " . The VIR V a r c f a i l s s i n c e there i s nothing on the HOLD s t a c k . The c u r r e n t word i s a tensed verb which agrees i n number (singul a r ) and person ( t h i r d ) with the s u b j e c t so the CAT V a r c i s taken. The c u r r e n t word becomes "the". The parser proceeds t o s t a t e S-AUX to look f o r a main verb. No more verbs are found so the l a s t a r c i n S-AUX, a JUMP t o S-V-SEMANTICS i s taken. The semantic agreement between the s u b j e c t and the verb i s checked i n S-V-SEMANTICS. Since the verb " k i c k " has the ANIMATE s u b j e c t "boy" the check succeeds and the p a r s e r jumps to s t a t e S-V. At t h i s s t a t e i n the network the 29 s u b j e c t and main verb have been i d e n t i f i e d and the parser attempts t o f i n d the p o s t - v e r b a l m o d i f i e r s , Since the verb " k i c k " i s t r a n s i t i v e the POSH NP a r c attempts t o l o c a t e an o b j e c t noun phrase. T h i s a r c succeeds and the s t r u c t u r e : (NP (DET THE) (BALL (NUMBER SG)) (NU SG) ) becomes the d i r e c t o b j e c t of the verb. The remaining i n p u t s t r i n g i s now NIL, so the parse proceeds on a s e r i e s of JUMP ar c s through the remaining s t a t e s of the S - l e v e l network to the f i n a l s t a t e S-S. Before the f i n a l POP a r c can be taken the semantic agreement among the p r i n c i p a l elements of the parse must be checked. The semantic check succeeds s i n c e the verb " k i c k " has the ANIMATE s u b j e c t "boy" and the PHYSOBJ d i r e c t o b j e c t " b a l l " . The s t r u c t u r e i n Figure 3 i s produced as the deep s t r u c t u r e o f the in p u t sentence. Thus the b a s i c s t r a t e g y f o r simple d e c l a r a t i v e sentences i n v o l v e s f i n d i n g the s u b j e c t noun phrase at S-DCL, the verb at S-NP, and the o b j e c t noun phrase at S-V. The parser then jumps to S-S where the semantics are checked and the parse popped. I n t r a n s i t i v e verbs Example: The men t a l k e d . I f the main verb i s i n t r a n s i t i v e the parse r does not look f o r an o b j e c t noun phrase at S-V. Instead the parser jumps 30 SENTENCE: THE BOY KICKS THE BALI PARSE: S MOOD DCL VOICE ACTIVE NP DET THE N BOY NUMBER SG NU SG AUX TNS PRESENT VP V KICK NP DET THE N BALL NUMBER SG NU SG Fi g u r e 3 - Parse of a Simple D e c l a r a t i v e Sentence through the remainder of the s t a t e s t o S-S. Minor v a r i a t i o n s on t h i s s t r a t e g y r e c o g n i z e p o s t - v e r b a l m o d i f i e r s such as adverbs and p r e p o s i t i o n phrases. I n d i r e c t o b j e c t s The p a r s i n g s t r a t e g y becomes more complicated when the main verb may take an i n d i r e c t o b j e c t . Consider the f o l l o w i n g sentences: (1) He gave the book to the boy. (2) He gave the boy the book. Jacobs and Rosenbaum i n " E n g l i s h T r a n s f o r m a t i o n a l Grammar"[U] e x p l a i n t h a t these sentences are both generated from the same deep s t r u c t u r e , the only d i f f e r e n c e being that an a d d i t i o n a l 31 t r a n s f o r m a t i o n has been a p p l i e d to sentence (2). The " i n d i r e c t o b j e c t i n v e r s i o n t r a n s f o r m a t i o n " r e v e r s e s the order of the d i r e c t and i n d i r e c t o b j e c t noun phrases and d e l e t e s the p r e p o s i t i o n . T h i s t r a n s f o r m a t i o n i s o p t i o n a l s i n c e both sentences (1) and (2) are grammatical. Sentences of the f i r s t type, i n which there i s no i n d i r e c t o b j e c t i n v e r s i o n t r a n s f o r m a t i o n , are parsed i n the same manner as other sentences with t r a n s i t i v e verbs. The o n l y d i f f e r e n c e i s t h a t the i n d i r e c t o b j e c t appears i n a p r e p o s i t i o n a l phrase as a p o s t - v e r b a l m o d i f i e r . The parse produced i s shown i n F i g u r e 4. Now c o n s i d e r sentences i n which i n d i r e c t o b j e c t i n v e r s i o n has o c c u r r e d . The verb i s i d e n t i f i e d a t s t a t e S-NP. Since i t i s t r a n s i t i v e the " d i r e c t " o b j e c t i s picked up at S-V. The p a r s e r jumps to s t a t e S-V-NP. The POSH NP a r c i s attempted here because the verb " g i v e " i s f l a g g e d as being able to take an i n d i r e c t o b j e c t (INDOBJ). The push to the noun phrase network i s s u c c e s s f u l . At t h i s p o i n t the r e g i s t e r s c o n t a i n i n g the deep s t r u c t u r e are re-arranged. The noun phrase s t r u c t u r e j u s t found becomes the d i r e c t o b j e c t of the verb and a p r e p o s i t i o n phrase c o n s i s t i n g of the p r e v i o u s " d i r e c t " o b j e c t and the p r e p o s i t i o n " t o " i s c o n s t r u c t e d . The parser then jumps to s t a t e S-S s i n c e the e n t i r e s t r i n g has been analysed. The parse produced f o r sentence (2) i s e x a c t l y the same as f o r sentence (1) s i n c e both sentences were produced from the same deep s t r u c t u r e . 32 SENTENCE: HE GAVE THE BOOK TO THE EOY PASSE: S HOOD DCL VOICE ACTIVE NP DET N i l PBO HE NUMBER SG SUBJ PNCODE 3SG NU SG AUX TNS PAST VP V GIVE NP DET THE N BOOK NUMBER SG NU SG PP PREP TO NP DET THE N BOY NUMBER SG NU SG Fi g u r e 4 - Parse of a Sentence with I n d i r e c t Object P r e d i c a t e a d j e c t i v e s Copula verbs may be f o l l o w e d by p r e d i c a t e a d j e c t i v e s . Example: The boy was young. At s t a t e S-V i f the main verb was a copula verb, the parser checks f o r the presence of a p r e d i c a t e a d j e c t i v e . Since the p r e d i c a t e a d j e c t i v e m o d i f i e s the s u b j e c t a semantic check i s performed on the s u b j e c t and a d j e c t i v e . I f the two are compatible the p r e d i c a t e a d j e c t i v e becomes the verb i n the deep 33 s t r u c t u r e . In one theory of t r a n s f o r m a t i o n a l grammar[4] the deep s t r u c t u r e of t h i s type of sentence has the a d j e c t i v e as the v e r b a l and an o b l i g a t o r y "copula t r a n s f o r m a t i o n " i n t r o d u c e s the c o p u l a verb i n t o the sentence. P r e d i c a t e a d j e c t i v e complements Consider the sentence: The boy was younger than h i s b r o t h e r . A p r e d i c a t e a d j e c t i v e complement may f o l l o w a comparative p r e d i c a t e a d j e c t i v e . The p a r s e r r e c o g n i z e s the p r e d i c a t e a d j e c t i v e i n s t a t e S-V. A n a l y s i s of the i n p u t continues at S-PR EDADJ. I f the word "than" i s found and the a d j e c t i v e has the f e a t u r e COMPARATIVE the scan proceeds to s t a t e S-PREDADJ-COMP. Here the parser attempts t o f i n d a noun phrase which becomes the o b j e c t of the p r e d i c a t e a d j e c t i v e "verb", No semantic checking i s done a t t h i s p o i n t , although the p r e d i c a t e a d j e c t i v e must be s e m a n t i c a l l y compatible with the o b j e c t noun phrase. T h i s check should be added to the grammar. A u x i l i a r y verbs Thus f a r only sentences d i s c u s s e d . A u x i l i a r y verbs are c a r r y the tense and modality, i f with simple verbs have been important i n E n g l i s h s i n c e they any, of the sentence. 34 Examples: (1) They had t a l k e d . (2) They w i l l have been t a l k i n g . (3) They can t a l k . (4) They c o u l d have t a l k e d . (5) They do t a l k . The a u x i l i a r y verb i s i d e n t i f i e d at s t a t e S-NP. T h i s verb must be tensed and agree i n person and number with the s u b j e c t . The tense (PRESENT or PAST) i s saved i n r e g i s t e r TNS. The pa r s e r then proceeds to s t a t e S-ADX to look f o r more verbs. T h i s s t a t e r e c o g n i z e s f u t u r e t e n s e s , the p e r f e c t , p r o g r e s s i v e , and p e r f e c t p r o g r e s s i v e aspects of verbs as w e l l as modal and emphatic "do" c o n s t r u c t i o n s . P a s s i v e c o n s t r u c t i o n s are rec o g n i z e d i n t h i s s t a t e . These w i l l be d i s c u s s e d l a t e r . The verbs " w i l l " and " s h a l l " are both c o n s i d e r e d to be f u t u r e tense a u x i l i a r i e s and t h e i r modal meanings are ignored s i n c e they seem to be very commonly misused i n everyday E n g l i s h . The modal verbs "can", "may", " c o u l d " , "might", e t c . are a l l assig n e d PRESENT tense. Rosenbaum and Jacob s [ 4 ] c o n s i d e r the s y n t a c t i c tense of the modals "can", "may", e t c . to be present and " c o u l d " , "might", "would", e t c . to be past. The s y n t a c t i c tense does not appear to c a r r y much semantic s i g n i f i c a n c e , so i t seemed more reasonable to leave the tenses as present. L a t e r i t may be more p r a c t i c a l to add a CONDITIONAL mood or tense. A f t e r a p a s s i v e or an emphatic use of the word "do" i s encountered the parser goes to s t a t e S-V s i n c e no more verbs may f o l l o w . 35 Examples: They do t a l k . The book was g i v e n . Otherwise the p a r s e r remains i n s t a t e S-AUX u n t i l a l l the verbs a r e found. An emphatic use of the word "do" i s parsed as i f "do" were a modal. SENTENCE: THEY WILL HAVE BEEN TALKING PARSE: S MOOD DCL VOICE ACTIVE NP DET NIL PRO THEY NUMBER PL SUBJ PNCODE 3PL NU PL AUX TNS FUTURE PERFECT PROGRESSIVE VP V TALK F i g u r e 5 - Parse of a Sentence i n Future P e r f e c t P r o g r e s s i v e Tense The deep s t r u c t u r e s f o r sentences (2) and (3) are shown i n F i g u r e s 5 and 6. These deep s t r u c t u r e s resemble those d i s c u s s e d by Jacobs and Rosenbaum[n ]. T h e i r deep s t r u c t u r e s have a v e r b a l segment ( u s u a l l y the verb) with f e a t u r e s i n d i c a t i n g p r o g r e s s i v e or p e r f e c t aspect, or both, and an a u x i l i a r y segment. The a u x i l i a r y may or may not be a modal and has a tense f e a t u r e . According to the t h e o r y of t r a n s f o r m a t i o n a l grammar the s u r f a c e 36 SENTENCE: THEY CAN TALK PARSE: S MOOD DCL VOICE ACTIVE NP DET NIL PRO THEY NUMBER PL SUBJ PNCODE 3PL NU PL AUX TNS PRESENT MODAL CAN VP V TALK F i g u r e 6 - Parse of a Sentence Con t a i n i n g the Modal "Can" s t r u c t u r e s are generated by a p p l y i n g r a t h e r complicated t r a n s f o r m a t i o n s . During t h i s process the a u x i l i a r y segment may be d e l e t e d . I f i t immediately precedes the verb and i s n e i t h e r p e r f e c t nor a modal then i t s f e a t u r e s are placed on the verb and the a u x i l i a r y i s d e l e t e d . Thus an a u x i l i a r y does not appear i n the s u r f a c e s t r u c t u r e of present tense sentences l i k e the f o l l o w i n g : The man t a l k s . Negation The grammar can a l s o i d e n t i f y n e g ative sentences. Examples: He does not come. He must not come. They won*t be coming. 37 I f an a u x i l i a r y verb has been found i n s t a t e S-NP, the grammar w i l l r e c o g n i z e the word "not" i n s t a t e S-AUX. The f l a g NEGATIVE i s then added to the sentence type. According to Jacobs and Hosenbaum the c o n s t i t u e n t NEGATIVE appears i n the deep s t r u c t u r e of a negative sentence. The "ne g a t i v e placement t r a n s f o r m a t i o n " p l a c e s the NEGATIVE c o n s t i t u e n t immediately a f t e r the a u x i l i a r y i n the deep s t r u c t u r e . Further t r a n s f o r m a t i o n s r e p l a c e NEGATIVE by "not" and the a u x i l i a r y , i f one i s not alr e a d y present, by "do". An o p t i o n a l t r a n s f o r m a t i o n c o n t r a c t s the a u x i l i a r y and "not". Thus sentences such as the f o l l o w i n g are formed. Example: He doesn't come. The c o n t r a c t i o n s are expanded t o t h e i r f u l l forms by the PREPASS r o u t i n e s , so the grammar need not be concerned with them. I t can be seen from the t r a n s f o r m a t i o n s d e s c r i b e d above t h a t a l l negative sentences c o n t a i n a u x i l i a r y verbs. T h e r e f o r e the verb "do" i n negative sentences i s not being used as a modal, so i t does not appear i n the deep s t r u c t u r e . Klima i n "Negation i n E n g l i s h " [ 6 ] d i s c u s s e s many other a s p e c t s of ne g a t i o n . Adverbs such as "never", " h a r d l y " , " s c a r c e l y " , "seldom", e t c . convey v a r y i n g degrees of n e g a t i v i t y . 38 Examples: He never b e l i e v e d him. He h a r d l y b e l i e v e d him. Verbs may a l s o be i n h e r e n t l y negative or convey some degree of n e g a t i v i t y . Examples: He was unable to come. He doubted he would come. Negative a d j e c t i v e s and pronouns may a l s o negate the sentence. Examples: No men came. Not much was done. There are a l s o negative c l a u s e s i n t r o d u c e d by "not", " n e i t h e r " and " n e i t h e r - n o r " combinations. Examples: He seldom came and n e i t h e r d i d she. I t n e i t h e r r a i n e d nor snowed that winter. I t o l d him not to come today. Negation does not n e c e s s a r i l y imply sentence negation. Examples: A not u n a t t r a c t i v e woman a r r i v e d l a t e r . The c h i l d r e n were very unhappy. The r u l e s d e s c r i b i n g the scope of the negation and the other s t r u c t u r e s which may accompany the negation become f a i r l y complex. The grammar does not handle these c o n s t r u c t i o n s , with the exception of the words "no", "none", and "nothing". There i s room f o r much more work to be done i n t h i s area. 39 Verb p a r t i c l e s A sentence may c o n t a i n a verb p a r t i c l e i n i t s verb phrase. A p a r t i c l e looks l i k e a p r e p o s i t i o n , but behaves q u i t e d i f f e r e n t l y . Compare these sentences: (1) The robot picked up the b l o c k . (2) The man t a l k e d on the phone. In sentence (1) the word "up" may be transposed to the end of the sentence: (3) The robot p i c k e d the block up. The second sentence may not be transposed i n t h i s manner: (4) *The man t a l k e d the phone on. The word "up" i n sentences (1) and (3) i s c a l l e d a verb p a r t i c l e . The t r a n s p o s i t i o n of the p a r t i c l e from i t s p o s i t i o n immediately a f t e r the verb to the f a r s i d e o f the o b j e c t phrase i s caused by the " p a r t i c l e movement t r a n s f o r m a t i o n " [ 4 ]. T h i s t r a n s f o r m a t i o n i s o p t i o n a l when the o b j e c t i s a simple noun phrase s i n c e sentences (1) and (3) are both grammatical. The t r a n s f o r m a t i o n must occur i f the o b j e c t phrase i s a pronoun: The man put i t down. *The man put down i t . The grammar r e c o g n i z e s p a r t i c l e s which occur immediately a f t e r the verb (S-V) or o b j e c t noun phrase (S-V-TOCOMP). The parser checks the d i c t i o n a r y to ensure that the v e r b - p a r t i c l e combination i s v a l i d , then the verb i s a l t e r e d to a verb-p a r t i c l e compound form. P a r t i c l e s are assumed to be p r e p o s i t i o n s which i s perhaps a poor assumption i n the case of 40 p a r t i c l e s l i k e " a p a r t " . " I a n d ^To^ verb complements "That" complements may occur a f t e r any verb that i s f l a g g e d THAT i n the d i c t i o n a r y . Example: I hope that you come. Reduced " t h a t " complements are a l s o r e c o g n i z e d . Example: I hope you come. The complement i s i d e n t i f i e d at s t a t e S-V-WRD=THAT by pushing to the S-DCL network. "To" complements may occur a f t e r any verb. They may be p a s s i v e . Examples: I want to t a l k to you. He had to be taken home. I want John to t a l k t o Mary. The complement i s i d e n t i f i e d at s t a t e S-V-WRD=TO by pushing to the S-NP l e v e l network. The s u b j e c t of the lower l e v e l sentence i s the o b j e c t of the top l e v e l sentence, i f i t i s present, otherwise i t i s the s u b j e c t . <41 2_.J_1.I_2! Impgrativg Sentences Imperative sentences begin with an untensed verb, o p t i o n a l l y preceded by an adverb or " p l e a s e " . Examples: (1) Give the book to the man. (2) Do not l o s e the p e n c i l . (3) Please go home. The s t a t e S-IMP i d e n t i f i e s the verb and s e t s up "you" as the dummy s u b j e c t . P a r s i n g c o n t i n u e s at s t a t e S-AUX where a neg a t i v e c o n s t r u c t i o n i s i d e n t i f i e d . The deep s t r u c t u r e of sentence (2) i s shown i n F i g u r e 7. SENTENCE: DO NOT LOSE THE PENCIL PARSE: S HOOD NEGATIVE IMP VOICE ACTIVE NP DET NIL PRO YOU NU SG-PL AUX TNS UNTENSED VP V LOSE NP DET THE N PENCIL NUMBER SG NU SG Fi g u r e 7 - Parse of an Imperative Sentence U2 2. A..3 Passive Sentences Examples: The f u n c t i o n was executed. The book was given to the boy. Pa s s i v e sentences are parsed i n the same way as a c t i v e sentences u n t i l s t a t e S-AUX i s reached. Then i f the a u x i l i a r y verb i s "be" and the c u r r e n t word i s a past p a r t i c i p l e of a verb t h a t may be p a s s i v i z e d , the PASSIVEFLAG i s s e t . at t h i s p o i n t the r e g i s t e r s c o n t a i n i n g the deep s t r u c t u r e must be re-arranged. The " s u b j e c t " of the sentence i s placed on the HOLD st a c k s i n c e i t i s probably the o b j e c t of the a c t i v e sentence. Normally the s u b j e c t i s s e t to the dummy value "something" and AGFLAG i s s e t to i n d i c a t e t h a t the agent has not been found, unless a p o t e n t i a l agent has alre a d y been encountered. The vo i c e of the sentence i s s e t to PASSIVE. The pa r s e r then proceeds to s t a t e S-V. Here the d i r e c t o b j e c t i s removed from the HOLD stack and p a r s i n g continues as f o r an a c t i v e sentence. Consider the sentence: The boy was given the book. T h i s sentence i s more complicated s i n c e two t r a n s f o r m a t i o n s are i n v o l v e d , the pa s s i v e t r a n s f o r m a t i o n and the i n d i r e c t o b j e c t i n v e r s i o n t r a n s f o r m a t i o n . At s t a t e S-AUX i t i s r e a l i z e d t h a t the sentence i s p a s s i v e . The s u b j e c t becomes the dummy noun "something" and the noun phrase "the boy" i s p l a c e d on the HOLD st a c k . P a r s i n g c o n t i n u e s at s t a t e S-V where "the boy" becomes 43 the d i r e c t o b j e c t . The parser jumps to S-V-NP where "the book" i s i d e n t i f i e d as the d i r e c t o b j e c t s i n c e " g i v e " i s f l a g g e d INDOBJ, and "the boy" becomes the i n d i r e c t o b j e c t . The parse produced by the grammar i s shown i n Figure 8. SENTENCE: THE BOY WAS GIVEN THE BOOK PARSE: S MOOD DCL VOICE PASSIVE NP DET NIL PRO SOMETHING NO SG-PL AUX TNS PAST VP V GIVE NP DET THE N BOOK NUMBER SG NO SG PP PREP TO NP DET THE N BOY NUMBER SG NU SG Fi g u r e 8 - Parse of a Passive Sentence F i n d i n g the agent of p a s s i v e sentences The agent of a pa s s i v e sentence, i f i t i s present, occurs as the o b j e c t o f the p r e p o s i t i o n "by". 44 Example: The b a l l was kicked by the boy. U s u a l l y the agent appears i n the verb phrase, but i n guestions and r e l a t i v e c l a u s e s the agent may occur before i t i s known that the sentence i s p a s s i v e . Examples: By which boy was the b a l l kicked? The boy by whom the b a l l was ki c k e d i s my b r o t h e r . The f l a g FRONTED-AGFLAG i s s e t before i n t r o d u c t o r y p r e p o s i t i o n phrases are i d e n t i f i e d . Then i f the p r e p o s i t i o n phrase begins with "by" the p o t e n t i a l agent i s l i f t e d t o the AGENT r e g i s t e r i n the S - l e v e l network and no deep s t r u c t u r e i s r e t u r n e d from the p r e p o s i t i o n (PP) network. When the main verb i s i d e n t i f i e d the AGENT r e g i s t e r i s examined. I f the sentence i s pas s i v e and the AGENT (subject) agrees s e m a n t i c a l l y with the verb then the AGENT becomes the s u b j e c t and the AGFLAG i s turned o f f s i n c e the agent has been l o c a t e d . Otherwise, as i n sentences (1) and (2) the p r e p o s i t i o n a l phrase i s r e - c o n s t r u c t e d and added t o the post-v e r b a l m o d i f i e r s . (1) By which stream was i t found? (2) By which t r e e d i d the man l o s e h i s hat? Now c o n s i d e r the s i t u a t i o n where the agent occurs i n the verb phrase. In s t a t e S-AUX when i t i s d i s c o v e r e d t h a t the sentence i s p a s s i v e , the AGFLAG i s s e t to i n d i c a t e t h a t the agent has not yet been found. The AGFLAG i s SENDBed to the p r e p o s i t i o n and noun phrase networks each time the networks are 45 searched f o r p o s t - v e r b a l m o d i f i e r s . The parse i s blocked i n the i n i t i a l PP s t a t e i f the AGFLAG i s s e t and the p r e p o s i t i o n "by" i s encountered. The parser then f a i l s back through the NP and PP networks to the S - l e v e l network without p a r s i n g the p r e p o s i t i o n phrase and jumps to s t a t e S-V-PP. A HRD BY a r c t r a n s f e r s the search t o S-V-PREP=BY, which pushes f o r a noun phrase. I f t h i s agent noun phrase i s s e m a n t i c a l l y compatible as the s u b j e c t of the verb then the agent becomes the s u b j e c t and AGFLAG i s turned o f f . I f the phrase i s not compatible the p r e p o s i t i o n phrase i s r e - c o n s t r u c t e d and added to the post-v e r b a l m o d i f i e r s . The parser c o n t i n u e s from S-V-PP. I f the r e a l s u b j e c t appears i n the second p r e p o s i t i o n phrase the j u d i c i o u s l y ordered backup through the networks ensures t h a t i t w i l l be found. Examples: The book was found by the c h a i r by the man. The book was found under the t a b l e by the man. 2.J.A..4 Questions The q u e s t i o n s recognized by the grammar f a l l i n t o s e v e r a l c a t e g o r i e s . These w i l l be d i s c u s s e d i n the f o l l o w i n g s e c t i o n s . 46 Yes-no q u e s t i o n s Consider the q u e s t i o n s : (1) Did John k i c k the b a l l ? (2) Are they coming? Yes-no que s t i o n s d i f f e r from d e c l a r a t i v e sentences i n t h a t the a u x i l i a r y verb i n t r o d u c e s the sentence. I f the a u x i l i a r y i s not present then the sentence i s i n t r o d u c e d by the verb "do". Jacobs and Rosenbaum[4] e x p l a i n t h a t a QUESTION c o n s t i t u e n t i s present i n the deep s t r u c t u r e . The " i n t e r r o g a t i v e t r a n s f o r m a t i o n " i n t e r c h a n g e s the a u x i l i a r y c o n s t i t u e n t with the s u b j e c t noun phrase and the QUESTION c o n s t i t u e n t i s d e l e t e d . I f an a u x i l i a r y i s not present, the verb "do" must be in t r o d u c e d s i n c e the a u x i l i a r y c o n s t i t u e n t no lon g e r d i r e c t l y precedes the v e r b a l . Thus the use of "do" i n q u e s t i o n s i s not modal. I f the i n p u t sentence s t a r t s with a tensed a u x i l i a r y verb then the parser jumps t o s t a t e S-YESNO. The a u x i l i a r y i s placed on the HOLD stack t o be r e t r i e v e d with the VIE V arc at s t a t e S-NP. The YESNO f l a g i s s e t to i n d i c a t e t h a t s u b j e c t - v e r b i n v e r s i o n has oc c u r r e d and the sentence type i s s e t to YESNO. In a f f i r m a t i v e q u e s t i o n s the parser c o n t i n u e s to s t a t e S-DCL and p a r s i n g c o n t i n u e s as f o r d e c l a r a t i v e sentences. The deep s t r u c t u r e produced f o r sentence (1) i s shown i n F i g u r e 9. One c o m p l i c a t i o n a r i s e s i f a c o n t r a c t e d a u x i l i a r y verb occurs i n the i n p u t . Since the PREPASS r o u t i n e s u b s t i t u t e s the expanded form d i r e c t l y i n t o the i n p u t s t r i n g the "not" i s out of p l a c e . o 47 SENTENCE: DID JOHN KICK THE BALI PABSE: S MOOD YESNO VOICE ACTIVE NP DET NIL NPB JOHN NU SG AUX TNS PAST VP V KICK NP DET THE N BALL NUMBER SG NU SG Fi g u r e 9 - Parse of a Yes-No Question Example: Won»t he come? -> * w i l l not he come? Thus a t s t a t e S-YESNO-NEG the grammar checks f o r a "not" r e s u l t i n g from an expanded c o n t r a c t i o n and p a r s i n g c o n t i n u e s as f o r the a f f i r m a t i v e g u e s t i o n s . Question adverbs These guestions are i n t r o d u c e d by a g u e s t i o n adverb such as "when", "where", "why", "how", e t c . Examples: Why d i d he come? Where are the red b l o c k s ? The p a r s e r jumps to s t a t e S-WH to pi c k up the g u e s t i o n adverb. The g u e s t i o n type i s set to QADV. Pa r s i n g then continues i n the 48 same manner as f o r yes-no g u e s t i o n s . Question pronouns These g u e s t i o n s are i n t r o d u c e d by a g u e s t i o n pronoun such as "who", "which", "what", e t c . These gue s t i o n s are of three types. F i r s t l y t h e r e are g u e s t i o n s where the s u b j e c t noun phrase has been r e p l a c e d by the g u e s t i o n pronoun. No s u b j e c t -verb i n v e r s i o n occurs i n t h i s case. Example: Who saw the boy? Secondly the o b j e c t noun phrase may be r e p l a c e d . Example: What d i d he see? The t h i r d g u e s t i o n type occurs when the o b j e c t of a p r e p o s i t i o n i s r e p l a c e d by a g u e s t i o n pronoun. Example: To whom was the book given? Because the WH-guestion t r a n s f o r m a t i o n causes the g u e s t i o n pronoun phrase to be f r o n t e d , s u b j e c t - v e r b i n v e r s i o n must occur i n the second and t h i r d g u e s t i o n types. The f i r s t two g u e s t i o n types are processed i n s t a t e S-WH. The o b j e c t replacement s i t u a t i o n i s processed f i r s t on the assumption t h a t i t i s more complex and t h e r e f o r e more e a s i l y r e c o g n i z a b l e . The o b j e c t i s placed on the HOLD stack and 49 p r o c e s s i n g continues at s t a t e S-YESNO to de a l with s u b j e c t - v e r b i n v e r s i o n . The VIR NP a r c i n s t a t e S-V re c o v e r s the o b j e c t from the hold s t a c k . To ensure that no s u b j e c t replacement q u e s t i o n pronouns s l i p through the network, a t e s t at S-AUX checks t h a t any main verb which may a l s o be an a u x i l i a r y (e.g. "have", "be", "do") a l s o has an a u x i l i a r y i n the sentence. Example: Which book has the man had? The s u b j e c t replacement s i t u a t i o n i s processed by keeping the q u e s t i o n pronoun as the s u b j e c t and jumping to S-NP to con t i n u e p a r s i n g as f o r a d e c l a r a t i v e sentence. The t h i r d s i t u a t i o n where the question pronoun i s the o b j e c t of a p r e p o s i t i o n i s processed i n s t a t e S-PP. I f the WH-PHRASE f l a g was s e t by the p r e p o s i t i o n phrase network i n d i c a t i n g t h a t a question pronoun was encountered, the parser proceeds to s t a t e S-YESNO to d e a l with s u b j e c t - v e r b i n v e r s i o n . The sentence type becomes QPRO i n a l l these cases. The qu e s t i o n pronoun may o p t i o n a l l y be fo l l o w e d by a p r e p o s i t i o n phrase. Example: How many of the f u n c t i o n s are c o r r e c t ? A f r o n t e d p a r t i t i v e c o n s t r u c t i o n may a l s o i n t r o d u c e the q u e s t i o n . 50 Example: Of the f u n c t i o n s how many are c o r r e c t ? The p a r s i n g of these g u e s t i o n s may become very complex s i n c e s e v e r a l "major" t r a n s f o r m a t i o n s may occur. Consider the sentence: What was the boy given? T h i s sentence i n v o l v e s i n t e r r o g a t i v e , wh-guestion ( i . e . The "what" i s f r o n t e d . ) , p a s s i v e , and i n d i r e c t o b j e c t i n v e r s i o n t r a n s f o r m a t i o n s . In p r a c t i c a l terms t h i s i m p l i e s t h a t s e v e r a l c o n s t i t u e n t s may be on the HOLD stack at once and that care must be taken to ensure that they are removed i n the c o r r e c t order. Question determiners These guestions have a word such as "which", "what", "whose" or "how many" modifying t h e i r i n t r o d u c t o r y noun phrase. Examples: Which books d i d you take? Which man took the books? To which man were the books given? By which man were the books taken? These guestions f a l l i n t o the same three types as the g u e s t i o n pronoun guestions. The a n a l y s i s i s e s s e n t i a l l y the same with the e x c e p t i o n of the i n i t i a l few s t a t e s . S tate S-WH i d e n t i f i e s the g u e s t i o n determiner and proceeds to s t a t e S-QEET. The sentence type i s set to QDET. The determiner of the noun phrase has been i d e n t i f i e d so i t i s SENDRed to the noun phrase network 51 and the NP network i s entered at the s t a t e NP-DET to recover the r e s t of the noun phrase. P r o c e s s i n g continues at s t a t e S-WH-NP. F i r s t the parser assumes the noun phrase i s the o b j e c t of the sentence and goes to S-YESNO. I f t h i s f a i l s the p a r s e r jumps to S-NP s i n c e the noun phrase must be the s u b j e c t . The process now i s i d e n t i c a l to the q u e s t i o n pronoun s i t u a t i o n . 2^ A._5 Conjoined Sentences Only two simple types of conjoined sentences are r e c o g n i z e d . The f i r s t type i n v o l v e s the c o n j u n c t i o n of two or more complete sentences of any type. Examples: The boys ran and the g i r l s t a l k e d . Take i t or leave i t . Where d i d John go and when d i d he leave? T h i s c o n s t r u c t i o n i s recognized a f t e r a c o n j u n c t i o n has been found i n s t a t e S-MAINCLAUSE. The parser proceeds to s t a t e S-CONJ where i t pushes to the S - l e v e l network. The second type i s a sentence with a c o n j o i n e d verb phrase. Examples: They ran and jumped. He came and saw and conquered. Who picked i t up and put i t on the t a b l e ? What was p i c k e d up by the man and put on the stack? The main verb i n the second verb phrase i s processed i n s t a t e S-CONJ. I f the input s t r i n g i s now NIL the parse i s s t r u c t u r e d i n s t a t e S-CONJ-BUILD. Otherwise a l l the necessary f l a g s and 52 r e g i s t e r s are i n i t i a l l i z e d i n the lower S - l e v e l network and the p a r s e r pushes to s t a t e S-V to look f o r p o s t - v e r b a l m o d i f i e r s i n the second verb phrase. The only c o n j u n c t i o n s handled i n the grammar are the c o o r d i n a t i n g c o n j u n c t i o n s Mand*» and " o r " . The a n a l y s i s of c o n j o i n e d forms can become g u i t e complicated. I t would be u s e f u l i n attempting a more d e t a i l e d a n a l y s i s to have a v a i l a b l e a s t a c k d e s c r i b i n g the c o n s t i t u e n t s parsed. S i n c e c o o r d i n a t i n g c o n j u n c t i o n s j o i n e g u i v a l e n t c o n s t r u c t i o n s one needs to know what c o n s t r u c t i o n s should be looked f o r next. D i f f i c u l t i e s a r i s e with t h i s a n a l y s i s because c o n j u n c t i o n s j o i n c o n s t i t u e n t s with e g u i v a l e n t s u r f a c e s t r u c t u r e s . When a c o n j u n c t i o n i s encountered the sentence preceding i t has been decomposed i n t o i t s deep s t r u c t u r e . Thus i t i s necessary to guess what the s u r f a c e s t r u c t u r e must have been using the f l a g s and r e g i s t e r s . T h i s i n f o r m a t i o n must be used to deduce which elements must be i n i t i a l l i z e d f o r a n a l y z i n g the remainder of the sentence. A b e t t e r scheme i s necessary f o r more complex sentences. Another problem occurs because of the r e c u r s i v e nature of the grammar. Since each S - l e v e l network looks f o r c o n j o i n e d phrases the c o n j o i n e d c o n s t i t u e n t s become nested i n s i d e one another. T h i s seems unreasonable s i n c e the c o n s t i t u e n t s j o i n e d by a c o o r d i n a t i n g c o n j u n c t i o n are a l l e g u i v a l e n t . 53 S u b o r d i n a t i n g c o n j u n c t i o n s ("when", "where", "because", etc.) should be f a i r l y simple to add to the grammar. These c o n j u n c t i o n s are used only to subordinate one complete sentence to another and with the e x c e p t i o n of the verb tenses the s t r u c t u r e of one sentence does not a f f e c t the other. Examples: When she comes home they w i l l l eave. They w i l l leave when she comes home. 2___A___6 Noun and P r e p o s i t i o n Phrase Utterances I f the grammar cannot i d e n t i f y the i n p u t as a complete sentence i t checks to see whether i t i s e i t h e r a noun phrase or a p r e p o s i t i o n phrase. I f t h i s i s the case the in p u t i s parsed as a noun or p r e p o s i t i o n phrase u t t e r a n c e . These c o n s t r u c t i o n s could be u s e f u l as answers to gue s t i o n s i n a c o n v e r s a t i o n a l s i t u a t i o n . Examples: Where i s the bloc k ? In the box. What i s next t o i t ? A cube. 2..B The Noun Phrase Network The noun phrase or NP network i d e n t i f i e s the components of a noun phrase, checks t h e i r semantic agreement, and b u i l d s the a s s o c i a t e d parse t r e e . T h i s network i s entered from the S - l e v e l network, the P P - l e v e l network, or r e c u r s i v e l y from i t s e l f . 2__B. 1 Ba s i c p a r s i n g s t r a t e g y The p a r s i n g of a simple noun phrase embodies the b a s i c noun phrase p a r s i n g s t r a t e g y . The more complicated noun phrases are parsed using minor v a r i a t i o n s of t h i s s t r a t e g y . Consider the phrase: The young boy i n the park The determiner "the" i s i d e n t i f i e d on the CAT BET a r c i n s t a t e NP. The parser then jumps through the s t a t e s which i d e n t i f y o p t i o n a l c o n s t i t u e n t s t o NP-PART where the a d j e c t i v e phrase or ADJP network i d e n t i f i e s the a d j e c t i v e "young". The parser proceeds to s t a t e NP-ADJ where the head noun "boy" i s i d e n t i f i e d . The parser then jumps t o NP-N to look f o r post-nominal m o d i f i e r s . The p r e p o s i t i o n phrase " i n the garden" i s found and the parser jumps to NP-NP. Here the number agreement between the determiner " t h e " and the noun "boy" i s checked. The semantic agreement between the a d j e c t i v e "young" and the noun "boy" i s a l s o checked before the s t r u c t u r e i n F i g u r e 10 i s r e t u r n e d . The p o s s i b l e noun phrase c o n s t i t u e n t s are d i s c u s s e d 55 i n more d e t a i l below. PHRASE: THE YOUNG BOY IN THE PARK PARSE: NP DET THE ADJ YOUNG N BOY NUMBER SG NU SG PP PREP IN NP DET THE N PARK NUMBER SG NU SG Fi g u r e 10 - Parse of a Noun Phrase 2±B.2 Simple noun phrases The noun phrase may c o n s i s t of a s i n g l e pronoun or proper noun. Examples: He John 56 2iB-.2 The gre-nominal m o d i f i e r s Determiners T h i s c o n s t i t u e n t i s r e c o g n i z e d at s t a t e NP. Determiners i n c l u d e words such as "the", "a", " t h i s " , " t h a t " , e t c . and pos s e s s i v e pronouns ("his", " t h e i r " , e t c . ) . Another group of words i n c l u d i n g "some", "every", " a l l " , "no", "any", and "both" are considered to be determiners. T h i s c l a s s i f i c a t i o n was made because these words cannot be preceded by another determiner and may i n some cases be followed by an o r d i n a l ( i . e . a word l i k e " f i r s t " , " l a s t " , e t c . ) : Examples: •The some boys Every l a s t man The determiner s t r u c t u r e a n a l y s i s of St o c k w e l l et a l . [ 8 ] was used i n making t h i s c l a s s i f i c a t i o n . P o s s e s s i v e proper nouns are a l s o i d e n t i f i e d i n t h i s s t a t e . Example: John's b i g g e s t red book These a c t as determiners i n that they precede the other c o n s t i t u e n t s i n the noun phrase. 57 O r d i n a l s I f an o r d i n a l i s present i t must f o l l o w the determiner and precede the q u a n t i f i e r s and a d j e c t i v e s i n the noun phrase. O r d i n a l s i n d i c a t e the p o s i t i o n of the noun i n a sequence of o b j e c t s . There i s an i n f i n i t e sequence of number o r d i n a l s ( " f i r s t " , "second", " t h i r d " , . . . ) and a few others such as "next" and " l a s t " . Winograd[10] notes t h a t o r d i n a l s may be recognized s i n c e they are the only words t h a t may occur between a determiner and a number. Example: The f i r s t f i v e books S u p e r l a t i v e a d j e c t i v e s may a l s o a c t as o r d i n a l s . Example: The b i g g e s t f i v e boxes O r d i n a l s are i d e n t i f i e d a t s t a t e NP-DET. The parser then proceeds to s t a t e NP-ORD to look f o r q u a n t i f i e r s . Q u a n t i f i e r s A q u a n t i f i e r may f o l l o w an o r d i n a l . These c o n s t r u c t i o n s may be q u i t e complex. The NP-ORD s t a t e pushes to the QOANTP network to i d e n t i f y q u a n t i f i e r c o n s t r u c t i o n s . The s i m p l e s t q u a n t i f i e r s are numbers ("one", "two", " t h r e e " , . . . ) . Other words such as " s e v e r a l " , "many", "few", e t c . which are entered as q u a n t i f i e r s i n the d i c t i o n a r y are a l s o i d e n t i f i e d . 58 Examples: Two young boys The f i r s t few days More complex c o n s t r u c t i o n s are a l s o i d e n t i f i e d . Example: At l e a s t a dozen books Less than two books At l e a s t a few more than f o u r books S e v e r a l more books A d j e c t i v e s S t a t e NP-PAET i d e n t i f i e s a d j e c t i v e s and other pre-nominal m o d i f i e r s which occur a f t e r g u a n t i f i e r s and before the noun. Example: The b i g red b e a u t i f u l flower Present and past p a r t i c i p l e s of verbs may be used as a d j e c t i v e s . Examples: The running boy The painted t a b l e S u p e r l a t i v e and comparative forms of a d j e c t i v e s are r e c o g n i z e d . Examples: The most b e a u t i f u l g i r l The very o l d e s t man Nouns may a l s o be used to modify the head noun i n the phrase. Winograd[10 ] c a l l s these nouns " c l a s s i f i e r s " . 59 Example: The Christmas t r e e ornament counter P o s s e s s i v e nouns may be used as m o d i f i e r s . O r d i n a l s may occur a f t e r a p o s s e s s i v e noun s i n c e the p o s s e s s i v e noun marks the head of a p o s s e s s i v e noun phrase which a c t s as a s o r t of determiner s t r u c t u r e f o r the next noun i n the phrase. Example: His o l d e s t s i s t e r ' s f i r s t husband's house The semantic agreement r o u t i n e s ought to check the agreement among the c o n s t i t u e n t s of these p o s s e s s i v e phrases, but at present t h i s i s not done. 2iJ3*._4 Post-nominal m o d i f i e r s These noun phrase c o n s t i t u e n t s occur a f t e r the head noun i n the phrase. P r e p o s i t i o n phrases P r e p o s i t i o n phrases may modify the noun. Example: The boy i n the room A problem occurs here because the p r e p o s i t i o n phrase does not always modify the noun preceding i t . The phrase may j u s t happen to be p o s i t i o n e d d i r e c t l y a f t e r the noun although i t m o d i f i e s 60 some other element i n the sentence. Examples: (1) Give the book t o the man. (2) Put the book i n the box on the t a b l e . (3) Put the book i n t o the box. In sentences such as (2) i t i s necessary to have s p e c i f i c knowledge about the s i t u a t i o n to determine whether "on the t a b l e " m o d i f i e s "box" or "book". In sentences such as (1) and (3) the c h o i c e of p r e p o s i t i o n i n d i c a t e s t hat the phrases do not modify the preceding noun. P r e p o s i t i o n s such as " i n t o " , "onto", and " t o " are f l a g g e d as MOTION p r e p o s i t i o n s i n the d i c t i o n a r y and i f one of these i s encountered the p r e p o s i t i o n phrase i s not parsed as a post-nominal m o d i f i e r , but appears a t the sentence l e v e l . R e l a t i v e c l a u s e s R e l a t i v e c l a u s e s may be used to modify the noun. These are recog n i z e d a t s t a t e NP-N by t h e i r i n t r o d u c t o r y p r e p o s i t i o n or r e l a t i v e pronoun. The noun phrase head i s SENDRed to the S-REL network. T h i s noun phrase may be the missing s u b j e c t , o b j e c t or o b j e c t of a p r e p o s i t i o n i n the r e l a t i v e c l a u s e . I f the r e l a t i v e pronoun i s "whose" the missing noun phrase i s p o s s e s s i v e . R e l a t i v e c l a u s e s may be p a s s i v e . Examples: The man t h a t we saw The man that saw the dog The man by whom the book was given 61 The man whose dog we saw The S-REL network processes the remainder of the missing phrase and then merges back i n t o the S - l e v e l network. Reduced r e l a t i v e c l a u s e s are a l s o r e c o g n i z e d . The S-REL-REDUCED network i s searched l a s t s i n c e these c l a u s e s resemble so many other types of c o n s t r u c t i o n s . Examples: The man given the book The man we saw The man not running 2±B±5 Incomplete noun phrases I f the head noun i s missing then the noun phrase i s s a i d to be incomplete. The dummy noun "ones" becomes the head noun of the phrase. Q u a n t i f i e r s or o r d i n a l s preceded by determiners may comprise a noun phrase. Examples: Give me at l e a s t t h r e e . Give me the f i r s t (few). These c o n s t r u c t i o n s can o p t i o n a l l y be f o l l o w e d by a p a r t i t i v e c o n s t r u c t i o n . Examples: He found two of the three books. Give me the big g e s t of the books. There are some determiners ( " a l l " , "any", "some", "both", etc.) f l a g g e d QUANT i n the d i c t i o n a r y , which are used as g u a n t i f i e r s 62 i n these c o n s t r u c t i o n s . Examples: I need some. Give me any of the books. The words " a l l " and "both" may omit the " o f " i n the p a r t i t i v e . Example: A l l the boys came. A p o s s e s s i v e pronoun or proper noun may comprise a noun phrase, but may not be f o l l o w e d by a p a r t i t i v e c o n s t r u c t i o n . Examples: Give me hers. Give me John's. A phrase ending with a po s s e s s i v e noun may be used i n s t e a d of a complete noun phrase. Example: Give me h i s youngest s i s t e r ' s o l d e r b r o t h e r ' s . 2_. B._6 "Something^! c o n s t r u c t i o n s The grammar a l s o r e c o g n i z e s noun phrases c o n t a i n i n g c o n s t r u c t i o n s with "something" or "anything". These pronouns are unusual because they are f o l l o w e d by a d j e c t i v e s . Examples: B u l l s w i l l charge at anything r e d . Give me something b i g which i s on the t a b l e . These words are c l a s s i f i e d as GEHPRO (general pronouns) i n the d i c t i o n a r y . 63 2.fl.7 Conjoined noun phrases Any noun phrase may c o n s i s t of a s e r i e s of conjoined noun phrases. Examples: John and Mary A boy and h i s dog He or she or they I f a c o n j u n c t i o n i s recognized at s t a t e NP-MAINPHRASE the parser proceeds to NP-CONJ where a push to the NP network attempts to f i n d another noun phrase. Since the POSH NP forms a r e c u r s i v e c a l l to the network, any subseguent noun phrases i n the s e r i e s w i l l be nested i n s i d e the returned s t r u c t u r e . The noun phrases are a l l e g u i v a l e n t so i t would seem more reasonable to have the c o n j o i n e d phrases a l l a t the same l e v e l i n the parse. 2 ___C E x t e n s i o n s Some of the c o n s t r u c t i o n s which one might wish to add to the grammar are d i s c u s s e d i n the f o l l o w i n g s e c t i o n s . 2_. C_. 1_ E x i s t e n t i a l "There 1 1 Sentences which a s s e r t the e x i s t e n c e of t h e i r s u b j e c t s are o f t e n transformed i n t o sentences i n t r o d u c e d by the word " t h e r e " . 64 Examples: There are f i v e books on the t a b l e . How many men are the r e ? T h i s c o n s t r u c t i o n would be easy to add to the grammar. Notice t h a t the t r a n s f o r m a t i o n which produces the e x i s t e n t i a l " t h e r e " o n l y a p p l i e s when the s u b j e c t i s i n d e f i n i t e . Thus the f o l l o w i n g sentence i s a l o c a t i o n a l not e x i s t e n t i a l use of " t h e r e " : There are the books. 2.^2 Subordinate C l a u s e s Subordinate c l a u s e c o n s t r u c t i o n s should be simple to add to the grammar. Subordinate c o n j u n c t i o n s behave i n a much simpl e r manner than c o o r d i n a t e c o n j u n c t i o n s because they are used only to s u b o r d i n a t e one complete sentence to another. Examples: (1) When they a r r i v e we s h a l l have dinner. (2) I f the block i s on the t a b l e , put i t on the f l o o r . (3) He enjoyed the book although i t was very long. A complete a n a l y s i s of sentences such as (2) and (3) i n v o l v e s f i n d i n g the antecedent f o r the pronoun " i t " . T h i s task i n v o l v e s the use of semantic i n f o r m a t i o n . 65 2±C±3 Comparatives C o n s t r u c t i o n s of the form "as many as" or "more than" f o l l o w e d by a sentence would be u s e f u l , p a r t i c u l a r l y i n a q u e s t i o n answering system environment. These should not be d i f f i c u l t to i d e n t i f y . Examples: I want as many as John has. I want more books than John gave Jim. 2.C.U D e c l a r a t i v e Questions In c o n v e r s a t i o n , guestions are o f t e n expressed i n d e c l a r a t i v e form. Examples: (1) You gave the book to whom? (2) He h i t what? (3) He kicked which c h a i r ? at p r e s e n t the grammar can i d e n t i f y q u e s t i o n determiner (QDET) d e c l a r a t i v e s such as sentence (3). Question pronoun (QPBO) d e c l a r a t i v e s c o u l d be added q u i t e e a s i l y . 66 2. C.5 Coordinate Conjunctions Extension of the treatment of c o o r d i n a t e c o n j u n c t i o n s would be f a i r l y d i f f i c u l t . The scope of these c o n j u n c t i o n s must o f t e n be determined using semantic t e s t s . Please r e f e r to S e c t i o n 2.A.5 of t h i s chapter f o r f u r t h e r d i s c u s s i o n of the d i f f i c u l t i e s i n v o l v e d i n t h i s type of a n a l y s i s . 2..C..6 R e l a t i v e Clause Disambiguation The area of r e l a t i v e c l a u s e disambiguation has not been co n s i d e r e d i n the grammar. Semantic i n f o r m a t i o n can be used to determine which noun a r e l a t i v e c l a u s e m o d i f i e s . Consider the noun phrase: The man with the green hat buying a newspaper Obviously the r e l a t i v e c l a u s e "buying a newspaper" m o d i f i e s "man" not "hat". The i n v e s t i g a t i o n of t h i s problem would be i n t e r e s t i n g . 2.C.7 Punctuation The grammar does not handle any punctuation. The use of punctuation such as q u e s t i o n marks and commas f o r h e l p i n g i n the disambiguation of sentences should prove v a l u a b l e . 67 Is. The Semantic and Grammatical T e s t s 3.A Sentence Network l i ^ i i The Semantic T e s t s Semantic agreement t e s t s are performed on the major components of the sentence as they are i d e n t i f i e d . I f a component i s s e m a n t i c a l l y i n c o m p a t i b l e the parse r backs up and attempts to re-parse the o f f e n d i n g component. Further checks are made when the sentence has been completely parsed to ensure t h a t a l l necessary p a r t s of the sentence have been i d e n t i f i e d . For more d e t a i l s p lease c o n s u l t the SEMANTICS r o u t i n e s i n Appendix 7. As the parse p r o g r e s s e s , i n f o r m a t i o n about the s u b j e c t , d i r e c t and i n d i r e c t o b j e c t s i s saved i n the semantic r e g i s t e r s S-SUBJ, S-DO, and S-INDO. Each time a noun phrase i s parsed the NP network LIFTRs a l i s t c o n s i s t i n g of the head noun of the phrase and i t s f e a t u r e s to the next higher l e v e l network. T h i s l i s t i s placed i n the a p p r o p r i a t e semantic r e g i s t e r to be used i n making semantic agreement t e s t s . The S-VERB r e g i s t e r c o n t a i n s the main verb and i t s f e a t u r e s . Consider the sentence: The boy kicked the dog. When t h i s sentence i s parsed the r e g i s t e r S-SUBJ c o n t a i n s the 68 s t r u c t u r e : (N BOY ( (NUMBER SG) ) ) The r e g i s t e r S-VERB c o n t a i n s : (V KICK ((TNS PAST) (PNCODE ANY))) The r e g i s t e r S-DO c o n t a i n s the l i s t : (N DOG ( (NUMBER SG) ) ) The r e g i s t e r S-INDO c o n t a i n s NIL s i n c e no i n d i r e c t o b j e c t i s present. Only the head noun i s saved i n order to a v o i d having to analyse the s t r u c t u r e returned from the noun phrase network. In some s i t u a t i o n s t h i s i s not the most reasonable s o l u t i o n . Consider the sentence: Some of the boys ran away. In the grammatical a n a l y s i s "ones" i s the dummy head noun of t h i s incomplete noun phrase. The s t r u c t u r e below i s placed i n the r e g i s t e r S-SUBJ. (DUMMY ONES NIL) From a semantic p o i n t of view a s t r u c t u r e such as: (N BOYS ((NUMBER PL))) would provide more i n f o r m a t i o n s i n c e the r e a l s u b j e c t i s an u n s p e c i f i e d subset of "the boys". More work co u l d be done i n t h i s a r e a . In the s t a t e S-V-SEMANTICS when the s u b j e c t and main verb of the sentence have been i d e n t i f i e d a semantic t e s t checks t h a t the s u b j e c t and verb are s e m a n t i c a l l y compatible. The semantic markers of the s u b j e c t head noun and those d e s c r i b i n g the s u b j e c t of the verb ( i . e . the markers found under the f l a g 69 SUBJ-TYPE on the verb) must have a no n - n u l l i n t e r s e c t i o n . I f the semantic markers on any component are missing then the component i s assumed to be compatible i n a l l s i t u a t i o n s . For example, the verbs "use", " i s " , and "have" do not have any semantic markers under the f l a g SUBJ-TYPE s i n c e these verbs may take a wide v a r i e t y of s u b j e c t types. At present only nouns, pronouns, verbs and a d j e c t i v e s have semantic markers; other c a t e g o r i e s of words are ignored i n the semantic t e s t s . A s i m i l a r semantic check occurs when the d i r e c t o b j e c t has been i d e n t i f i e d . I f the main verb may take an i n d i r e c t o b j e c t t h i s check i s delayed u n t i l e i t h e r the i n d i r e c t o b j e c t i s found or the complete sentence has been parsed. Consider the sentences: (1) The boy gave the g i r l a book. (2) The boy gave a book to the g i r l . In sentence (1) the i n d i r e c t o b j e c t occurs i n the d i r e c t o b j e c t p o s i t i o n because of the i n d i r e c t o b j e c t i n v e r s i o n t r a n s f o r m a t i o n . In sentence (2) the noun phrase o c c u r r i n g i n the same p o s i t i o n i s r e a l l y the i n d i r e c t o b j e c t . The deep s t r u c t u r e of sentence (1) i s re-arranged when the second noun phrase i s i d e n t i f i e d . Thus the d i r e c t o b j e c t semantics should not be checked i n t h i s case u n t i l the parser i s c e r t a i n t h a t the noun phrase r e a l l y i s the d i r e c t o b j e c t . In sentence (1) the grammar checks the d i r e c t and i n d i r e c t o b j e c t semantics when both have been i d e n t i f i e d and the deep s t r u c t u r e re-arranged. The p a r s e r does not know t h a t the p r e p o s i t i o n a l phrase i n 70 sentence (2) c o n t a i n s the i n d i r e c t o b j e c t so the d i r e c t o b j e c t semantics are checked when the e n t i r e sentence has been parsed. The semantic agreement between the s u b j e c t head noun and the p r e d i c a t e a d j e c t i v e i s checked before the remainder of the sentence i s parsed. although p a r t i c i p l e s may u s u a l l y a c t as a d j e c t i v e s the p r e d i c a t e a d j e c t i v e must be c l a s s i f i e d as an a d j e c t i v e (aDJ) i n the d i c t i o n a r y . I f the s u b j e c t or one of the o b j e c t noun phrases i s a compound noun phrase then a compound head noun s t r u c t u r e i s LIFTRed from the NP network. The semantic t e s t s are then performed on each head noun i n the compound noun phrase. I t should be noted that some gues t i o n and negative sentences may cause a problem under t h i s scheme. For example, the verb " t a l k " i s f l a g g e d i n the d i c t i o n a r y as having an ANIHaTE s u b j e c t . Thus the sentences below w i l l f a i l to parse s i n c e t h e i r s u b j e c t "book" i s inanimate. Does the book t a l k ? The book does not t a l k . In t h i s type of sentence a q u e s t i o n may be answered or a statement v e r i f i e d j u s t on the b a s i s of the meanings of the words. T h i s type of u t t e r a n c e does not appear to be of much value i n a guestion answering system. When the e n t i r e sentence has been parsed, a few more semantic t e s t s are made to ensure t h a t a l l the necessary components have been l o c a t e d . For example, t r a n s i t i v e verbs 71 must have a d i r e c t o b j e c t and copula verbs must have some type of p o s t - v e r b a l m o d i f i e r present. I f a L i s p p r e d i c a t e i s present on the verb under the f l a g V-SEMANTICS i t i s evaluated when the e n t i r e sentence has been parsed. T h i s p r e d i c a t e can perform complex s y n t a c t i c or semantic checks on the parsed c o n s t i t u e n t s of the sentence. At t h i s time the components of the deep s t r u c t u r e are a l l contained i n r e g i s t e r s , so these as w e l l as the semantic r e g i s t e r s (S-SDBJ, S-VERB, S-DO, and S-INDO) are a v a i l a b l e f o r the use of t h i s p r e d i c a t e . T h i s a r b i t r a r y t e s t a llows the verb "put", f o r example, to i n s i s t t h a t a l o c a t i o n a l p r e p o s i t i o n phrase or adverb be found before the parse i s completed. Examples: (1) *He put the b l o c k . (2) He put the block on the s t a c k . (3) He put the block there. As w e l l as e l i m i n a t i n g i n c o r r e c t sentences l i k e sentence (1) t h i s t e s t ensures that the p r e p o s i t i o n a l phrase "on the s t a c k " i n sentence (2) i s not parsed as a post-nominal m o d i f i e r of the noun " b l o c k " . T h i s p r e d i c a t e can a l s o c o n s u l t the " r e a l world" to determine whether the parsed s t r u c t u r e makes sense i n the s i t u a t i o n under c o n s i d e r a t i o n . In sentence (2) above, i t might be d e s i r a b l e to check t h a t b l o c k s can be put on s t a c k s . One might choose to r e j e c t the sentence: Put the block i n t o the cube. 72 i f cubes i n t h i s s i t u a t i o n are known to be s o l i d . Care must be taken i n making t h i s type of d e c i s i o n s i n c e a sentence l i k e : You cannot put the block i n t o the cube, has the same s o r t of s t r u c t u r e but i s s e m a n t i c a l l y g u i t e r e asonable. T h i s type of " r e a l world" t e s t i s not used i n the grammar s i n c e no s p e c i f i c s i t u a t i o n was c o n s i d e r e d . 3 2 Subject-Verb Number Agreement The grammatical s u b j e c t must agree i n person and number with the tensed verb i n the sentence. The s u b j e c t , i f i t i s a pronoun, must be i n the nominative case ( i . e . be f l a g g e d SDBJ i n the d i c t i o n a r y ) . I f the s u b j e c t i s a compound noun phrase, c u r r e n t l y i t i s c l a s s i f i e d as e i t h e r s i n g u l a r or p l u r a l (SG-PL). U s u a l l y the noun phrase i s p l u r a l although i t may be s i n g u l a r i f the c o n j u n c t i o n i n v o l v e d i s " o r " . Examples: He or she i s t a l k i n g . He and she are t a l k i n g . He or she or they are t a l k i n g . 73 3.B Noun Phrase Network l i l ^ l Semantic T e s t s Semantic agreement t e s t s are performed on the a d j e c t i v e s and head noun of the phrase before the noun phrase s t r u c t u r e i s r e t u r n e d . The r e g i s t e r SEM-ADJS c o n t a i n s a l i s t of a l l the a d j e c t i v e s and r e g i s t e r SEM-NOU>M the head noun of the phrase. I f the a d j e c t i v e s and noun are inc o m p a t i b l e the pars e r backs up and attempts to re - p a r s e the phrase. Determiners, o r d i n a l s , and q u a n t i f i e r s seem to agree with a l l types of nouns so they are excluded from the t e s t s . Nouns which modify other nouns are excluded s i n c e t h e i r r e l a t i o n s h i p with the head noun i s very complex. T h i s r e l a t i o n s h i p appears to depend cn much more s u b t l e p r o p e r t i e s of the words i n v o l v e d than j u s t the broad g e n e r a l c l a s s i f i c a t i o n s of ANIMATE, PHYSOBJ, e t c . Examples: Bakery man Post man • Man bakery Man servant Man hole •Hole man noun with I f the present p a r t i c i p l e of a verb i s used to modify the then the SUBJ-TYPE of that verb must agree s e m a n t i c a l l y the noun. 74 Examples: The running boy •The running t a b l e When the noun i s modified by the past p a r t i c i p l e of a verb the DO-TYPE of the verb must agree s e m a n t i c a l l y with the noun. Examples: The painted t a b l e •The painted p a r t y At present the p a r s e r only checks the semantic agreement between the head noun and the a d j e c t i v e s modifying i t . The semantic agreement of p o s s e s s i v e noun phrases which may a c t as a s o r t of determiner s t r u c t u r e f o r the main noun i s not checked. Consider the phrase: The old man's new c a r The p a r s e r checks t h a t "new" and " c a r " are compatible, but the components of the phrase "the o l d man's" are not checked f o r semantic c o m p a t i b i l i t y . T h i s check ought to be added to the grammar. I f a L i s p p r e d i c a t e i s present on the head noun under the f l a g N-SEHANTICS, i t i s evaluated a f t e r the other semantic t e s t s are performed but before the noun phrase s t r u c t u r e i s r e t u r n e d . T h i s p r e d i c a t e may perform s y n t a c t i c or semantic checks on the parsed c o n s t i t u e n t s of the noun phrase which are contained i n the r e g i s t e r s . T h i s t e s t c o u l d , f o r example, prevent c e r t a i n a d j e c t i v e s from modifying the head noun or check that nouns modifying the head noun were a p p r o p r i a t e . The p r e d i c a t e can 75 a l s o look at the " r e a l world" t o determine, f o r example, whether a p r e p o s i t i o n phrase o c c u r r i n g a f t e r the head noun mo d i f i e s the noun or has some other f u n c t i o n i n the sentence. 3.B.2 Determiner-Woun Number Agreement The number agreement of the determiner and noun i s checked before the noun phrase s t r u c t u r e i s r e t u r n e d . A l i s t c o n s i s t i n g of the determiner and i t s f e a t u r e l i s t i s p l a c e d i n r e g i s t e r SEM-DET when the determiner i s i d e n t i f i e d . At present the number agreement only c o n s i d e r s determiners c l a s s i f i e d as DET i n the d i c t i o n a r y and nouns c l a s s i f i e d as N. Thus proper nouns (HPS), p o s s e s s i v e pronouns (POSSPBO), e t c . are not checked. A s i n g u l a r noun u n l e s s i t occurs a f t e r a c o n j u n c t i o n must be accompanied by a determiner. Mass and p l u r a l nouns may omit the determiner. Examples: A g i r l • G i r l The g i r l and boy Hater Boys I f a g u a n t i f i e r has been found then the determiner sometimes w i l l not agree with the head noun. Example: A few books 76 H i COMMENTS l i M^e of ATN Grammars The ATN model of grammar i s g e n e r a l l y speaking g u i t e an a t t r a c t i v e and u s e f u l model f o r n a t u r a l language. T h i s s e c t i o n summarizes the advantages and drawbacks to t h i s type of approach. I i ! A^ y,§siiags l i A . i l Ease of W r i t i n g The language i n which the grammar i s s p e c i f i e d i s designed to be convenient and n a t u r a l f o r the grammar w r i t e r , r a t h e r than the computer. The grammar i s completely separate from the parser so the grammar w r i t e r does not need to be aware of e x a c t l y how the parser works p r o v i d i n g she understands the order i n which the network i s searched. The parser p r o v i d e s a b a s i c s e l e c t i o n of a c t i o n s and c o n d i t i o n s which are s u i t e d to the a n a l y s i s of n a t u r a l language. 77 J^jU2 F l e x i b i l i t y The deep s t r u c t u r e of the sentence i s b u i l t i n a very f l e x i b l e manner. While the sentence i s being analysed the p i e c e s of the parse are s t o r e d i n r e g i s t e r s u n t i l the f i n a l s t a t e i s reached. T h i s enables a t e n t a t i v e d e c i s i o n to be made about the f u n c t i o n of a c o n s t i t u e n t . L a t e r i f a subsequent in p u t i n d i c a t e s that the d e c i s i o n i s i n c o r r e c t the r e g i s t e r s may be re-arranged without backing up. The deep s t r u c t u r e s produced by the grammar may be e a s i l y a l t e r e d . The POP a r c on the f i n a l s t a t e of the grammar s p e c i f i e s the deep s t r u c t u r e t h a t i s assigned to the phrase recog n i z e d i n the network. Th e r e f o r e the deep s t r u c t u r e can be a l t e r e d j u s t by changing the form s p e c i f i e d on the POP a r c . I t i s u s u a l l y f a i r l y s t r a i g h t forward to add more c o n d i t i o n s to the grammar to improve the q u a l i t y of the parses produced. I f the grammar w r i t e r i s c a r e f u l the a r c s and s t a t e s necessary to re c o g n i z e new c o n s t r u c t i o n s can be added with a minimum of d i f f i c u l t y once the main framework i s present. 78 l i i i l C apturing R e g u l a r i t i e s The phrase " c a p t u r i n g the r e g u l a r i t i e s of n a t u r a l language" i s e x p l a i n e d by Woods i n the f o l l o w i n g manner: "One of the l i n g u i s t i c g o als of a grammar f o r a n a t u r a l language i s that the grammar capture the r e g u l a r i t i e s of the language. That i s , i f there i s a process that operates i n a number of environments, the grammar should embody th a t process i n a s i n g l e mechanism or r u l e and not i n a number of independent c o p i e s of the same process f o r each of the d i f f e r e n t c o n t e x t s i n which i t o c c u r s . . . . n l An example of t h i s p r i n c i p l e i s the r e p r e s e n t a t i o n of a p r e p o s i t i o n phrase as a sentence c o n s t i t u e n t . A noun phrase o f t e n f o l l o w s a p r e p o s i t i o n i n E n g l i s h sentences and the two form a s o r t of s t r u c t u r a l u n i t . I f the grammar did not t r e a t p r e p o s i t i o n phrases as sentence c o n s t i t u e n t s i t would be missing a r e g u l a r i t y of the language. The ATN grammar appears to be s u c c e s s f u l i n c a p t u r i n g these r e g u l a r i t i e s . F i r s t l y the use of r e g i s t e r s to c o n t a i n f l a g s a l l o w s two or more almost i d e n t i c a l sub-networks to be merged i n t o a s i n g l e one, s e t t i n g f l a g s t o d i r e c t the p a r s e r i n p l a c e s where the o r i g i n a l networks d i f f e r e d . These f l a g s may then be t e s t e d by the c o n d i t i o n s and a c t i o n s on the a r c s of the sub-network to guide the parser through the proper path. * W. a. Woods. " T r a n s i t i o n Network Grammars f o r N a t u r a l Language a n a l y s i s . " Communications of the ACM J0JJ970^ p. 601. 79 Secondly the r e g i s t e r s t r u c t u r e and the use of the HOLD a c t i o n and VIR a r c make the p r o c e s s i n g of t r a n s f o r m a t i o n s n a t u r a l i n the grammar. The theory of t r a n s f o r m a t i o n a l grammar i s again an attempt to capture the r e g u l a r i t i e s of n a t u r a l language. T r a n s f o r m a t i o n a l grammar t r i e s to e x p l a i n the connect i o n between pas s i v e sentences and t h e i r a c t i v e c o u n t e r p a r t s , i n t e r r r o g a t i v e sentences and t h e i r d e c l a r a t i v e c o u n t e r p a r t s , n e g a t i v e sentences and t h e i r a f f i r m a t i v e forms, e t c . Without the power of a t r a n s f o r m a t i o n a l grammar many more s t a t e s would be necessary to i d e n t i f y these forms. A context f r e e grammar, f o r example, cannot r e c o g n i z e these s i m i l a r i t i e s . Because ATN grammars capture the r e g u l a r i t i e s of n a t u r a l language they maintain a degree of what Woods£11 ] c a l l s " p e r s p i c u i t y " . That i s , by l o o k i n g a t the ATN diagram i t i s reasonably c l e a r what types of c o n s t r u c t i o n s are recognized by the grammar. T h i s i s l a r g e l y due to the f a c t t h a t the ATN grammars capture the r e g u l a r i t i e s of n a t u r a l language and thus are reasonably compact i n r e p r e s e n t a t i o n . 1_._.E C r i t i c i s m s T h i s s e c t i o n d i s c u s s e s some of the problems i n v o l v e d with the use of an ATN grammar f o r the a n a l y s i s of n a t u r a l language. I t s hould be noted that many of the c r i t i c i s m s of the p a r s i n g system r e f e r s p e c i f i c a l l y to the simple v e r s i o n of the ATN 80 p a r s e r which was implemented at the U n i v e r s i t y of B r i t i s h Columbia. Woods' p a r s e r [ 1 3 ] i s much more s o p h i s t i c a t e d and takes i n t o account some of these o b j e c t i o n s . l i S i l Ordered Backup Perhaps the g r e a t e s t problem with the ATN p a r s i n g system i s t h a t search through the network i s conducted i n a s t r i c t l y depth f i r s t manner. The p a r s e r c o n s i d e r s the a r c s l e a v i n g a s t a t e i n the order i n which they occur. The f i r s t p o s s i b l e a r c i s f o l l o w e d . I f t h i s c h o i c e t u r n s out to be u n s u c c e s s f u l ( i . e . the path becomes blocked i n the d e s t i n a t i o n s t a t e ) a l l the other a r c s a t t h i s s t a t e are t r i e d u n t i l e i t h e r a path i s found or a l l a r c s are r e j e c t e d , causing the p a r s e r to back up to the p r e v i o u s s t a t e . T h i s process c o n t i n u e s u n t i l a path i s found through the network or i t i s determined t h a t no path e x i s t s . In some circumstances i t would be convenient to have a more d i r e c t e d search through the network. Consider a s i t u a t i o n where a c r i t i c a l c h o i c e must be made at s t a t e A. At s t a t e B i t i s d i s c o v e r e d that the wrong c h o i c e was made at A. A l l the a l t e r n a t i v e paths between s t a t e s A and B are searched before the other choice at A i s c o n s i d e r e d . T h i s s i t u a t i o n i s i n c o n v e n i e n t because f i r s t of a l l much time may be wasted c o n s i d e r i n g u n l i k e l y paths. Secondly unless a great d e a l of thought has been given to the o r d e r i n g of the a r c s and the c o n d i t i o n s on 81 them i t i s probable t h a t an " u n l i k e l y " parse w i l l be generated. The ATN grammar d e s c r i b e d i n Chapter I I I has s e v e r a l s i t u a t i o n s where ordered backup would be d e s i r a b l e . One such s i t u a t i o n i n v o l v e s the p r o c e s s i n g of questions beginning with a q u e s t i o n determiner. The noun phrase c o n t a i n i n g the q u e s t i o n determiner may be e i t h e r the s u b j e c t or o b j e c t of the sentence. At s t a t e S-WH-NP the ques t i o n determiner phrase has been i d e n t i f i e d and a d e c i s i o n must be made as to the f u n c t i o n of the phrase i n the sentence. I f the phrase i s the o b j e c t then s u b j e c t - v e r b i n v e r s i o n occurs and the next word must be an a u x i l i a r y verb. The parser goes to s t a t e S-YESNO to d e a l with the i n v e r s i o n . Otherwise the phrase i s the s u b j e c t and the next word must be a verb. P a r s i n g c o n t i n u e s at s t a t e S-NP to l o c a t e the verb. Since a u x i l i a r y verbs may be used as the main verb or as p a r t of a more complex verb c o n s t r u c t i o n i t i s i m p o s s i b l e to ensure t h a t the c o r r e c t a r c i s f o l l o w e d . Consider the f o l l o w i n g q u e s t i o n s : (1) Which man has he seen? (2) Which man comes? (3) Which man has come? (4) Which man has the book? In sentence (1) s u b j e c t - v e r b i n v e r s i o n does occur and the a u x i l i a r y verb c o n d i t i o n ensures that the a p p r o p r i a t e arc i s taken. In sentences (2), (3), and (4) the q u e s t i o n determiner phrase i s the s u b j e c t . The c o r r e c t a r c i s f o l l o w e d f o r sentence (2) s i n c e "comes" i s not an a u x i l i a r y verb. However the wrong a r c i s taken i n both sentences (3) and (4) s i n c e "has" i s an 82 a u x i l i a r y . In the above s i t u a t i o n the wrong a r c w i l l be f o l l o w e d f o r some gu e s t i o n s r e g a r d l e s s of how the a r c s are ordered. I f the chosen a r c t u r n s out to be u n s u c c e s s f u l i t would seem reasonable to f a i l d i r e c t l y back to the p o i n t where i t i s known t h a t a wrong d e c i s i o n c o u l d e a s i l y have been made. The other arc should then be f o l l o w e d and o n l y i f t h i s path too i s blocked, should the other a l t e r n a t i v e s be considered. I t would be d e s i r a b l e , f o r i n s t a n c e , t o a s s i g n a very low p r i o r i t y to search through the reduced r e l a t i v e c l a u s e network. T h i s network i s o f t e n r e s p o n s i b l e f o r the c o n s t r u c t i o n of strange parses i n a desperate attempt to e x p l a i n the presence of " e x t r a " verbs. Without ordered backup, complicated c o n d i t i o n s must be added to the grammar i n an attempt to prevent sentences which have made an i n c o r r e c t c h o i c e from being parsed i n t o an obscure c o n s t r u c t i o n on backup. l i i i i ? Parsed C o n s t i t u e n t s I t seems somewhat i n e f f i c i e n t t h a t there i s no mechanism f o r s e t t i n g a s i d e parsed c o n s t i t u e n t s (e.g. noun and p r e p o s i t i o n phrases) which may be analysed many times i n the process of f i n d i n g a path through the network. Whereas the r e l a t i o n s h i p among the v a r i o u s c o n s t i t u e n t s i n the sentence may vary as d i f f e r e n t paths through the network are searched, the 83 c o n s t i t u e n t s themselves tend to remain as f a i r l y s t a b l e u n i t s i n the sentence. A more e f f i c i e n t approach to the problem might be to have a f i r s t pass which would i d e n t i f y the major c o n s t i t u e n t s of the sentence which are u s u a l l y i d e n t i f i e d by lower l e v e l networks. A second pass corresponding to the top (or S) l e v e l network c o u l d attempt t o arrange these c o n s t i t u e n t s i n t o a reasonable s t r u c t u r e . I f t h i s was u n s u c c e s s f u l , a l t e r n a t i v e p a r s i n g s would be t r i e d f o r the major c o n s t i t u e n t s . Woods has experimented with saving these c o n s t i t u e n t s , but he f e e l s t h a t : "... the savings i n parse time f o r such an approach does not always j u s t i f y the storage r e q u i r e d to s t o r e a l l of the p a r t i a l s u b s t r i n g a n a l y s e s . . . . " * 1. B..3 Recursion The r e c u r s i v e nature of the ATN grammar i s very u s e f u l f o r e l i m i n a t i n g d u p l i c a t i o n of s t a t e s by t a k i n g advantage of the r e g u l a r i t i e s of n a t u r a l language. However r e c u r s i o n does l e a d to problems when, f o r example, c o o r d i n a t e c l a u s e s are being parsed. Consider the sentence: He sang and he danced and he drank. The parse s t r u c t u r e r e t u r n e d by the grammar f o r t h i s sentence i s 1 W. A. Woods. " T r a n s i t i o n Network Grammars f o r N a t u r a l Language A n a l y s i s . " Communications of the ACM 10J1970} p. 605. 84 of the form: (S (AND (S ......) (S (AND (S ) (S . . . . . . ) ) ) ) ) There i s no semantic or s y n t a c t i c reason f o r the n e s t i n g of the s t r u c t u r e but t h i s i s the type of parse that i s n a t u r a l l y r e t u r n e d by a r e c u r s i v e grammar where each sentence checks f o r another c o n j o i n e d sentence. The s t r u c t u r e below would seem more reasonable s i n c e a l l the sentences are now at the same l e v e l : (S (AND (S ......) (S .) (S . . . . . . ) ) ) T h i s type of s t r u c t u r e c o u l d , of c o u r s e , be c o n s t r u c t e d but i t i s not n a t u r a l to the system. The other problem encountered with the r e c u r s i v e nature of the grammar i s that p r e p o s i t i o n phrases tend to become nested i n s i d e other noun or p r e p o s i t i o n phrases. I t i s d e f i n i t e l y convenient to c o n s i d e r t h a t a noun phrase may be f o l l o w e d by a p r e p o s i t i o n phrase. T h i s i s not always the best assumption s i n c e p r e p o s i t i o n phrases o f t e n end up nested i n s i d e noun phrases and must depend on s p e c i f i c semantic t e s t s to d i s l o d g e them. Examples: (1) Put the block on the t a b l e . (2) Is the book i n the room? (3) The block on the t a b l e i s r e d . For example, t e s t s i n s i s t i n g t h a t "put" have a l o c a t i o n a l d e s c r i p t o r and t h a t copula verbs must have a p o s t - v e r b a l m o d i f i e r are necessary to produce the c o r r e c t parse f o r 85 sentences (1) and (2). Sentence (3) i s c o r r e c t l y parsed with the p r e p o s i t i o n phrase modifying the noun phrase. A more s a t i s f a c t o r y s o l u t i o n might be not to allow a p r e p o s i t i o n phrase to f o l l o w a noun. A f t e r each noun i s i d e n t i f i e d the grammar would have to look f o r one or more p r e p o s i t i o n a l phrases. Semantic t e s t s c o u l d then be performed to determine what m o d i f i e s what and the a p p r o p r i a t e s t r u c t u r e s b u i l t . T h i s s o l u t i o n however f a i l s to a p p r e c i a t e one of the r e g u l a r i t i e s of n a t u r a l language; t h a t i s , a noun i s o f t e n m o dified by a p r e p o s i t i o n phrase and the two form a s t r u c t u r a l u n i t . KB.4. Sentences Which F a i l to Parse Sentences may f a i l to parse f o r s e v e r a l reasons. The sentence may be ungrammatical or i t may c o n t a i n a word unknown to the system or used i n an u n f a m i l i a r manner. I f a word i s unknown the system n o t i f i e s the user and she i s given an o p p o r t u n i t y to stop or enter a synonym or d i c t i o n a r y e n t r y . I f the sentence f a i l s to parse ( i . e . a path through the network cannot be found) when a l l the words are known, the system has no way of knowing which path was c l o s e s t to being c o r r e c t . T h i s seems e s p e c i a l l y unreasonable when one c o n s i d e r s t h a t the average person understands ungrammatical and other s t r a n g e l y c o n s t r u c t e d sentences q u i t e w e l l . A p o s s i b l e s o l u t i o n i s to r e -86 parse the o f f e n d i n g sentence r e l a x i n g the grammatical and semantic c o n s t r a i n t s . I t i s l i k e l y then that the sentence w i l l have s e v e r a l p o s s i b l e parse s t r u c t u r e s and t h a t the wrong one w i l l be chosen s i n c e a l l the c o n s t r a i n t s t h a t normally help determine a l i k e l y parse s t r u c t u r e have been r e l a x e d . ATN grammars are not r e a l l y s u i t a b l e f o r d e a l i n g with ungrammatical or s e m a n t i c a l l y " s t r a n g e " c o n s t r u c t i o n s . H i l k s [ 9 ] d i s c u s s e s a system of " p r e f e r e n c e semantics" where words have p r e f e r r e d c o n t e x t s . I f the p r e f e r e n c e cannot be s a t i s f i e d the word w i l l be placed i n a l e s s l i k e l y c o ntext. Wilks* system seems much more p r a c t i c a l f o r d e a l i n g with t h i s problem. Operation of the Parser The f o l l o w i n g comments r e f e r s p e c i f i c a l l y to the simple v e r s i o n of the ATN p a r s e r implemented a t the U n i v e r s i t y of B r i t i s h Columbia. A l i s t i n g of t h i s parser i s i n Appendix 9. There are s e v e r a l f e a t u r e s of the parser which are annoying but are not s e r i o u s shortcomings. F i r s t of a l l , the FEATURES l i s t i s only d e f i n e d on a CAT a r c . T h i s i s annoying when the p a r s e r wishes to look ahead i n the sentence checking that words have p a r t i c u l a r f e a t u r e s . For example, i t i s o f t e n necessary to know whether the next word i s a tensed verb. At present the problem i s solved by s e t t i n g the necessary l o c a l v a r i a b l e s and c a l l i n g the i n t e r n a l parser r o u t i n e s d i r e c t l y . T h i s i s not 87 s a t i s f a c t o r y s i n c e the grammar i s now dependent on the i n t e r n a l mechanism of the parser. Secondly, the LIFTS a c t i o n can be r a t h e r awkward to use i f the grammar knows n e i t h e r the s t a t e nor l e v e l from which i t POSHed to the c u r r e n t network. For i n s t a n c e , i f the grammar wishes to s e t a r e g i s t e r at the most recent S - l e v e l network when a question determiner i s encountered i n a noun phrase, the l e v e l of the most r e c e n t S network i s unknown (both the sentence and the noun phrase network are r e c u r s i v e ) and furthermore the s t a t e from which i t PUSHed i s unknown. The grammar must LIFTR the r e g i s t e r to a l l p o s s i b l e s t a t e s from which i t co u l d have POSHed. A more reasonable s o l u t i o n would be to allow r e g i s t e r s to be g l o b a l to a c e r t a i n l e v e l i n the network. Then a LIFTE a c t i o n c o u l d s e t a r e g i s t e r at the S - l e v e l without having to know the a p p l i c a b l e s t a t e . F i n a l l y i n some s i t u a t i o n s i t would be convenient to f a i l a parse completely. I f an imp o s s i b l e arrangement of words i s encountered the p a r s e r , at present, can only block the path at t h a t p o i n t . Much time i s then wasted i n f u r t h e r s e a r c h i n g b e f o r e the search i s abandoned. 88 2_» Suggestions f o r P r o s p e c t i v e Grammar W r i t e r s ATN grammars make i t f a i r l y simple to write moderately complex grammars. Debugging the grammars may be somewhat more d i f f i c u l t u n l e s s care i s taken i n w r i t i n g them. 2_. A Common Problems When new c o n s t r u c t i o n s are added to the grammar they u s u a l l y parse c o r r e c t l y . However there i s a tendency f o r some of the other c o n s t r u c t i o n s , which resemble the new ones i n perhaps very s u b t l e ways, to parse i n c o r r e c t l y . C o n s i d e r , f o r example, the grammar d e s c r i b e d i n Chapter I I I . When yes-no g u e s t i o n s were added t o the grammar they worked c o r r e c t l y . The grammar however began to mistake some imp e r a t i v e sentences f o r q u e s t i o n s . The imp e r a t i v e sentence: Do the work q u i c k l y , was parsed as the yes-no ques t i o n whose d e c l a r a t i v e form i s : The work do q u i c k l y . T h i s l e d to m o d i f i c a t i o n s r e q u i r i n g t h at t r a n s i t i v e verbs have o b j e c t s and t h a t yes-no guestions have main verbs other than "do" u n l e s s an a u x i l i a r y i s present. T h i s type of problem i s very common so i t i s important to check that o l d c o n s t r u c t i o n s s t i l l work a f t e r new ones are added. 89 2-s.i O r d e r i n g the Arcs The o r d e r i n g of the a r c s i n each s t a t e i s very important. The f i r s t a r c s should look f o r the most e a s i l y i d e n t i f i a b l e c o n s t r u c t i o n s , l e a v i n g the more complex and l e s s i d e n t i f i a b l e c o n s t r u c t i o n s u n t i l l a s t . T h i s way the simple a r c s such as WRD a r c s are t r i e d f i r s t . Less time i s wasted s i n c e no complicated networks are searched unless there i s good reason to b e l i e v e they are a p p l i c a b l e . That i s , e i t h e r a l l simpler c o n s t r u c t i o n s have f a i l e d or the i n t r o d u c t o r y word (s) or preceding word (s) i n d i c a t e t h i s i s a l i k e l y path. In the grammar d e s c r i b e d i n Chapter I I I , PUSH NP arcs tend to take a long time to show t h a t no noun phrase i s present s i n c e they may c o n t a i n a great v a r i e t y of o p t i o n a l c o n s t i t u e n t s . T h i s network a l s o f r e q u e n t l y produces i n c o r r e c t parses i f f o r c e d i n t o the reduced r e l a t i v e c l a u s e network. Thus the search of t h i s type o f network should be delayed u n t i l the simple a r c s t h a t can be accepted or r e j e c t e d on a s i n g l e t e s t have been t r i e d . The a r c s i n the noun phrase network i n the grammar were r e -ordered so that the reduced r e l a t i v e c l a u s e network i s searched only as a l a s t r e s o r t . Before t h i s was done the q u e s t i o n : Is the man t a l k i n g f a s t ? was parsed as though i t s d e c l a r a t i v e form were: The man, who t a l k s f a s t , i s . i n s t e a d o f : The man i s t a l k i n g f a s t . 90 The problem occurred because p a r t i c i p l e s (and past tenses with p a r t i c i p l e forms) which do not occur next to t h e i r a u x i l i a r i e s f o r one reason or another may be mistaken f o r p a r t i c i p l e s i n t r o d u c i n g reduced r e l a t i v e c l a u s e s . The a u x i l i a r y verb i s then parsed as a main verb. I t i s d i f f i c u l t to devise a t e s t which w i l l r e c o g n i z e t h i s mistake afterwards so i t i s b e t t e r to prevent t h i s mistake from o c c u r r i n g . For t h i s reason the a r c s i n the noun phrase network were r e - o r d e r e d so t h a t the reduced r e l a t i v e c l a u s e network i s searched a f t e r a l l e l s e i n the network has f a i l e d . 2^C C o n d i t i o n s on the fires I t appears to be worthwhile p u t t i n g very comprehensive c o n d i t i o n s on the a r c s of the grammar. The model works best i f the r i g h t d e c i s i o n i s made the f i r s t time. The grammar w r i t e r s hould attempt to e l i m i n a t e backup i f p o s s i b l e s i n c e i t cannot be ordered. I t i s wise not to r e l y on the backup because p r e d i c t i n g the r e s u l t of backing through a complex network i s very d i f f i c u l t . I f changes are l a t e r made i n the grammar the w r i t e r may not even remember t h a t the a r c s were ordered i n a c e r t a i n way f o r a s p e c i a l reason. Any i n f o r m a t i o n which i s known about the form of the next word or words i n the c o n s t r u c t i o n should be i n c o r p o r a t e d i n t o the t e s t s on the a r c s . For example, before a PUSH PP arc i s 91 f o l l o w e d to attempt to i d e n t i f y a p r e p o s i t i o n phrase, the next word should be t e s t e d t o see i f i t i s a p r e p o s i t i o n . I f i t i s not, the time i n v o l v e d i n pushing to a lower l e v e l network i s saved. The t e s t s are more important when a path cannot be immediately r e j e c t e d or accepted but must be searched f u r t h e r . The c o n d i t i o n s on the a r c s can immediately e l i m i n a t e ungrammatical and n o n s e n s i c a l c o n s t r u c t i o n s and may help prevent other t o t a l l y d i f f e r e n t c o n s t r u c t i o n s from j u s t happening to f i t i n t o the p a t t e r n on backup and producing nonsense. 92 BIBLIOGRAPHY 1. Chomsky, Noam. "A T r a n s f o r m a t i o n a l Approach to Syntax." The §igug^S£§„,2£ liaSgH§gg: Readings i n the Philosophy of Language.. Ed. J . A. Fodor and J . J . Katz. P r e n t i c e - H a l l , "?96U,"pp. 211-245. 2. H a l l , Wa yne. A_I-is£_Inter a c t i ve_Projgr am min3_E n v i r onme n t ^ Master's T h e s i s . Department of Computer S c i e n c e , U n i v e r s i t y of B r i t i s h Columbia, 1974. 3. H a l l , W., B. J e r v i s and J . J e r v i s . W ALT t Department of Computer S c i e n c e , U n i v e r s i t y of B r i t i s h Columbia, 1973. 4. Jacobs, R. A. and P. S. Rosenbaum. E n g l i s h T r a n s f o r m a t i o n a l Grammar^ B l a i s d e l l P u b l i s h i n g Co., 1968. 5. Katz, J . J . and J . A. Fodor. "The S t r u c t u r e of a Semantic Theory." The S t r u c t u r e of Language:.Readings .in the Phil2SO£hj_of_Languaae t Ed. J . A. Fodor and J . J . Katz. P r e n t i c e - H a l l 7 1964, pp. 279-518. 6. Klima, E. S. "Negation i n E n g l i s h . " T h e _ S t r u c t u r e _ o f Language2_Readings_in_th Ed. J . A. Fodor and J . J . Katz. P r e n t i c e - H a l l , ^964, pp. 246-323. 7. Simmons, R. F. " N a t u r a l Language Question-Answering SYstems: 1969." Communications_of_th^ pp. 15-30. 8. S t o c k w e l l e t a l . The M a j o r _ S y n t a c t i c ^ S t r u c t u r e s of E n g l i s h . H o l t , Rinehart and Winston, 1973. 9. Wilks, Y. "Understanding without P r o o f s . " P£oceedings_of l£telligence x S t a n f o r d U n i v e r s i t y , 1973. 93 10. Winograd, T e r r y . Procedures^as..a_aepres §_Coi£uter_Program^ Massachusetts I n s t i t u t e of Technology, Bevised PhD D i s s e r t a t i o n , MAC TR-84 ( T h e s i s ) , 1971. 11. Woods, W. A. " T r a n s i t i o n Network Grammars f o r N a t u r a l Language A n a l y s i s . " Communications^of the ,ACM_10J1970 pp. 591-606. 12. Woods, W. A, "An Experimental P a r s i n g System f o r T r a n s i t i o n Network Grammars." Natural_Language_Processing. Ed. B. B u s t i n . P r e n t i c e - H a l I 7 ~ 9 7 2 . ~ ~ 13. Woods, W. A. et a l . IJj§11Ii2BliE-SgigSSg§J2^B£§Lli2J!2Sggg l£l?2rmatjion_System: Einal, Report. Bolt, Beranek and Newman IncTT 19727 BBN~Report No. 2378. 94 APPENDIX I - HOW TO BUN Under the MTS o p e r a t i n g system at the U n i v e r s i t y of B r i t i s h Columbia the p a r s i n g system may be run by i s s u i n g the f o l l o w i n g command: $SOUBCE JEJ.PABSER The f i l e JEJ:PARSER c o n t a i n s the f o l l o w i n g i n s t r u c t i o n s : $B CS:LISP PAR=PDS=10,HAX=55 JCONTINUE WITH JEJ:PREPASS RETURN SCONTINUE WITH CS:PAHSE RETURN ($$PRINT$$) (INIT) $CONTINUE WITH *MSOURCE* These commands load the L i s p i n t e r p r e t e r , the parser and a l l the other L i s p r o u t i n e s neccesary. The f u n c t i o n c a l l , (INIT), i n i t i a l l i z e s the p a r s i n g system by readi n g i n the d i c t i o n a r y , grammar and morphemic a n a l y s i s t a b l e s . A sentence may be parsed by c a l l i n g the f u n c t i o n PARSER with the sentence as an argument. For example, to parse the sentence: He runs f a s t , the f o l l o w i n g f u n c t i o n c a l l i s i s s u e d : (PARSER (HE RUNS FAST)) Pun c t u a t i o n should not be entered with the sentence. The f u n c t i o n PARSER assumes t h a t p a r s i n g s t a r t s i n s t a t e S of the grammar. The user may s p e c i f y the s t a t e i n which the parse i s to s t a r t by u s i n g the f u n c t i o n P i n s t e a d . For example, to parse the noun phrase: 95 The b i g man s t a r t i n g i n . s t a t e NP which i s the s t a r t of the noun phrase network c a l l : (P (THE BIG HAN) NP) APPENDIX 2 - SJ_MPLE_PJ.RSES SENTENCE: JOHN BAN FAST PBEPASS TIME = 5 MS (JOHN BAN FAST) PARSE: S MOOD DCL VOICE ACTIVE NP DET NIL NPR JOHN ND SG AUX TNS PAST VP V RUN ADV FAST PARSE TIME = 116 MS 97 SENTENCE: IS HE A YOUNG BOY PREPASS TIME = U MS (IS HE A YOUNG BOY) PARSE: S MOOD YESNO VOICE ACTIVE NP DET NIL PRO HE NUMBEB SG SUBJ PNCODE 3SG NU SG AUX TNS PRESENT VP V BE NP DET A ADJ YOUNG N BOY NUMBER SG NU SG PARSE TIME = 186 MS 98 SENTENCE: WHO TOOK THE BALI WHICH WAS IN THE WATER PREPASS TIME = 8 MS (WHO TOOK THE BALL WHICH WAS IN THE WATER) PARSE: S MOOD QPRO VOICE ACTIVE NP DET NIL QPRO WHO NU SG-PL AUX TNS PAST VP V TAKE NP DET THE N BALL NUMBER SG NU SG S MOOD REL VOICE ACTIVE NP DET WH N BALL NU SG AUX TNS PAST VP V BE PP PREP IN NP DET THE N WATER NUMBER MASS NU MASS PABSE TIME = 350 MS 99 SENTENCE: THE BOY IN THE PARK HAS THE BALL PBEPASS TIME = 6 MS (THE BOY IN THE PABK HAS THE BALL) PARSE: S MOOD DCL VOICE ACTIVE NP DET THE N BOY NUMBER SG NU SG PP PREP IN NP DET THE N PARK NUMBER SG NU SG AUX TNS PRESENT VP V HAVE NP DET THE N BALL NUMBER SG NU SG PARSE TIME = 241 MS SENTENCE: BY WHOM WEBE THE BOOKS GIVEN TO JOHN AND HIS BROTHER PREPASS TIME = 12 MS (BY WHOM WERE THE BOOKS GIVEN TO JOHN AND HIS BBOTHER) PARSE: S MOOD QPRO VOICE PASSIVE NP DET NIL QPRO WHO NU SG-PL AUX TNS PAST VP V GIVE NP DET THE N BOOK NUMBER PL NU PL PP PREP TO NP AND NP DET NIL NPR JOHN NU SG NP DET POSS PRO HE POSSPRO N BBOTHEB NUMBEB SG NU SG PARSE TIME = 3HH MS 101 SENTENCE: WHICH OF THE MEN SAW MORE THAN TWO DOGS PREPASS TIME = 10 MS (WHICH OF THE MEN SAW MORE THAN TWO DOGS) PARSE: S MOOD QPRO VOICE ACTIVE NP DET NIL QPRO WHICH NU SG-PL PP PREP OF NP DET THE N MAN NUMBER PL NU PL AUX TNS PAST VP V SEE NP DET NIL QDANTP COHP ADV MORE QUANT INTEGER TWO N DOG NUMBER PL NU PL PARSE TIME = 480 MS 102 SENTENCE: PLEASE PUT AHAY ANYTHING BIG HHICH IS ON TOP OF THE TABLE PBEPASS TIME = 8 MS (PLEASE PUT AWAY ANYTHING BIG WHICH IS ON-TOP-OF THE TABLE) PARSE: S MOOD IMP VOICE ACTIVE NP DET NIL PRO YOU NU SG-PL AUX TNS UNTENSED VP V PUT-AWAY NP DET NIL ADJ BIG GENPRO ANYTHING NU SG S MOOD REL VOICE ACTIVE NP DET WH GENPRO ANYTHING NU SG AUX TNS PRESENT VP V BE PP PREP ON-TOP-OF NP DET THE N TABLE NUMBEB SG NU SG ADV PLEASE PARSE TIME = 566 MS 103 SENTENCE: THE SMALL GIRL WHOSE SISTER YOU SAW MAY BE YOUNGER THAN MY BROTHER PREPASS TIME = 18 MS (THE SMALL GIRL WHOSE SISTER YOU SAW MAY BE YOUNGEB THAN MY BROTHER) PARSE: S MOOD DCL VOICE ACTIVE NP DET THE ADJ SMALL N GIRL NUMBER SG NU SG S MOOD REL VOICE ACTIVE NP DET NIL PRO YOU SUBJ OBJ NUMBEB SG-PL PNCODE 2SGPL NU SG-PL TNS PAST AUX VP V SEE NP DET WH POSS N GIBL N SISTER DUMBER SG NU SG AUX TNS PRESENT MODAL MAY VP NP ADJ YOUNG COMPARATIVE DET POSS PRO I POSSPRO N BROTHER 104 NUMBER SG NU SG PARSE TIME = 581 MS SENTENCE: WHY IS JOHN HOPING THAT MARY WILL FLY TO PARIS PREPASS TIME = 13 MS (WHY IS JOHN HOPING THAT MARY WILL FLY TO PARIS) PARSE: S MOOD QADV VOICE ACTIVE NP DET NIL NPR JOHN NU SG AUX TNS PRESENT PROGRESSIVE VP V HOPE COMPL CTYPE THAT S MOOD DCL VOICE ACTIVE NP DET NIL NPB MARY NU SG AUX TNS FUTURE VP V FLY PP PREP TO NP DET NIL NPR PARIS NU SG QADV WHY PARSE TIME = 299 MS 105 SENTENCE: WHAT WAS PICKED DP BY THE MAN AND POT DOWN ON THE TABLE PBEPASS TIME = 18 MS (WHAT WAS PICKED UP BY THE MAN AND PUT DOWN ON THE TABLE) PARSE: S AND S MOOD QPRO VOICE PASSIVE NP DET THE N MAN NUMBEB SG NU SG AUX TNS PAST VP V PICK-UP NP DET NIL QPBO WHAT NU SG-PL S MOOD QPRO VOICE PASSIVE NP DET THE N MAN NUMBER SG NU SG AUX TNS PAST VP V PUT-DOWN NP DET NIL QPRO WHAT NU SG-PL PP PREP ON NP DET THE N TABLE NUMBER SG NU SG PARSE TIME = 583 MS 106 SENTENCE: HE POT THE PYRAMID ON THE TABLE INTO THE BOX PREPASS TIME = 8 MS (HE POT THE PYRAMID ON THE TABLE INTO THE BOX) PARSE: S MOOD DCL VOICE ACTIVE NP DET NIL PRO HE NUMBER SG SUBJ PNCODE 3SG NU SG AOX TNS PAST VP V PUT NP DET THE N PYRAMID NUMBER SG NU SG PP PREP OH NP DET THE N TABLE NUMBER SG NU SG PP PREP INTO NP DET THE N BOX NUMBER SG NU SG PARSE TIME = 310 MS 107 SENTENCE: SOME OF THE DOGS WERE SEEN BY THE STREAM IN THE PARK PREPASS TIME = 8 MS (SOME OF THE DOGS WERE SEEN BY THE STREAM IN THE PARK) PARSE: S MOOD DCL VOICE PASSIVE NP DET NIL PRO SOMETHING NU SG-PL AUX TNS PAST VP V SEE NP DET SOME N ONES NU SG-PL PP PREP OF NP DET THE N DOG NUMBER PL NU PL PP PREP BY NP DET THE N STREAM NUMBER SG NU SG PP PREP IN NP DET THE N PARK NUMBER SG NU SG PARSE TIME = 386 MS 108 SENTENCE: GIVE ME AT LEAST A FEW MORE THAN A DOZEN BOOKS PREPASS TIME = 8 MS (GIVE ME AT LEAST A FEW MORE THAN A DOZEN BOOKS) PARSE: S MOOD IMP VOICE ACTIVE NP DET NIL PRO YOU NU SG-PL AUX TNS UNTENSED VP V GIVE NP DET NIL QUANTP SUPER ADV LEAST DET A QUANTP QUANT FEW COMP ADV MORE DET A QUANT DOZEN N BOOK NUMBER PL NU PL PP PREP TO NP DET NIL PRO I OBJ NUMBER SG PNCODE 1SG NU SG PARSE TIME = 301 MS 109 SENTENCE: DIDN'T YOU SEE JOHN'S PREPASS TIME = 7 MS (DID NOT YOU SEE JOHN'S) PARSE: S MOOD NEGATIVE YESNO VOICE ACTIVE NP DET NIL PRO YOU SUBJ OBJ NUMBER SG-PL PNCODE 2SGPL NU SG-PL AUX TNS PAST VP V SEE NP DET NIL POSS NPR JOHN N ONES NU SG-PL PARSE TIME = 167 MS SENTENCE: ALL THOSE WOMEN COULD HAVE PICKED THE BOOKS AN PENCILS UP PREPASS TIME = 12 MS (ALL THOSE WOMEN COULD HAVE PICKED THE BOOKS AND PENCILS PARSE: S MOOD DCL VOICE ACTIVE NP DET ALL N ONES NU SG-PL PP PREP OF NP DET THAT N WOMAN NUMBER PL NU PL AUX TNS PRESENT PERFECT MODAL COULD VP V PICK-UP NP AND NP DET THE N BOOK NUMBER PL NU PL NP DET NIL N PENCIL NUMBER PL NU PL PARSE TIME = 330 MS 111 SENTENCE: LIST ALL THE FUNCTIONS THAT CALL THE FUNCTIONS THAT CALL THE FUNCTIONS THAT THIS FUNCTION CALLS PREPASS TIME = 20 MS (LIST ALL THE FUNCTIONS THAT CALL THE FUNCTIONS THAT CALL THE FUNCTIONS THAT THIS FUNCTION CALLS) PARSE: S MOOD IMP VOICE ACTIVE NP DET NIL PRO YOU NU SG-PL AUX TNS UNTENSED VP V LIST NP DET ALL N ONES NU SG-PL PP PREP OF NP DET THE N FUNCTION NUMBER PL NU PL S MOOD REL VOICE ACTIVE NP DET WH N FUNCTION NU PL AUX TNS PRESENT VP V CALL NP DET THE N FUNCTION NUMBER PL NU PL S MOOD REL VOICE ACTIVE NP DET WH N FUNCTION 112 NU PL AUX TNS PRESENT VP V CALL NP DET THE N FUNCTION NUMBER PL NU PL S MOCD REL VOICE ACTIVE NP DET THIS N FUNCTIO NUMBE NU SG AUX TNS PBESE VP V CALL NP DET W N FUN NU PL PARSE TIME = 755 MS 113 SENTENCE: THE NAME OF THE GIRL KICKING THE DOG IS MARY PREPASS TIME = 13 MS (THE NAME OF THE GIRL KICKING THE DOG IS MARY) PARSE: S MOOD DCL VOICE ACTIVE NP DET THE N NAME \ NUMBER SG NU SG PP PREP OF NP DET THE N GIRL NUMBER SG NU SG S MOOD REL VOICE ACTIVE NP DET WH N GIRL NU SG AUX TNS PRESENT PROGRESSIVE VP V KICK NP DET THE N DOG NUMBER SG NU SG AUX TNS PRESENT VP V BE NP DET NIL NPR MARY NU SG PARSE TIME = 392 MS 114 SENTENCE: THE FIRST FOUR SUPRISINGLY VERY OLD BOOKS WITH THEIR COVERS PRINTED IN RED INK PREPASS TIME = 20 MS (THE FIRST FOUR SUPRISINGLY VERY OLD BOOKS WITH THEIR COVERS PRINTED IN RED INK) PARSE: S MOOD NPU NP DET THE ORD FIRST QUANT INTEGER FOUR ADJP ADV SUPRISINGLY ADV VERY ADJ OLD N BOOK NUMBER PL NU PL PP PREP WITH NP DET POSS PRO THEY POSSPRO N COVER NUMBER PL NU PL S MOOD REL VOICE PASSIVE NP DET NIL PRO SOMETHING NU SG-PL AUX TNS PRESENT VP V PRINT NP DET WH N COVER NU PL PP PBEP IN NP DET NIL ADJ RED 115 N INK NUMBER MASS NU MASS PARSE TIME = 5268 MS COMMENTS: The p a r s i n g i s slow because noun phrase ut t e r a n c e s are one of the l a s t c o n s t r u c t i o n s the grammar look s f o r . T h i s s i t u a t i o n i s f u r t h e r complicated s i n c e " p r i n t e d " f i r s t appears to be the main verb of a sentence. SENTENCE: THE FAT RED PARTY WAS ANGRY PREPASS TIME = 5 MS (THE FAT RED PARTY WAS ANGRY) NIL PARSE TIME = 955 MS COMMENTS: T h i s sentence f a i l s to parse because " p a r t y " and a d j e c t i v e s are s e m a n t i c a l l y incompatible. SENTENCE: THE BOX GAVE THE BOY A PENCIL PBEPASS TIME = 5 MS (THE BOX GAVE THE BOY A PENCIL) NIL PARSE TIME = 282 MS COMMENTS: Th i s sentence f a i l s to parse because the s u b j e c t of the verb " g i v e " must be animate. 116 SENTENCE: A RUNNING PYRAMID IS ON THE TABLE PREPASS TIME = 6 MS (A RUNNING PYRAMID IS ON THE TABLE) NIL PARSE TIME = 564 MS COMMENTS: T h i s sentence f a i l s to parse because the a d j e c t i v e "running" should not modify "pyramid". SENTENCE: PUT THE CUBE PREPASS TIME = 3 MS (PUT THE CUBE) NIL PARSE TIME = 280 MS COMMENTS: T h i s sentence f a i l s to parse because i t i s not s p e c i f i e d where the "cube" i s t o be "put". SENTENCE: ME TALKS PREPASS TIME = 6 MS (ME TALKS) NIL PARSE TIME = 123 MS COMMENTS: This sentence f a i l s to parse because "me" cannot be the s u b j e c t of a sentence. 117 SENTENCE: THEY HAS COMING TO THE PARTY PREPASS TIME = 5 MS (THEY WAS COMING TO THE PARTY) N i l PARSE TIME = 123 MS COMMENTS: T h i s sentence f a i l s t o parse because the s u b j e c t and verb do not agree i n number. SENTENCE: HE GAVE HER A BOOKS PREPASS TIME = 4 MS (HE GAVE HER A BOOKS) NIL PARSE TIME = 301 MS COMMENTS: Th i s sentence f a i l s to parse because the determiner "a" does not agree with the noun "books" which i t m o d i f i e s . APPENDIX 3 - THE GRAMMAR 118 2 i THE GRAMMAR 3 * 5 I S 6 T . ITHIS IS THE INITIAL STATE OF THE GRAMMAR 8 9 IJUMP S-YESNO SO 11 ;IF INPUT LOOKS LIKE A YESNO OUESTICN, PROCEED TO 12 ".S-YESNO TO LOGX FOR THE TENSEO AUXILIARY VERB. 13 1* IAUXV LEX1 IS ISETR TYPE •IYESN01I I ' 1 6 17 (JUMP S-WH 18 19 ; I F INPUT LOOKS LIKE A WH-CUESTICN,. PROCEED TO S-WH TO 20 JLOOK FOR OUESTION DETERMINERS. PRONOUNS OR ADVERBS. 21 22 IWHOFORM LEXI) 23 2* IJUMP S-IMP 2S 26 ; I F INPUT LOOKS LIKE AN IMPERATIVE. PROCEED TTJ S-IMP TO 27 ;LO0K FOR AN UNTENSED VERS. IMPERATIVES MAY NOT BE INTROOUCEO 28 ;BY A PREPOSITION PHRASE. 29 30 UNO I NULL (GETR PREPPHRASESII 31 IUNTENSEDV LEX)) 32 ISETR TYPE •( IMPD) 'S3 34 (PUSH PP 35 36 :LOOK FOR INTRODUCTCRY PREPOSITION PHRASES. 37 ; I F AN INTRODUCTORY PREPOSITION PHRASE BEGINS WITH "BY" 38 ' :THEN THE SUBJECT OF A PASSIVE QUESTION MAY BE IN THE PHRASE. 39 IE.G. BY WHOM MAS THE COOK TAKEN 7 40 * l (GET LEX >PREP) 42 (SENDR FRONTED-AGFLAG T) 43 ICCND ((NOT (GETR AGENT)) (AOOR PREPPHRASES • ) ) ) 4* ITO S-PP1) ' 45 ' ' ' ' 46 IJUMP S-DCL *T 48 ( I F INPUT DOES'NOT LOOK LIKE A QUESTION. TRY TO PARSE IT AS 49 -,A DECLARATIVE SENTENCE. 50 51 (NOT (OUESTFORM LEX)) 52 ISETR TYPE 1 ( D C L ) ) ) S3 54 IJUMP S-NPU 55 56 ; I F ALL ELSE FAILS. TRY TO INTERPRET THE INPUT AS A NOUN PHRASE ST {UTTERANCE. PREPOSITION PHRASES OR ADVERBS MAY NOT PRECECE 58 -.THIS CONSTRUCTION. 59 60 (AND (NULL (GETR PREPPHRASES)I 61 (NULL (GETR AGENT)) 62 I NULL IGETR ADVERBS))) I 63 6* IJUMP S-PPU-POP 65 66 ;1F A PREPOSITION PHRASE HAS BEEN FOUND AND ALL ELSE 67 IFAILS, THE INPUT IS A FRAGMENT CONSISTING OF A 68 [PREPOSITION PHRASE. 6« TO (OR (GETR PREPPHRASES! 71 (GETR AGENT)) 72 (CONO ((GETR AGENT) 73 IADOR PREPPHRASES (BUILOO (PP (PREP BYI •) AGENT 11)1! T4 75 (PU5H ADV 76 ' 77 ILOOK FOR INTRODUCTORY ADVERBS. 78 79 IGET LEX »AOV) M IADOR ADVERBS •) et no s> i u • i i •-• • •* 85 86 IS-PPU-POP 87 •8 SCONSTRUCT A PREPOSITION PHRASE UTTERANCE PARSE AND RETURN. 89 90 (POP leuiLO-PPUl « Tl 92 I 93 94 95 (S-PP 96 97 |AN JNTROOUCTORY PREPOSITION PHRASE HAS BEEN FOUND. IF A QUESTION 98 lOET.E'HKINLR OR A CUESTION PRONOUN HAS BEEN FOUND IN THE PHRASE. 9» :THE FLAG WH-PHRASE IS SET ANO THEN PARSING CONTINUES AS FOR ICO ;A CUESTICN. 101 IE.C. IN HCM MANY FUNCTIONS IS FOB CALLED 7 102 103 IJUHP S-VESNO ICS ;IF A OUESTION DETERMINER OR PRONOUN HAS BEEN FOUNO THE NEXT ICS JUORO MUST BE AN AUXILIARY VERB. 108 [AND IGETR WH-PHRA5E) 109 IAUAV LEXIII 110 111 IJUMP S ' 1-12 111 PROCESSING A SIMPLE DECLARATIVE SENTENCE. PROCEED TO STATE S I t * 115 »> l i b I 117 118 IS-OCL 119 120 ;THE INPUT APPEARS TO BE A DECLARATIVE SENTENCE. LOOK FOR THE 121 ;SUBJECT OF THE SENTENCE. 122 123 IPUSH NP 12* 125 126 !„! * E C 0 C N U E T H E SUBJECT OF THE SENTENCE > « ;PROCEEO TO S-NP TO LOOK FOR VERBS. 127 128 T 129 ISETR SUBJ ») 130 tSETR S-SUB4 (GETR HEADNOUN)I 131 (TO S-NPII 132 I 133 13* 135 CS-IMP 136 13? ;THE INPUT APPEARS TO BE AN IMPERATIVE SENTENCE. 138 :E.G. LIST THE FUNCTIONS. 139 ;AN UNTENSEO VERB MUST BE FOUNO BEFORE LEAVING THIS STATE. " 1*0 1*1 (CAT V 1 « l«3 ;WE RECOGNIZE AN IMPERATIVE SENTENCE AND SET UP THE SUBJECT AS »»* J»YOU" AND THE TENSE AS "UNTENSEO". PROCEEO TO S-AUX TO 1*5 JCHECK FOR A NEGATIVE IMPERATIVE. 1*6 ;E.G. 00 NOT LIST THE FUNCTIONS. 1*7 IPOST-VERBAL MODIFIERS. 1*9 (GETF UNTENSEOl 150 ISETR SUBJ. 'IN? (DET NIL) [PRO YOUMNU SG-PLII1 151 (SETA V •) 152 (SETS TE;iSc MUNTENSEO!) 151 (SETR 5-SUbJ • (OUMMY YOU N I D I 15* ISETR S-VERB I8U1L0Q 13 (V •) (0)1 FEATURES)I 155 (TO S-AUXI I 156 1 157 158 ' 159 IS-NPU 160 161 161 SWE THINK THIS IS A NOUN—PHRASE UTTERANCE 162 (E.G. THE NAMES OF THE FUNCTIONS 163 16* (PUSH NP 165 166 ILOOX FOR A NOUN-PHRASE, THEN POP 1*6- T 169- ISETR SUBJ »> 170" (TO S-NPU-POPII 171 I 172 ITJ 17* . • ' ITS lS-YESNO 176 177 ITHIS STATE PROCESSES INPUT WHERE THE SUBJFCT AND VERB ARE INVERTED. 178 ITHIS OCCURS EITHER IN A YESNO OUESTION OR IN A WH-CUESTION 179 •WHERE THE SUBJECT IS NOT BEING QUESTIONED. ISO SE.C. DOES JOHN RUN FAST? 181 SE.C. WHICH BOOK 010 HE OWN 7 182 183 ICAT V 18V-185 I * TENSED AUXILTARY VERS MUST EE FOUND FIRST. PUT 1«» JTME VERB ON THE HOLD STACK UNTIL THE SUBJECT IS FOUND. 187 ISET THE TENSE REGISTER AN9 PROCEEO TO S-OCL TO FINO THE.SUBJECT. 1*8 189 IAUX») 140 (HOLD (BUILOO (V •))> 191 ISETR S-VERB teUILOQ (3 (V *l (III FEATURES II 192 ISETR TENSE (LIST IGETF TNSII) 193 ISETR YESNO T) 19* ITO S-YESNO-NEG)) 195 I 194 197 196 I S-YESNO-NEG 199 700 I IF THE OIIFSTInN WAS NFRATFO AND HAD A CfiNTRACTt(IN IN THF INPUT 201 ;THE -NOT- APPEARS AFTER THE VERB. 202 ;E.C. ISN'T THE BOY HAPPY 7 -> I S NOT THE BOY HAPPY 7 2C3 20* (WRD NOT 2C5 T 201, (SETR NEC • (NEGATIVEI) 207 (TO S - O C L I ) 209 20? (JUMP S-DCl 210 211 JNOT A CONTRACTED NEGATED SENTENCE 212 ' 213 T) '21* I 215 216 217 (S-WH 218 219 5TH1S STATE PROCESSES A WH-0UEST10N. THE INPUT STARTS WITH A 220 [QUESTION ADVERB, DETERMINER, OR PRONOUN. 221 222 (CAT QADV 223 22* . (THE 228 229 230 231 2 2 * (THE INPUT STARTS WITH A QUESTION ADVERB SUCH AS WHEN,WHERE. 2 2 5 (WHY OR HOW. PROCEED TO S-YESNO TO DEAL WITH SUBJECT-VERB 2 2 * I INVERSION.ThE NEXT ELEMENT MUST BE A TENSED A U X I L I A R Y . 2 2 7 ;E.G. WHY DOES JOHN RUN FAST7 (COND ((NULL (COR S T R I N G ) ) N I L ) (lAUXV (CADR S T R I N G ) ) ) ) (ACDR ADVERBS (BU1LDQ (QADV •>)> 2 3 2 I S E T R TYPE • ( Q A D V ) I 2 3 3 (TO S - Y E S N O I I 2 3 * ' . 2 3 3 (PUSH CP 2 3 4 2 3 7 ( T H E INPUT STARTS WITH A OUESTION PRONOUN SUCH AS WHOM, WHAT 2 3 8 IWHICH, E T C . T H I S PRONOUN REPLACES THE OBJECT OF THE SENTENCE. 2 3 9 (E.G. WHAT OID HE G I V E TD THE BOY 7 z*o : T H I S PRONOUN MAY BE FOLLOWED BY A P R E P O S I T I O N P H R A S E . ^ 2*1 ;E.G. WHICH OF THE BOOKS OID HE GIVE TO THE B0Y7 2*2 ( P L A C E THE OBJECT PHRASE ON THE HOLD STACK. 2*3 [PROCEED TO S-YESNO TO F I N D THE A U X I L I A R Y VERB AND OEAL 2** ;WITh THE SUBJECT-VERB I N V E R S I O N . 2*5 ;THE NEXT.WORO MUST BE AN A U X I L I A R Y V E R S . 2*6 2*7 (AND (GET L E X 'QPROI 2*8 (NOT IASSO ' S U B J (CDR IGET L E X •OPROIIIII 2*9 (CONO ( ( N U L L S T R I N G ) ( A B O R T ) I 2 5 0 I INGT-CAUXV L ' E X » (AP0RT1 11 2 5 1 (HOLD ( A P P E N D • (GETR PREPPHRASES)11 2 5 2 ( S E T R TYPE ' ( Q P R O I ! 2 5 3 I S E T R OOBJ (GETR HEADQPRO)) 2 5 * (SETR S -00 (GETR Q O B J I ) 2 5 5 ISETR PREPPHRASES N I L ) Z 5 6 (TO S - Y E S N O I I 2 5 7 2 5 8 ( P U S H CP 2 5 9 2 6 0 ITHE INPUT STARTS WITH A QUESTION PRONOUN SUCH AS WHO, 2 6 1 IWHAI, WHICH, E T C . THIS PRONOUN R E P L A C E S THE SUBJECT OF 2 6 2 (THE SENTENCE AND MAY BE FOLLOWED BY A P R E P O S I T I O N PHRASE. 2 6 3 i E.C. WHO WAS G I V E N THE BOOK 7 2 6 * IE.G. WHICH OF THE MEN I N THE ROOM WAS G I V E N THE B O O K ? 2 6 S JPROCEEO TO S-NP TO F I N D AN A U X I L I A R Y V E R B . (AND (GET L E X 'QPRO) (NOT (ASSO « C 8 J (COR (GET L E X • Q P R O O I I I 2 6 9 ICOND I ( N U L L S T RING) (ABORT!) 2 7 0 ( ( N O T (GET L E X ' V I I ( A B O R T ! ) ! 271 ( S E T R S U B J ( A P P E N D • (GETR P R E P P H R A S E S ! ) I 2 7 2 ( S E T R S - S U 3 J (GETR HEADCPRO)) 2 7 3 (SETR TYPE ' ( Q P R O I ) 2 7 * I S E I R PREPPHRASES N I L I 2 7 * (TO S-NP) ) 2 7 6 2 7 7 (CAT QOET 2 7 8 2 7 9 I T H E INPUT STARTS WITH A QUESTION DETERMINER SUCH AS WHICH OR 2 8 0 (WHAT. 2 8 1 I E . G . WHICH BOOKS ARE ON THE TABLE 7 282 ^^3 T i 2 R * ( S E T R QOET • ) 2 8 5 (TO S-QDETI1 2e6 I 2 8 7 2es 2 8 9 290 (S-OOET 2 9 1 2 9 2 SA QUESTION DETERMINER INTRODUCES THE SENTENCE. . 2 9 3 I E . G . WHAI BOOKS OID HE SEND 7 2 9 * ;SENOR THE QUESTION OETERMINER TO THE NP—DET STATE I N THE 2 9 5 INCUNPHRASE NETWORK TO F I N D THE REST OF THE QUESTION 2 9 6 ;NOUN P H R A S E . 2 9 T 2 9 8 ( P U S H NP-OET 2 9 9 T 2 6 6 267 268 *?? (SENDR OET (CETR CDETII (SENDR SEH-DET (BUILDO (COET») ODETI) l°l . J f ! " MH-NC (APPENO » (GETR PREPPHRASES1M 3 0 3 'SETR TYPE 'IUOETII 3 0 * ISETR PREPPHRASES NIL) 3 C 5 (TO S-WH-NPI) 3C6 307 . . 308 3C9 IS-WH-NP 310 311 STHE INPUT IS INTRODUCED 8Y A HH-NCUNPHRASE. 312 ;E.G. WHICH MAN WHAT BOOKS 3 13 31* (JUMP S-YESND 315 31* STHE WH-NP IS THE OBJECT OF THE SENTENCE. AN AUXILIARY VERB 317 (MUST BE THE NEXT ELEMENT SINCE SUBJECT-VERB INVERSION . 3(8 -.OCCURS. 319 ;E.C. WHAT BOOKS DID HE GIVE YOU 7 320 I PLACE. THE OBJECT NCUNPHRASE ON THE KOLD STACK. 321. SPROCEED TO S-YESNO TO DEAL WITH INVERSION. 322 323 IAUXV LEX1 32* ISETR S-00 IGETR HEADNOUN)1 325 (HOLD IGETR WH-NPII 324 (SETR OOBJ (GETR HEADNOUN)) 1 327 328 (JUMP S-NP 329 330 STHE WH-NOUNPHRASE IS THE SUBJECT OF THE SENTENCE. A VERB 331 ;MUST BE THE NEXT ELEMENT. NO SUajECT-VERB INVERSION OCCURS. 332 :E.O. WHICH MAN CAME 7 333 - -.PROCEED TO S-NP TO LOOK FOR AUXILIARY VERBS. 33* 315 (GET LEX 'VI 334 (SETR SUBJ (GETR WH-NPI) 337 (SETR S-SUBJ (GETR HEADNOUN)) 1 338 I 339 3*0 3*1 3*2 IS-REL 3*3 . 3** 1THIS IS THE START OF THE RELATIVE CLAUSE NETWORK. 3*5 SRELATIVE CLAUSES MAY START WITH "WHICH", "WHO", "THAT", "WHOM". 3*6 ;"WKCSE" CR A PREPOSITION. 3*7 3*8 (MEM (WHICH WHO THAT) 3*9 J50 PROCESSING A RELATIVE CLAUSE STARTING WITH "WHICH", 351 i"WHO", OR "THAT". "WHICH" OR "THAT" MAY REPLACE THE 352 SSUSJECT OR OBJECT OF THE CLAUSE. 353 ;E.G. THE MAN THAT WE SAW.... 35* IE.G. THE MAN THAT SAW THE OOG..... 355 356 T 357 (TO S-REL-WH)) 358 359 IWRO WHOM 360 361 SRELATIVE CLAUSE.STARTING WITH "WHOM" MEANS THAT THE 342 SUSSING NOUN-PHRASE IN THE CLAUSE IS NOT THE SUBJECT, 363 ;S0 PUI THE SENDR-ED REGISTER WH ON THE HOLO STACK. 36* SE.G. THE BOY WHOM I SAW... 365 366 T 367 (HOLD IGETR UH1) 363 ISETR S-DO (CETR WH-HEA0N0UN1I 369 . (SETR WH NIL) 370 (TO S-REL-WH)) 371 372 (WRO WHOSE 373 37* ;THE RELATIVE CLAUSE STARTS WITH -WHOSE". THIS MEANS 375 .THAT A NOUN PHRASE FOLLOWS. THIS NOUN PHRASE MAY BE EITHER 376 STHE SUBJECT OR ORJECT OF THE CLAUSE. 377 iE.G. THE MAN WHOSE DOG WE SAW... -3TB 379 T 380 ITO S-REL-WHOSE)) 381 382 ICAT PREP 383 38* STHE RELATIVE CLAUSE IS INTRODUCED 8Y A PRONOUN. 3S5 iE.G. THE WATER INTO WHICH HE FELL... ! 386 387 T 388 (SETR PREP *> 389 ITO S-REL-PREPI) 390 I 391 3«2 393 IS-REL-WHOSE 39* 395 SFIND THE REST OF THE NOUNPHRASE MODIFIED BY "WHOSE". 396 ;PRCCEEO TO S-REL-WH TO LOOK FOR THE REST OF THE CLAUSE. 397 SIF THE CLAUSE WAS INTRODUCED BY A PREPOSITION THEN CONSTRUCT 398 STHE PREPOSITION PHRASE. 399 1E.C. THE GIRL TO WHOSE BROTHER THE BOOK WAS GIVEN.,.. 4C0 401 402 403 404 405 4 06 407 408 4 09 410 411 412 • 13 414 415 416 417 418 419 420 421 422 423 4 24 425 426 427 428 429 430 431 432 433 4 34 435 4 36 4J7 438 439 440 441 442 443 444 445 446 447 448 4.49 . 450 451 452 453 454 455 456' 457 4 58 459 460 461 462 463 464 465 466 467 468 469 • 70 471 • 72 • 73 474 475 • 76 • 77 • 78 • 79 •eo • 81 •82 • 83 • 84 4 85 486 487 • 88 4 89 • 90 491 492 493 494 495 • 96 497 • 98 • 99 !IF Tl-E PREPOSITION HAS "BY" THEN SAVE THE NOUN PHRASE ;IN CASE THE CLAUSE IS PASSIVE. SE.C. THE GIRL BY WHOSE BROTHER THE 8C0K WAS TAKEN.,'. IPUSH NP-DET -T ISENDR DET 'WHI tSENDR SEM-DET MWH11 ISENOR HODS (LIST ILIST 'POSS (CAOOR (GETR WHIIIII , . (COND (ICETR PREPWHI ISETR WH NIL I (COND (IEO IGETR PREP) ' 8Y1 ISETR AGENT •) ISETR HEAD AG ICEIR HEADNOUN))) (T IADDR PREPPHHASES (BUILDO (PP (PREP • ) •! PREPII IT ISETR WH-HEADNOUN (CETR HEADNOUN)) ( SETR WH ») I ) ITO 5-REL-WHI) (S-REL-PREP :A P R E P O S I T I O N INTRODUCED THE R E L A T I V E C L A U S E . ( P E N (WHICH WHOH) ;THE H I S S I N G NOUN-PHRASE I S THE 0 8 J E C T OF THE P R E P O S I T I O N . 5E.G. THE WATER INTO WHICH HE F E L L . . . ".BUILD THE P R E P O S I T I O N PHRASE. ! I F THE P R E P O S I T I O N I S "BY" THEN SAVE THE NOUN PHRASE IN ;CASE THE CLAUSE I S P A S S I V E . T ICCNO I I E O IGETR P R E P ) 'BY) ISETR AGENT IGETR WH)) (SETR HEAOAG IGETR WH—HEADNOUN)) I I T IADDR PREPPHRASES ( B U I L O O ( P P ( P R E P •) •) PREP W H M I I ISETR WH N I C ) (TO S-REL-WH)) IURD. WHOSE ;THE K I S S I N G NOUN PHRASE I S A P O S S E S S I V E MODIFYING A F O L L O W I N G NCUN PHRASE. ;E.G. THE GIRL TO WHOSE BROTHER THE BOOK WAS G I V E N . . . . T ISETR PREPWH T l (TO S-REL-WHOSEI) IS—REL-WH _ •THE RELATIVE PRONOUN HAS BEEN IDENTIFIED, LOOK FOR THE IREST OF THE CLAUSE. IPUSH NP iFINOING A NOUN-PHRASE IMPLIES THAT THE MISSING NP IN THE ICLAUSE IS NOT THE SUBJECT OF THE CLAUSE, SO PUT THE SENOR-ED 1REGISTER WH ON THE HOLD STACK. SAVE THE NP AS THE SUBJECT. -.E.G. THE BCGK WHICH THE BOY HAD... T (COND ((GETR WH) (HOLD (GETR WHII II ISETR WH08J T) ISETR SUBJ »l (SETR S-SUBJ IGETR HEADNOUN)) (SETR S-DO (GETR WH-HEADNOUN)I (10 S-NPI ) I JUMP S-NP tNO NOUN-PHRASE FOUND, SO KEEP REGISTER WH AS THE SUBJECT, SIF WE ARE NOT PROCESSING A REDUCED RELATIVE CLAUSE I WHICH IMUST START WITH A NP IF WE GET TO HERE). IE.G. THE BOY WHO CAME... IHOT IGETR REOUCEDI) ISETR S-SUBJ* (GETR WH-HEADNQUNII ISETR SUBJ (CETR WH|)| IPUSH PP IGET LEX 'PREP) (ACDR PREPPHRASES ») (TO S-REL-WHI) I (S-REL-REOUCEO ;TH!S IS THE STAR I OF THE REDUCED RELATIVE CLAUSE NETWORK. (WRD NCI iTHE VERB IS NEGATED. SCO 501 I * ? J (SETR NEG •(NEGATIVE)) (TO S-REl-REDUCEO)I 505 (CAT V 5C6 507 :THE REDUCED RELATIVE CLAUSE IS PASSIVE. 508 (E.G. THE BOOK GIVEN TO YOU... 5C9 [SAVE THE WH REGISTER ON THE HOLD STACK (IT PROBABLY IS 510 ITHE OBJECT), SET AGFLAG AND PASSIVEFLAG TO INDICATE A PASSIVE. i l l ISET SUBJ TO "SOMETHING". DEFAULT TENSE TO PRESENT. SAVE 512 $ THE VERB IN V. 513 51* (PASSIVE*) 515 (SETR V *) 516 ISETR S-VERB IBUILDO 13 (V •) (<)) FEATURES)I 517 (HQLO (GETR WHI) 518 ISCIR S-00 (GETR WH-HEAONOUN)I 519 (SETR AGFLAG T( 5 2 0 (SETR PASSIVEFLAG T) 521 (SETR SUBJ 522 MNP IOET NIL) IPRO SOMETHING) INU SG-PL))) 523 ISETR 5-SUBJ * I DUMMY SOMETHING N I D I 52* 1SETR TENSE •I PRESENT I) 525 (SETR VOICE MV01CE PASSIVEI1 526 (TO S-V)) 527 528 (CAT V 529 530 ;THE REDUCED CLAUSE IS IN PROGRESSIVE ASPECT. 531 SE.G. THE GIRL GIVING YOU THE BOOK.•• 532 J THE SUBJECT IS THE SENDR-ED «H REGISTER. SAVE THE VERB. 533 [PROCEED TO S-AUX TO LOOK FOR MAIN VERB. 53* 535 (GETF PRESPART) 536 (SETR V ») 537 (SETR S-VERB (OUILOQ (a IV *) H I ) FEATURES )) 538 ISETR SUBJ (GETR WHI) 539 (SETR S-SUBJ (GETR WH-HEADNCUNII 5*0 ISETR TENSE •I PRESENT)) 5*1 (SETR ASPECT MPROGRESSIVE)) 5*2 (TO S-AUXI) 5*3 5«* IJUMP S-REL-WH 5*5 5*6 |OTHERWISE THE REDUCED CLAUSE MUST START WITH A NP. 5*7 IE.G. THE BOOK THE MAN GAVE TO THE BOY... 5*8 5*9 T 550 ISETR REDUCED T ) l . ' 551 I 552 553 55* IS-NP i 555 55* 557 558 IVIR V 559 560 561 IA SUBJECT NOUN-PHRASE HAS BEEN FOUND. LOOK FOR AN AUXILIARY VERB. JGET VERB FROM THE HOLO STACK IF PROCESSING ft QUESTION. 562 (ANO (GETR YESNOI 563 IS-V-NUM8ER-CHK (GETR S-SU9JI (GETR S-VERBI) I 56* (SETR V (CAOR * ) ) 565 (TO S-AUKII 566 567 ICAT V 568 569 I VERB MUST BE TENSED. UNLESS PROCESSING A TO—COMPLEMENT. 570 t -571 (OR (ANO (GETF TNS) 572 IS-V-NUHBER-CHK (GET1 S-SUBJI. 573 (BUILOQ (9 (V *) (III FEATURES))! 57* (AND (GETR TOFLAG) t 575 (GETF UNIENSEO))) 576 (SETR TENSE (LIST (GETF TNS))) 577 (SETR S-VERB IBUILDO 13 IV •) (III FEATURES I I 578 ISETR V •) 579 ITC S-AUX)I seo 581 (PUSH ACV i 582 (GET LEX -ADV) 583 IA00R ADVERBS •) 58* (TO S-NPU 585 I 586 587 588 (S-NPU-POP 589 3 90 591 592 IPOP (BUILO-NPU) 593 T l 59* I 595 596 597 (S-AUX 598 599 IAN AUXILIARY VERB MAS BEEN FOUND, LOOK FOR MAIN VERS. IA NOUN-PHRASE UTTERANCE HAS BEEN FOUND. RETURN THE PARSE. 600 5SET TENSE AND ASPECT ACCORDINGLY. 601 602 (WRO NOT 603 60* ;THE VERB IS NEGATED. THE MAIN VERB SO FAR MUST BE AN AUXILIARY. 605 6C6 IVFEATURE (GETR VI ' AUXI 60T (SETR NEG MNEGAT1VE)) 60S (TO S-AUXI) 609 610 (CAT V 611 (PERFECT I 612 (SETR V »l 613 (SETR ASPECT •(PERFECTII 61* (SETR S-VERB (BUILOQ (3 (V »1 (III FEATURES!I• 615 I TO S-AUX)I 6 16 617 (CAT V 618 (PROGRESSIVE) 619 (SETR V «) 620 (SETR ASPECT (APPEND (GETR ASPECT) •I PROGRESSIVE))) 621 (SETR S-VERB (BUILOO (S (V *) [t)> FEATURES)) 622 (TO S-AUXI I 623 62* (CAT V 625 (FUTURE) 626 (SETR V •) 627 (SETR TENSE •(FUTURE)) 628 (SETR S-VERB (BUILOQ 13 (V »( (1)1 FEATURES)) 629 (TO S-AUX)) 6 30 631 (CAT V 632 633 •SENTENCE IS PASSIVE. PLACE SUBJ ON HOLD STACK SINCE IT IS 634 (REALLY AN OBJECT. SET AGFLAG.ANO PASSIVEFLAG TO INDICATE PASSIVE. 635 ;SET SUBJ TO -SOMETHING" UNLESS AGENT HAS BEEN FOUND ALREADY. 636 637 (PASSIVE) 638 (SETR V * l 639 ISETR S-VERB (BU)LDQ 19 (V •) (1)1 FEATURES)I 640 (HOLD (GETR SUBJ)I 641 (SETR S-00 (GETR S-SUBJ)) 642 (SETR PASSIVEFLAG T) 643 (CONO ((GETR AGENT) 644 (COND I(S-V-SEMANTICS (GETR HEAOAG)(GETR S-VERB)) 6*5 (SETR SUBJ (GETR AGENT)) 646 (SETR S-SUBJ (GETR HEAOAG)) 647 (SETR AGENT NIL) 648 (SETR AGFLAG NIL)) 649- IT 650 (AODR PREPPHRASES (BUILOQ (PP (PREP BY) ») AGENT I ) ) ) ) 651 (T (SETR SUBJ MNP (OET N(LI(PRO S0HET.HING1 INU SG-PLII) 652 ISETR S-SUBJ MDUMMY SOHETHING NIL)) 653 ISETR AGFLAG T i l ) 654 * ISETR VOICE MVOICE PASSIVE)) 655 (TO S-V-SEMANDCS)) 656 657 (CAT V 658 659 I IF "DO" IS THE AUXILIARY AND NOT PROCESSING 660 !A OUESTION WITH SUBJECT-VERB INVERSION OR A NEGATIVE 661 I"DO" IS USED AS A HODAL. 662 663 (DO-AUX) 664 (SETR V •) 665 (SETR S-VERB (BUILOQ 13 IV •) III) FEATURES I) 666 (CONO ((ANO (NOT (GETR YESNO)) 667 INOT (GETR NEGIII 668 . (SETR MODAL MMODAL DOI) I) 669 (COND ((GETR AGENT) 670 (ADOR PREPPHRASES IBUILDO 1PP (PREP BY) •) AGENT)I 671 (SETR AGENT NIL))) 672 (TO S-V-SEMANTICSI) 673 674 (CAT V 675 676 (THERE IS A MOOAL IN THE SENTENCE. THE MOCAL FLAG IS SET 677 ;IF THE AUXILIARY IS A MODAL AND THE CURRENT VERB IS 678 iUNTENSED. 6 79 680 (MODAL) ' 681 (SETR MOOAL (BUILOQ (MODAL •> VII 682 (SETR V •) -683 (SETR S-VERB (BUILOQ 13 IV •) 11)1 FEATURES)) 6E4 I TO S-AUXI) 685 6B6 (PUSH ACV 667 (AND (NOT (VFEATURE (GETR V) 'COPULA)I 68B (GET LEX 'AOVII 689 (AODR ADVERBS •) 690 (TO S-AUX)) 691 692 (JUMP S-V-SEMANTICS 693 694 (IF INPUT IS A WH-QUESTION WHOSE OBJECT IS MISSING AND WHOSE 695 .MAIN VERB "AY BE USEO AS AN AUXILIARY, THEN AN AUXILIARY VERB 696 (MUST ALSO BE PRESENT. 617 I I . E . AT THIS POINT EITHER.THE ASPECT REGISTER MUST BE SET 698 (THE TENSE MUST BE FUTURE OR A MCOAL MUST BE PRESENT. 699 IE.G. WHICH BOOK HAS THE MAN HAD 7 ICQ ;THE MAIN VERB MAY NOT BE A MCDAL-701 • 7C2 (CONO ( U N a (GETR Q0BJ1 7C3 •- . ' (VFEATURE (GETR VI 'AUX1) 704 IOR IGETR ASPECT)' 705 IGETR MODAL) 706 IEO ICAR IGEIR TENSEII "FUTURE!)) 707 ((VFEAIURE (GETR V) 'MODAL) NIL) . 70B IT) I . 709 (CCND (IGETR AGENT I 7X0 IACCR PREPPHRASES I8UILD0 (PP (PREP BY) ») AGENT)) T i l (SETR AGENT N I L ) ) ) ) 712 ) 713 714 715 IS-V-5EMANTICS 716 717 STHIS STATE CHECKS THE SEMANTIC AGREEMENT OF THE SUBJECT AND THE MAIN 718 719 IJUMP S-V 720 (COND ( (S-V-SEMANTICS (GETR S-SUBJXGETR S-VER8)))!) 721 I 722 723 724 (S-V 725 726 ;AT THIS POINT THE MAIN VERS HAS BEEN IDENTIFIED. LOOK FOR 727 ;POST-VEREAL MODIFIERS. 728 729 IV1R NP 730 731 .RETRIEVE THE NP PLACED ON HOLD STACK AS OBJECT OF 732 ;THE VERB WHEN PROCESSING A RELATIVE CLAUSE, PASSIVE, 733 SCR WH-QUESTION. 734 735 T 736 [CCND ((NOT (V-DO—AGREEMENT)) (ABORT)1) 737 ISETR OBJ »l 738 I TO S-V-TOCOMP)) 739 740 IPUSH NP 741 742 SLOOK FOR A DIRECT OBJECT OR SUBJECTIVE COMPLEMENT FOR • 743 STRANSITIVE OR COPULA VERBS. 74* 745 ICR IVFEATURE IGETR VI 1 TRANS) 746 IVFEATURE (GETR VI 'CCPULA)) 747 (SENDR MOT IONFLAG T l 748 ISETR S-00 IGETR HEADNOUN)! 749 ICONO ((NOT IV-DO-AGREEMENT)) (ABORTIII 750 ISETR 083 «T 751 (TO S-V-T0CGHP1I 752 753 (PUSH AOJP 754 755 SLOOK FOR PREDICATE ADJECTIVES AFTER COPULA VERBS. 756 T57 (AND tVFEATURE (GETR VI 'COPULA) 758 (OR IGET LEX 'AOVI (GET LEX -ADJ))) 759 (SETR V ») 760 (CONO I(NOT (PREDADJ-SEMANTICS (LIST IGETR HEADADJ)) 761 IGETR S-SUBJ))) 762 I ABORT))) 763 ISETR S-VERB *) 764 (TO S-PREDAOJM 57 6 6 ICAT P R E P 767 771 772 7 73 SALTER THE MAIN VERB TO THE'NEW COMPOUND. , A N ° <NOT IGETR PARTICLE!I 774 .. '*SSO • (CET (GETR VI 'PARTICLE*111 (SETR PARTICLE T) 776 . „„ 777 (TO S-V)) 778 779 IWRD THAT 780 781 SLOOK FOR THAI-COMPLEMENTS. 782 SE.G. 1 HOPE THAT HE COMES. 7e3 784 IVFEATURE JGETR V) 'THAT) 785 ITO S-V-WRC=IHAT)I 786 787 IWRO TO 7E8 789 SLOOK FOR T0-CDMPLEMENT5 790 SE.G. I WANT TO GO. 791 792 T 793 ITO S-V-WRO-TOII 794 795 I PUSH ACV 796 I GET LEX * ADV) 797 IADDR ADVERBS •) 798 I TO S-VI) 799 8C0 IJUMP S-V-WRD'TMAT 126 (LOOK FOR REDUCED THAT—COMPLEMENTS. 801 8C2 . — - » v w u .n».-SC3 (E.G. I HOPE HE COMES. 8C* 605 .(AND (VFEATURE ICEIR V) "THAT) 806 (NOT (MEMO LEX "(TO THAT 111 807 (NOT (GETR PASS IVEFLAG11J 1 ' B0<) ( JUMP S-V-PP 810 T l 811 I 812 813 81* 1S-PREDADJ 815 816 ["THAN" SIGNALS A PREDICATE ADJECTIVE COMPLEMENT. 817 IE.G. HE IS OLDER THAN MARY. 819 URD THAN 820 (CCMPVERB (GETR VI) ' • 821 I TO S-PREDAOJ-CCMPI) 822 823 I JUMP S-MA1NCLAUSE 82* T l 825 I . 826 827 828 (S-PREDAOJ-COMP 829 830 ILOOK FOR COMPLEMENTS OF THE PREDICATE AOJECTIVE. 832 (PUSH NP 833 T 83* ISETR OBJ *1 835 ITO S-MAINCLAUSEII 836 I 837 838 839 (S-V-NP 6*0 8*1 IA NOUN-PHRASE HAS BEEN FOUND AFTER THE VERB. 8*2 . 8*3 IV1R NP 8** 8*5 IA SECOND NOUN PHRASE MAY BE FOUND ON THE HOLO STACK IF 8*6 , !A Wh-CUESTICN IS BEING PROCESSED. THIS ONLY OCCURS IF 65T .THE CUESTICN HAS BOTH A PASSIVE TRANSFORMATION AND SUBJECT 8*8. - (-VERS^TNVERSTON; THE' VERB'MUST BE ABLE TO TAKE AN INDIRECT B*9 (OBJECT. 850 -.E.G. WHAT WAS THE BOY GIVEN 7 851 (PROCESSING PLACES "WHAT" ON THE HOLD STACK. THIS IS THE 852 [DIRECT OBJECT OF THE SENTENCE. REORGANIZE THE REGISTERS 853 [ACCORDINGLY. *855 856 B56 (AND [VFEATURE (GETR V I MND0BJ1 857 , M S W Q ' " R (GETR T Y P E D M OPRO O D C l l l i HI | S E T R S-DO (GETR C O B J I I 861 (COND [ ( O R (NOT (V-DO-SEMANTICS (GETR S - V E R B K G F T B ^ r m i i i • « .ABORT,?, ' V - ^ - « H - M C S . G E ? R V I ! V E R B C I I G R E ^ ! N O D „ „ 863 86* 865 866 I PUSH NP 668 869 670 8 78 879 ISETR OBJ •) I TO S-V-PP)) III ! f ; C " T H E B 0 C K «MICH I GAVE YOU. »ll [REGISTERS ACCORDINGLY. 0 B J 6 C T - REORGANIZE THE J „ S E - G * * E " V E K E (HE BOOK. IVFEATURE (GETR VI •INDOBJ) ISENOR AGFLAG IGETR AGFLAG)I 8P0 ICONO 881 IIOR (AND (GETR WHOBJI 8*2 " (NOT (GETR PASSIVEFLAGll) •43 (GETR 003JII 83* ISETR S-INDO IGETR HEAONOUNIl 865 (AODR PREPPHRASES 886 IBUILDO (PP (PREP TO) *)) I I 887 IT est IADDR PREPPHRASES 889 ICUILDO IPP IPP.EP TO) •) DBJI) 890 ISETR S-INDO IGETR S-DO)) 891 ISETR S-DO IGETR HEAONPUNI) 892 (CONO I (OR INOT IV-DO-SEMANIICS IGETR S-VERB) (CEIR S-DOD) 693 IN07 (V-INDD-SEMAMICS (GETR S-VERBI (GETR S-INDO) I D 89* (ABORT))) 895 (SETR OBJ • ) I ) 896 (TO S-V-PP)) 897 898 ( PUSH ACV B ,"> (GET L E X 9C0 9CI 902 9C3 90* 905 906 907 908 909 910 911 912 913 91* 915 916 917 918 919 920 921 922 923 92* 925 926 927 925 929 930 931 932 933 93* 935 9 36 937 938 939 9*0 9*1 9*2 9*3 9** 9*S 946 9*7 948 949^ 950 931 952 953 95* 955 956 9S7 958 959 960 961 962 963 96* 965 966 967 968 969 970 971 972 973 97* 975 9 76 977 978 979 980 981 982 983 984 985 986 98? 988 989 990 991 992 993 99* 995 996 99? 998 999 loco (ACOR ADVERBS »| 110 S-V-NP)> (JUMP S-V-PP Tl (S-V-PREP=BY STHE PREPOSITION "BY" HAS BEEN FOUND AND THE SENTENCE IS PASSIVE. THE FOLLOWING NP HAY BE THE AGENT OF [HE PASSIVE SENTENCE AND THUS THE SUBJECT OF THE ACTIVE SENTENCE. SE.G. THE BOOK WAS GIVEN BY THE WAN. -PREPCsiTION H"BY- U N P H R 4 S E B E ™ E S U B J 6 C T 0 F T H E lOCATtONAL IE.C. THE MAN STOOD BY THE STREAM. I PUSH NP T (SENOR AGFLAG IGETR AGFLAGI) ISENOR MOTICNFLAG T) ICOND [(NOT IS-V-SEMANTICS [GETR MEADN0UN1 (GETR S-VER8III [AODR PREPPHRASES (BUILDO (PP (PREP BYI M i l l IT (SETR SUBJ •! (SETR S-SUBJ IGETR HEADNOUN)I ISETR AGFLAG NIL I)) ITO S-V-PPI) IS-V-PP SLOCK FOR FINAL POST-VERBAL MODIFIERS. IWRD BY •THE AGENT OF THE PASSIVE SENTENCE MAY FOLLOW "BY". IGETR AGFLAG) o ITO S-V-PREP-BYI) IPUSH PP IGET LEX •PREP) ISENOR HOT 1ONFLAG (CONO KNOT 1ASS0 •MOTION (COR IGET LEX 'PREP))!IIII ISENOR AGFLAG (CETR AGFLAG11 (ACOR PREPPHRASES •) ITO S-V-PP)) (PUSH ACV [GET LEX •AOVI (ACOR ADVERBS »> (TO S-V-PPII IJUMP S-MA1NCLAUSE T l , IS-V-WRO'THAT •LOCK FOR THAI-COMPLEMENTS. SE.G. I HCPE THAT HE COMES. (PUSH S-OCL T ISENOR TYPE MOCLIl (ADDA COKFl (BUILOQ (COMPL ICTYPE THAT) * ) ) | (AND IVFEATURE (GETR V) 'TRANSI ISETR S-DO (CAR (GETR COHPLIIII ITO S-MAINCLAUSEI) I IS-V-TOCONP SLOOK FOR TO—COMPLEMENTS. SE.G. I WANT TO GO. ICAT PREP SLOOK FOR A PARTICLE FOLLOWING THE DIRECT 08JECT. SE.G. tie PICKED THE BOOK UP. SALTER THE VERB TO THE NEW COMPOUND FORM. (AND INOT IGETR PARTICLE!) IASSO • (GET (GETR V) -PARTICLES!11 ISETR V (CAOR (ASSO • (GET (GETR VI -PARTICLES!!!) ISETR S-VERB {BUILDO (V • I VI) " ISETR PARTICLE Tl 110 S-V-IOCOHPI) IWRO TO . T ITO S-V-WRO"TOI) IJUMP S-V-NP T) 1001 100? 10C3 100* IC05 1006 10C7 iocs 1009 1010 1011 . 1012 1013 101* 1015 1016 1017 1018 1019 1020 1021 1022 1023 102* 1025 1026 1027 1028 1029 1030 1031 1032 1033 103* 1035 1036 10 37 10 38 1039 10*0 10*1 10*2 10*3 10** 10*5 10*6 10*7 10*8 10*9 1050 1051 1052 1053 105* 1055 1056 1057 1058 1059 1060 1061 1062 1063 106* 1065 1066 106? 1068 1069 10 70 1071 1072 1073 107* 1075 1076 107? 1078 1079 1080 loei 1082 1083 108* 1085 1086 1087 1088 1089 1090 1091 1092 1093 109* 1075 1096 1097 1098 1099 11 CO (S-V-WRC-TO ILCCK FOR THE REMAINDER Of THE TO-COHPLEHf N-Ti-'-tN. SUBJECT OF THE •TO-COMPLEMENT IS THE OBJECT OF THE TCP LEVEL SENTENCEt IF ;U IS PRESENT, OTHERWISE IT IS THE SUBJECT OF THE IOP-LEVEL (PUSH S-NP T (SENDR TOFLAO T l (SENOR TYPE MDCLI) (SENDR SUBJ (COND ((GETR OBJ)1 . . (IGETR SUBJ)) II (SENOR TENSE (GETR TENSEII (SENDR S-SUBJ (COND I IGETR OBJ) (GETR S-DO)I ((GETR SUBJ) IGETR S-SUBJ))I I . [ADOR COMPL (BUILDO ICCMP ICTYPE TO) »lll . ( AND IVFEATURE IGETR V) * TRANS) ISETR S-DO I CAR IGETR COMPL)))) (TO S-MAINCLAUSEI1 •S-HAINCLAUSE ITHE MAIN CLAUSE HAS BEEN IDENTIFIED. LOOK FOR A CONJUNCTION 10R THE END CF SENTENCE. (CAT CONJ T (SETR CONJ ») I TO S-CONJ)) (JUMP S-S T) TA CONJUNCTION HAS BEEN FOUND AFTER THE MAIN CLAUSE. LOOK IFOR THE CONJUNCIED PHRASE. ITHE- CONJUNCTEO PHRA4E-.-I5. A .C0MPLETE--.VER8 PHRASE. THE . 1MAIN CLAUSE IS AN ACTIVE SENTENCE WITH NO SUBJECT-VERB (INVERSION. ;E.G. HE PICKEO THE BLOCK UP AND PUT IT ON THE TABLE. (ANO INOT INEXT VI) (NOT (GETR PASSIVEFLAGII (NOT (EQUAL I GETR TYPE) M1MPMI INOT (GETR YESNO))) (SETR CONJ-V *) (TO S-CONJ-V-ACTIVE)I ITHE MAIN CLAUSE IS PASSIVE OR HAS SUBJECT-VERB INVERSION. •THE CONJUNCIED PHRASE IS A COMPLETE VERB PHRASE. IE.G. THE BOOK WAS PICKEO UP BY THE MAN ANO PUT ON THE TABLE. (AND INOT INEXT V)) (OR (GETR PASSIVEFLAG) (GETR YESNOI I (NOT (EQUAL (CETR TYPE! MIMPI)) ) (ANO ICOR SIRINGIIGETR OBJMHOLD (GETR OBJ))) (SETR CONJ-V •) (TO S-CONJ-V-PASSIVE)) •THE CONJUNCIED PHRASE IS A COMPLETE SENTENCE. (E.G. THE BOYS RAN AND THEIR FATHERS TALKED. (SETR S-CBNJ «) (TO S-SII IS-CONJ-V-ACTIVE ITHE MAIN CLAUSE IS AN ACTIVE DECLARATIVE.SENTENCE WITH NO (SUBJECT-VERB INVERSION. (PUSH S-V-SEMANTICS ISENOR DOWN ALL THE NECESSARY REGISTERS CONCERNING TENSE, TYP" ISUBJECT, ANO VERB INFORMATION. (NOT (NULL STRING)) • (SENDR SUBJ IGETR SUBJ)) ISENOR S-SUBJ IGETR S-SUBJI) 1 2 9 1101 ISENDR TYPE IGEIR TYPE)) 11CZ ISENDR NEC (GETR N E G I I 1IC3 (SENOR TENSE IGETR TENSE)) 11C* ISENDR ASPCCT IGETR ASPECT)) 11G5 (SENDR V (GETR C G N J - V I ) 11C6 ISENDR S-VERB (BUILOQ (V •) CONJ-Y)) 110? (SETR S-CONJ «) IIC3 (TO S-SI) 1109 II10 (JUMP S-CONJ-BUILO l l l l 1 U 2 1IF THE STRING IS NULL THE -PUSH" FAILS. THEREFORE ALL CONSTITUENTS 1113 IMUST BE PRESENT AT THIS LEVEL. U J * (E.G. THE HEN TALKED AND LAUGHED. (PROCEED TO S-CCNJ-&UILD TO CONSTRUCT THE PARSE. 1115 1115 1117 (NULL STRING!) 1118 I 1119 ) 120 1121 1S-C0NJ-V-PASSIVE 1122 1123 .THE HA IN CLAUSE HAS EITHER SUBJECT-VERB INVERSION OR A 112* [PASSIVE TRANSFORMATION. 1125 112* (PUSH S-V-SEMANTICS 1127 1126 iSENCR DOWN ALL THE NECESSARY REGISTERS CONCERNING SUBJECT. VERB, 1129 [TYPE, AND TRANSFORMATION INFORMATION 1130 1131 (NOT (NULL STRING)) 1132 ISENDR SUBJ IGETH SUBJ)) 1133 ISENDR S-SUBJ IGETR S-SUBJ)) 113* (SENDR TYPE (GETR TYPE)) 1115 (SENDR NEG IGETR NEG)) 113* (SENDR VOICE (GETR VOICE)) 1137 (SENDR TENSE (GETR TENSE)) 1138 (SENDR ASPECT (GETR ASPECT)1 1139 (SENDR V (GETR CCNJ-VII J1*0 (SENDR S-VERB (BU[LDQ (V »l CONJ-VI) 11*1 (SENOR PASSIVEFLAG (GETR PASS[VEFLAG)I 11*2 (SENOR AGFLAG IGETR PASSIVEFLAG)) 11*3 (SENOR S-00 (GETR S-DO)) 11** ISENDR YESNO (GETR YESNO)) 11*5 (SENDS AOvERBS (COND I(EQUAL (GETR TYPE) '(QADV))(GETR ADVERBS!Ill 11*6 ISETR S-CONJ »! 11*7 (TO S-S)) 11*8 11*9 (JUW-S-CCWJ--SUILO— 1150 1151 ;IF THE STRING IS NULL ThE "PUSH" FAILS. THEREFORE ALL CONSTITUENTS 1152 (MUST BE PRESENT AT THIS LEVEL-11SJ (E.G. THE BOOKS WERE PICKED UP AND TAKEN. 115* iPROCEEO TO S-BUILO-CONJ TO CONSTRUCT THE PARSE. • 1155 1156 (NULL STRING) 1157 ISEIR CONJ-PASSIVE T ) l u s e i 1159 1160 1161 1162 (S-CONJ-BUILO 1163 116* 1165 1166 1167 (JUMP S-S 1168 (S-SEHANTICS (GETR S-SUBJ) 1169 1171 J T H E CONSTITUENTS OF THE CONJUNCTED SENTENCE ARE A L L PRFSFNT AT n..< . L E V E L , SO CONSTRUCT THE PARSE . CHECK THE S O N A N T , ? " Z l ^ C E L T S - S . " I ? (GETR S-00) (BUILOQ (V .| CONJ-V) NIL) j ISETR S-CONJ (BUtLD-S-CCNJ)11 117* 1175 I S - S 1176 1177 17H1S IS THE FINAL STATE. CONSTRUCT THE PARSE ANO RETURN. 1178 1179 (POP (BUILO-SI 1180 (S-SEMANTICS IGETR S-SU8J) 1181 (GETR S-VERB) 1182 (GETR S-00) 1183 ' 4CETR S-INOOI!) 118* I I I B S 1186 1187 INF 1186 1189 ITHIS NETWORK RECOGNIZES NOUN-PHRASES. 1190 ITHIS STATE CHECKS FOR DETERMINERS, PRONOUNS. PROPER NOUNS, AND 1191 '.POSSESSIVE PRONOUNS AND PROPER NOUNS. DETERMINERS MAY BE MISSING. 1192 1193 (CAT GENPRO 119* 1195 ITHIS ARC IDENTIFIES CENERAL PRONOUNS SUCH AS 1196 {SOMETHING, ANYTHING ETC. 1197 1198 T 1199 ISETR PROPER IBUILDO ICENPRO »lll 130 12CO (SETR NU •SGI 1201 (SETR SEM-NOUN 1BUILD0 (GENPRO » ((NUMBER SGI1I11 1202 ILIFTR HEADNOUN IGETR SEM-NOUNII 1203 (TO NP-CENPROII 120* 1205 (CAT DET 12C6 1207 ;IF THE OETE'RMINER HAS FEATURE -OUANT-, THE QFLAG IS SET 12C3 ITO INDICATE THAT A PARTITIVE MAT FOLLOW. 1209 IE.G. SOME OF THE BOYS... 1210 • -1211 INOT (GETF POSSPROII 1212 (SETR DET »l 1213 (SETR SEH-CET ILIST 'DET * FEATURES!J 121* (SETR QFLAG IGETF QUANT!I 1215 I TO NP-DET! 1216 I 1217 1218 (CAT OET 1219 1220 iPROCESS POSSESSIVE PRONOUN DETERMINERS. 1221 iE.G. HIS BO0K....ThEIR DOG.... 1222 1223 (GETF POSSPROI 122* (SETR SEH-OET (BUILDO (POSS •!!! 1225 ISETR DET (BUILDO (3 (POSS (PRO ») (II FEATURES!1 1226 (TE NP-OETI 1227 I 1228 1229 ICAT NPR 1230 (CETF POSS) 1231 (SETR POSSFLAG T) 1232 ISEIR SEM-OET (BUILOQ IPOSS * l l l 1233 IAODR MODS (BUILDO (POSS (NPR •!! II 123* I TO NP-DETI 1235 I . 1236 ' 1237 (CAT PRO 1238 [NOT (GETF POSSPROII 1239 (SETR PROPER (BUILDO 13 IPRO ») f l FEATURES! I 12*0 (SETR SEM-NOUN (BUILOO 13 (PRO *) (»H FEATURES!) 12*1 (LIFTR HEADNOUN IGETR SEM-NOUNII ' 12*2 ISETR NU IGETF NUMBER!) 12*3 (SETR PRO Tl 12** (TO NP-NI 12*5 • ) 12*6 12*7 (CAT NPR 12*8 (NOT (GETF POSS!) 12*9 (SEIR PROPER (BUILOO 13 [NPR. •) t ) FEATURES) I 1250 ISEIR- SEM-NOUN. .(.BUILDO. O..INPR • ) IJI ) FEATURES!I 1251 (LIFTR HEAONOUN (GETR SEM-NOUNII 1252 (SETR NU -SG) 1253 ITO NP-N) 125* I . 1255 1256 (CAT OOEt / 1257 . 1258 .PROCESS QUESTION PRONOUN DETERMINERS SUCH AS "WHICH-, 1259 ("WHAT", ETC. SET THE SENTENCE TYPE TO "QOET". 1260 1261 T 1262 ISETR OET *) 1263 ISETR SEM-OET (BUILOO (QDET *311 126* (LIFTR WH-PHRASE T S) 1265 IMAPC •(LAMBDA (X) 1266 IAPPLY 'LIFTR (LIST • TYPE •MQOETI XII) 1267 MS S-OCL S-V S-V-NP S-PREOADJ-CCMP S-V-PREP-8Y S-V-PPI I 1265 ISETR QFLAG (GETF QUANT)) 1269 I1C NP-ORDII 1270 1271 ICAT PRO 1272 1273 .PROCESS INCOMPLETE NOUN PHRASES SUCH AS "OURS", "HERS"... 127* 1275 IGETF POSSPROI 1276 ISE7H SEM-DET (BUILDQ (POSS »))) 1277 (SETR DET (BUILOQ 13 (POSS (PRO •) 8)1 FEATURES)) 1278 (SETR N •ONES I 1279 (SCTR NU •SG-PLI 12»D . . ISETR SEM-NOUN • I DUMMY ONES NIDI 1281 (LIFTR HEADNOUN (GETR SEM-NOUN)l 1282 ITO NP-MAINPHRASEII 1283 i 128* IJUMP NP-OET 1285 T 1286 I 1287 I 1288 1289 . 1270 1291 INP-GENPRO 1292 1291 iTHIS STATE IDENTIFIES ADJECTIVES OCCURRING AFTER GENERAL 129* ;PRONOUNS. • 1295 iE.G. SOMETHING BLUE.. 1296 (PROCEED TO NP-N TO LOOK FOR POST-NOMINAL MODIFIERS. 1297 1298 1299 IPUSH' AOJP 1300 IOR IGET LEX •AOJItGET LEX 'ADVKGET LEX 'VI! I3CI 1302 1303 130* 13C5 1306 1307 1308 13C9 1310 1311 1312 1313 131* 1315 1316 1317 1318 1319 1320 1321 1322 1323 132* 1325 1326 1327 1328 1329 1330 1331 1332 1333 133* 1335 1336 1337 1338 1339 13*0 13*1 • 13*2 13*3 13** 13*3 13*6 13*7 13*8 13*9 1150 1351 1352 1353 135* 1355 1356 1357 1356 1359 1360 1361 1362 1363 136* 1365 1366 1367 1368 1369 1370 1371 1372 1371 137* 1J75 1376 1377 1378 1379 1380 1381 1382 1383 138* 1385 1386 1387 1388 1389 1390 1391 1392 1393 139* 1395 1396 1397 1398 1399 1*00 (AODR MOOS * l (TO NP-NI) (JUMP NP-N T) ITHE DETERMINER HAS BEEN IDENTIFIED. NOW LOOK FOR ORDINALS. (ORCINALS ARE WORDS SUCH AS FIRST, LAST, OR NEXT. THESE ALWAYS (OCCUR BEFORE THE ADJECTIVES ANO QUANTIFIERS I N THE NOUN PHRASE. ;E.C. THE FIRST LARGE eOOK... (ORDINALS HAY BE HISSING ICAT ORD ;LOOK FOR OROINALS SUCH AS F I R S T , L A S T E T C . T (AODR MODS IBUILDO IOR0 > l l l (SETR CRD Tl I TO NP-ORD)I (CAT ADJ •SUPERLATIVE ADJECTIVES MAY ACT AS OROINALS. -.E.G. THE D1GGEST RED BOOK... (GETF SUPERLSTIVEl (AODR MOOS IBUILOQ IOR0 IS ( A D J »l 8 1 1 FEATUXESII ISETR ORD Tl ITO NP-ORD)) (JUMP NP-ORO SOROINALS MAY BE MISSING. Tl I T H E OROINAL HAS BEEN I D E N T I F I E D . NOW LOOK FOR Q U A N T I F I E R S , (PUSH QUANTP IT-HE. Q U A N T I F I E R HAY- B E A MORE COMPLICATED STRUCTURE. ; E . E . AT LEAST F I V E OF THE BOYS.... •T ( S E T R QUANT T l (AODR MOOS ' I (SETR SEM-OET H i l l (TO N P - Q U A N T I I I J U M P NP-OUANV I T H E Q U A N T I F I E R MAY BE H I S S I N G . 71 ( J U MP NP-HAINPHRASE •THE NOUN PHRASE HAY BE INCOMPLETE- I F WE HAVE A (DETERMINER ANO AN ORDINAL OR A P O S S E S S I V E , (OR A Q U A N T I F I E R DETERMINER, TRY TO POP* ( E . G . G I V E ME THE B I C G E S T . I E . G . G I V E ME JOHN'S. ( E . G . G I V E ME SOME. (OR (AND IGETR OROI IGETR O E T I ) (GETR QFLAG) (GETR P 0 S S F L A 6 ) ) (SETR N 'ONES! ISETR N U 'SG-PL) ( S E T R SEM-NOUN '(DUMMY ONES N I L 1 1 ( L I F T R HEAONOUN (GETR SEM-NOUN)) (SETR NU 'SG-PLI I (NP-QUANT . ± ITHE QUANTIFIER HAS BEEN IDENTIFIED. LOOK FOR A PARTITIVE . {CONSTRUCTION AFTER A DETERMINER AND ORDINAL CR A (QUANTIFIER, OR PROCEED TO NP-PARI TO LOOX FOR ADJECTIVES. IWRD OF (LOOK FOR A PART IVE CONSTRUCTION AFTER A DETERMINER AND ORDINAL (OR A QUANTIFIER, OR A QUANTIFIER DETERMINER. (E.G. AT LEAST FIVE OF THE BOYS... IE.G. THE FIRST OF THE PARTIES... IE.C. SOME OF THE BOOKS... ICR (ANO (GETR OROI (GETR OETII IGETR QFLAG) 132 1*01 IGETK OUANTII 1*02 (10 NP-QUANT-PREP-GF)> 1*C3 1*0* (JUMP NP-0UANT-PREP"OF 1*05 1*04 ;IF THE QUANTIFIER DETERMINER IS "ALL" OR "BOTH" ANO 1*07 ' :N0 ORDINAL CP. QUANTIFIER IS PRESENT, THE "OF" IN THE 1*08 (PARTITIVE CONSTRUCTION HAY BE UMIITEO. 1*0? IE.G- ALL THESE BOYS.... 1*10 1*11 IANO INOT IGETR OROIIINOT IGETR OUANTI) 1*12 IGETR OFLAG) 1*13 I MEMO (GETR DET) MALL B0TH1II ) 1*1* 1*15 IJUMP NP-PART 1*16 1*17 STHERE IS NO PARTITIVE CONSTRUCTION. 1*18 1*19 INOT IEQ » 'OF)I) 1*20 1*21 IJUMP NP-MAINPHRASE 1*22 1*23 .THE NOUN PHRASE HAY BE INCOMPLETE. IF A QUANTIFIER 1*2* ICR A QUANTIFIER OEIERMINER. OR A DETERMINER AND AN ORDINAL, 1*25 ;0R A POSSESSIVE HAS BEEN FOUND, TRY TO POP. 1*26 ;E.G. GIVE H E AT LEAST FOUR. 1*27 1*28 (OR (GETR QUANT)(GETR QFLAG)IGETR POSSFLAGJ 1*29 (AND IGETR OROKGETR DET) I I 1*30 (SETR N 'ONES) 1*31 (SETR NU 'SG-PL) 1*32 I SETR SEM-NOUN '(DUMMY ONES NIL)I 1*33 (LIFTR HEADNOUN IGETR SEM-NOUN)) 1*3* ISETR NU 'SG-PLI) 1*35 > 1*36 1*37 1*38 INP-QUANT-PREP»OF 1*39 1**0 ;THIS STATE LOOKS FOR PARTITIVE CONSTRUCTIONS. 1**1 IE.G. SOME OF THOSE BOYS KHO TALKEO TO US YESTEROAY 1**2 (PROCEED TO NP-MA 1NPHRASE SINCE NOUN PHRASE IS COMPLETE. 1**3 1*** (PUSH NP 1**5 T 1**6 IADDR PP (BUILOQ (PP IPREP OF) •) I) 1**7 (SETR N 'ONES I 1**8 (SETR NU 'SG-PL) 1**9 ISETR SEM-NOUN •(DUMMY ONES NIL)) 1*50 .(LIFTR HEADNOUN (GETR SEM-NOUN)) 1*51 (SETR NU 'SG-PLI . 1*52 ITO NP-MATNPHRASE1) 1*53 ) 1*5* 1*55 1*56 INP-PART 1*57 1*53 STHE DETERMINER^ QUANTIFIERS. AND PARTITIVE CONSTRUCTIONS HAVE BEEN FOUND. 1*59 ITHIS STATE LOOKS FOR ADJECTIVES ANO ADJECTIVE PHRASES PRECEDING 1*60 STHE NOUN. 1*61 1*62 I CAT N 1*63 146* SA POSSESSIVE NOUN MAY MODIFY A NOUN. 1*65 SE.G. THE GIRL'S BOCK..... 1*66 1*67 (GETF POSSI 1*68 (ACOR HODS (BUILOQ (3 (POSS IN •) A)) FEATURES)) 1*69 (SETR OFLAG NIL) 1*70 ISETR ORO NIL) 1*71 (SETR POSSFLAG T) 1*72 ISETR OUANT NILI 1*73 ISETR SEM-OET NIL) 1*7* (SETR SEM-AOJS NIL) 1*75 (TO NP-DET) 1*76 I 1*77 1*78 (CAT N 1*79 1*80 SA NOUN HAS BEEN FOUND. ASSUME IT IS THE HEAD NOUN OF THE 1*81 SPHRASE. IF ANOTHER NOUN IS FGUND LATER, THIS ONE MUST 14E2 SHAVE BEEN ACTING AS AN ADJECTIVE, SO THE REGISTERS 1483 SARE REARRANGED. 1*8* 1*85 INOT IGETF^POSSII 1*86 ISETR N »l 1*8? (5ETR NFEAT FEATURES I 1*88 ISETR NU IGETF NUMBER)) • 1*89 (SETR SEM-NOUN (BUILOQ 13 IN »l ( I ) ) FEATURES)) 1*90 (LIFTR HEADNOUN (GETR SEM-N0UN1I 1*91 I.TC NP-ADJ) 1492 I 1493\ 1*9* '.' 1495 (PUSH AOJP 1*96 (CR (GET LEX '.ADJ I I GET LEX .'ADV) (GET LEX «V)> 1497 IACDR MODS »l 1498 IADDR SEM-ADJS (GEIR HEAOADJI | 149? ITO NP-PARTI 1 5 C 0 1 5 C I 1 5 0 2 1 5 0 3 1 5 0 4 1 5 0 5 15C6 1 5 0 7 1 5 0 8 15 0 9 1 5 1 0 1 5 1 1 1 5 1 2 1 5 1 3 15 14 1 5 1 5 1 5 1 6 1 5 1 7 1 5 1 8 1 5 1 9 1 5 2 0 1 5 2 1 1 5 2 2 1 5 2 3 1 5 2 4 1 5 2 5 1 5 2 6 1 5 2 7 1 5 2 8 1 5 2 9 1 5 3 0 1531 1 5 3 2 1533 1 5 3 4 1 5 3 5 1536 1 5 3 7 1538 15 39 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1571 1574 1575 . 1576 1577 1578 1579 1580 1581 1582 1581 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 • 5 9 7 1593 1599 1600 I N P - A C J • T H I S STATE LOOKS FOR THE MAIN NOUN I N THE PHRASE. I F A ISECONO NOUN I S ENCOUNTEREO, THE F I R S ! IS TREATED AS AN AOJECTIVEi •E.G. THE FLOOR POLISHER ICAT N :A P O S S E S S I V E NOUN HAS BEEN FOUND. ANY PREVIOUS NOUNS MUST HAVE ;BEEN ACTING AS A D J E C T I V E S , SO THE PARSE I S REARRANGED. ;E.G. THE TALL BOY'S F I R S T RED HAT..... JPRCCEED TO NP-DET TO LOOK FOR OROINALS, E T C . IGETF POSS) 1AODR PODS I B U I L D O I A D J ( 3 I N • ) » ( ) N N F E A T I I IACDR HODS I B U I L D O I P O S S 13 I N • > I I ) FEATURES 11 I S E T R OFLAG N I L I I S E T R ORD N I L I I S E T R POSSFLAC T> ISfcTR OUANT N I L ) ISETR SEH-OET N I L ) ISETR SEN-ADJS N I L ) ITO NP-OET) I ICAT N INOT IG E T F POSSII IADOR HODS (BUILOQ ( A O J 1 3 I N ») • ) ) N N F E A T I I I S E T R N •) IS E T R NFEAT FEATURES) ISETR NU (GETF NUMBER)) ( S E T R SEM-NOUN ( B U ( L D O ( 3 ( N •( (l)> FEATURES)) I L ( F T R HEADNOUN (GETR SEM-NOUNI) ITG N P - A D J ) 1 ICAT NPR (NCT I G E T F P 0 5 S I ) (AODR MOOS I B U I L D O I A D J ( 3 ( N •) » ) ) N N F E A T I ) ( S E T R NFEAT FEATURES) ( S E T R NPR •) (SET R NU '5G) (SET R SEM-NOUN ( B U I L D O 13 (NPR •) I D ) F E A T U R E S ) ) ( L I F T R HEAUNOUN (GETR SEM-NOUN)I (TO N P - A O J ) IJUMP NP-N T (NP-N • • ITHE HEAD NOUN HAS BEEN IDENTIFIED. LOOX FOR POST-NOMINAL MODIFIERS (PUSH PP IA PREPOSITIONAL PHRASE MAY MODIFY A NOUN. IE.G. THE BOY IN THE PARK... I G E T L E X 'PREP1 (SENOR MOTIONFLAG IGETR N0TI0NFLAGI1 (SENOR AGFLAG IGETR AGFLAG)) (AOOR PP *) (TO NP-MAINPHRASE)) (PUSH S-REL (LOOK FOR RELATIVE CLAUSES MODIFYING THE NOUN. RELATIVE ICLAUSES MUST START KITH A RELATIVE PRONOUN OR A PREPOSITION. IE.G. THE BOY WHO WAS GIVEN THE BOOK.... I THE HEAD NUUN IS SENDR-ED TO THE CLAUSE. (OR IGET LEX 'PREP) (GET LEX 'RELPROD (SENOR WH (COND ((GETR Nl (BUILOO (NP (OET WHI (N •) INU • ) ) N NU)) I(GETR PROPER) IBUILDO (NP (DET WHI • (NU »)) PROPER HUM I I ISENDR WH-HEAONOUN IGETR SEM-N0UN)1 (SENOR TYPE •(REL)) (AODR REL »l ITO NP-»AINPHRASE)) I JUMP NP-MAINPHRASE 1P0STN0MINAL MODIFIERS MAY BE MISSING. T l t PUSH S-REL-REOUCEO 5LASTLY LOOK FOR REDUCED RELATIVE CLAUSES. AVOIDS CONFUSION IWITH OTHER VERBS IN SENTENCE. 1601 • 1602 1603 160* 1605 16C6 1607 I6C8 1609 1610 1611 1612 1613 161* 1615 1616 1617 161S 1619 1620 1621 1622 1623 162* 1625 1626 1627 1628 1629 1630 1631 1632 1633 163* 16 35 1636 1637 1638 1639 16*0 16*1 16*2 16*3 16** 16*5 16*6 16*7 16*8 16*9 1650 1651 1652 1653 165* 1655 1656 1657 1658 1659 1660 1661 1662 1663 166* 1665 1666 1667 1668 1669 1670 1671 1672 1673 167* 1675 1676 1677 1678 1679 1680 1631 1682 1683 168* 16M 1686 1687 1688 1689 1690 1691 1692 1693 169* 1695 16 96 1697 1698 1699 17C0 iE.G. THE BOOK THE HAN GAVE... INOT IGETR PROD ISENDR WH ICOND IIGETR N) IBUROO INP (DET WHI IN *) (NU «ll N NU) 1 I IGETP. PROPER) IBU1LD9 I NP I DET WHI • (NU -»)) PROPER NUII ) ) ISENOR WH-HEADNOUN IGETR SEN-NOUNI) ISENOR TYPE M R E L l l (AODR REL *) (TO NP-«AINPHRA5E)) (NP-HAINPHRASE •THE HAIN NOUN PHRASE HAS BEEN FOUND. LOOK FOR A CONJUNCTION OR POP. ICAT CONJ SLOOK FOR ANOTHER NOUN PHRASE AFTER THE CONJUNCTION. IE.G. THE BOOKS AND THE PENCIL.... T ISETR CONJ ») (TO NP-CONJ)) IJUMP NP-NP T) INP-CONJ SA CONJUNCTION HAS BEEN FOUND. LOOK FOR ANOTHER NOUN PHRASE. IPUSH NP T (SENOR CONJFLAG T) (SETR NP-CONJ ») ICONO ((ATOM (CAOR (GETR HEADNOUN)1) (LIFTR HEADNOUN IBU1L0S (N (» • IMNUNBER t i l l SEK-NOUN HEADNOUN (COND ((EQ IGETR CONJ) •ANO) «PL) (•SO-PD) ))) IT (LIFTR HEADNOUN (LIST (CAR (GETR HEADNOUN)) (APPEN01 (CADR (GETR HEADNOUN))(GETR SEN-NOUN)) (CAOCR'(GETR HEADNCUN)))))) (TO NP-NP)) INP-NP ^ : F I N A L NOUN-PHRASE STATE (CONSTRUCT THE PARSE AND RETURN. I P O P ( B U I L O - N P I INP-SEMANTICS (GETR SEM-DETI (GETR SEH-ADJS) _ (GETR SEM-NOUN) I (ADJ JTHIS NETWORK IDENTIFIES ADJECTIVES. ' (MEM (MORE MOST) SLOOK FOR "MORE BEAUTIFUL" TYPE CONSTRUCTIONS. T (SETR FEAT (BUILOQ l ( # l l ICONP-SUPERI I) ITO ADJ-FEAT) I ."• '". . (CAT V i SPARTICIPLES MAY BE USED AS ADJECTIVES. . (PART(C(PLEI ISETR ADJ IBUILOQ I I *) (PARTICIPLE) )) ILIFTR HEAOAOJ (BUILOO (V • (• »)) (PARTI CIPLE11 NP-PART) IL1FTR HEAOAOJ (BUILOQ (V • (• " I I (PARTICIPLE)1 S-VI (TO ADJ-ADJ) I JUMP ADJ-FEAT T 1701 (ADJ-FEAT 1702 (CAT AOJ ' 170} T 17C* (SETR AOJ ») 17C5 ICR ICETR FEAT) ISETR FEAT FEATURES) ) 17C6 (LIFTR HEAOAOJ IBUILDO IADJ • l»l) FEAT) NP-PART) 1707 ILIFTR HEA CADJ IBUILDO IADJ • (•)) FEAT) S-V) 17CB ITO AOJ-ADJ) 1709 ) 1710 1 1711 1712 1713 (AOJ-AOJ 171* 1715 [CONSTRUCT AND RETURN PARSE. 1716 1717 (POP (BU(L00 (3 (ADJ •) •) ADJ FEAT) 1718 T 1719 I IT20 ) 1721 1722 1723 1724 (ADV 1725 1726 [THIS NETWORK IDENTIFIES ADVERBS. 1727 1728 tHEM (MORE MOST) 1729 1730 ILOOK FOR "MORE SLOWLY" TYPE CONSTRUCTIONS. 1731 1732 T 1733 ISETR FEAT (BUILDO ((»)) (COMP-SUPER) )) 173* (TO ADV-FEATI 1735 I 1736 1737 I JUMP AOV-FEAT 1738 T 1739 1 17*0 I 17*1 17*2 1743 IAOV-FEAT 17** ICAT ADV 1745 T 17*6 (SETR ADV •( 1747 (OR (GETR FEAT) (SETR FEAT FEATURES! I 17*8 (TO ADV-ADV) 1749- ) 1750 I 1751 1752 1753 (AOV-AOV 1754 1755 [CONSTRUCT PARSE ANO RETURN. 1756 1757 (POP (BUILDO (3 (AOV • ) >) AOV FEATI 1758 T 1759 I 1760 I 1761 1762 1763 176* . IADJP 1765 • 1766 ITHIS NETWORK IDENTIFIES ADJECTIVE PHRASES. 1767 IE.G. THE SUPRI SINGLY VERY OLD MAN... 1766 -1769 (PUSH AOJ 1770 1771 [FIND "MORE BEAUKFUL" CONSTRUCTIONS FIRST. 1772 1773 ICR (GET LEX 'ADJ)(GET LEX *V)(GET LEX 'ADV)) 177* ISETR AOJ •) 1775 (TO ADJP-ABJFli 1776 17 77 (PUSH ADV 1778 1779 ILOOK FOR ADVERBS 1780 1781 T 1782 IADOR AOV ».) 1783 (TO AOJP))" 178* 1T85 (JUMP AOJP-AOV 1786 T l 1787. I 1788 1789 1790 1A0JP-ACV 1791 1792 (PUSH AOJ 1793 T 179* (SETR ADJ «) 1795 (TO ADJP-AOJPI 1796 ) 1797 1 1798 leco 1801 1802 1803 ISO* laos .1306 1607 1808 18 09 1810 1811 1812 1813 181* 1813 1816 1817 1818 1819 1820 1821 1822 18 23 182* 1825 1826 1827 1828 1829 1830 1831 1832 1833 183* 1835 18 36 1837 1838 1839 18*0 18*1 18*2 18*3 18** 18*5 18*6 18*7 18*8 18*9 1850 1851 1852 1853 18 5* 1655 1856 IBS7 1853 1859 1 8 6 0 1861 1862 1863 196* 1865 1866 1867 1868 1869 1870 1871 1872 1873 187* 18 75 1876 1877 18 78 1879 1880 1881 1882 1883 188* 1885 1886 1887 laea 1889 1890 1891 1892 1893 189* 1895 1896 1897 1898 1899 19C0 IADJP-ACJP JCONSTRUCT ANO RETURN PARSE (POP (BUILD-AOJP) T . ) ;THIS NETWORK IDENTIFIES PREPOSITION PHRASES. IWRD BY ;IF THE PREPOSITION IS "8Y» AND IT IS NOT KNOWN WHETHER ITHE SENTENCE IS PASSIVE I I . E . THE PHHASE IS FRONTED) .SET THE 8YFLAG SO THE NOUN PHRASE CAN BE LIFTR-EO. IGETR FRONTED-AGFLAGI ISETR B YF LAG T) ITC PP-PREPI) (CAT PREP SIF THE SENTENCE (S PASSIVE AND THE PREPOSITION IS "8Y". •THEN THE AGENT OF THE SENTENCE HAY BE IN THE PHRASE. THE PHRASE IIS NCT PARSEO AS A PREPOSITION PHRASE. IIF THE PREPOSITION IS A MOTION PREPOSITION ANO THE NOTICNFLAG ;1S SET, THEN THE PHRASE IS NOT PARSED AT THIS LEVEL. •E.G. HE PUSHED HER INTO THE WATER. INOT IOR (AND IGETR AGFLAG) (EO • 'BY)) I AND (GETF MOTION) IGETR MOTIONFLAG)))) (SETR PREP *) (TO PP-PREP) (PP-PREP IF IND EITHER A NOUN PHRASE OR A QUESTION PRONOUN PHRASE AS •TH£ OBJECT OF THE PREPOSITION. IPUSH NP SLCCK' FOR- ft NP-AS THE-OBJECT OF THE PREPOSITION. IE.G. IN THE BOOK... T ISENOR AGFLAG (GETR AGFLAGI) ISENOR MOTIONFLAG IGETR MOTIONFLAG)) ISETR NP •) (COND ,||GETR BYFLAG) (LIFTR AGENT *I(LIFTR HEAOAG IGETR KEAONOUN)))) ITO PP-PP)) ' • -(PUSH CP ILOOK FOR A QUESTION PRONOUN PHRASE AS THE OBJECT IE.G. IN WHICH OF THE ROOMS.... IGET LEX •QPRO) (SETR NP *) IHAPC '(LAMBDA (XI IAPPLY 'LIFTR ILIST • TYPE "(OPRO) X I ) ) MS S-DCL S-V S-V-NP SrV-PREP'BY S-V-PPI) (LIFTR WH-PHJASE T SI ICONO I(CETR BYFLAG) (LIFTR AGENT »)(LIFTR HEAOAG (GETR HEAOOPROI))) (TO PP-PP)) ) (PP-PP ICONSTRUCT AND RETURN THE PARSE. IPOP (BUILOQ (PP (PREP •) •) PREP NP) T l STHIS NETWORK IDENTIFIES A QUESTION PRONOUN PHRASE. THIS ;CONSISTS OF A QUESTION PRONOUN FOLLOWED OPTIONALLY BY A IPREPCS1T1CN P H R A S E . SE.G; WHICH OF THE FUNCTIONS... SLOOK FIRST FOR A QUESTION PRONOUN. (CAT QPRO T (SETR QPRO ») (LIFTR HEAOQPRO (BUILOQ (QPRO • ) ) ) (TO QP-QPRO)I 1901 19C2 19C3 1904 19C5 19C6 19C7 19CB 19C9 19!0 1911 1«12 1913 1914 1915 1916 . 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 . 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 19 75 1976 1977 1978 1 9 7 0 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1 9 9 8 1999 2000 (QP-QPRO (A C U E S T I C H PRONOUN HAS BEEN FOUNO. ICO*. FOR AN OPTIONAL I P R E P G S I T I C N PHRASE BEFORE POPPING. U>-.IUN»L IPUSH P? IGET LEX 'PREPI (SETR op «| ITO 0P-0P1I (JUMP CP-OP I) (OP-QP (RETURN ThE GUEST ION PRONOUN PHRASE. (POP (EUILD-OPI XI I IQUANIP .THIS NETWORK RECOGNIZES OUANUFIER CONSTRUCTIONS. ICAT INTEGER ;TME QUANT IFIER HAY BE A NUMBER. (E.G. FIVE YELLOW BOOKS... T (SETR 0 (BUILDO I INTEGER •!)) ITO OUANTP-QI) (CAT QUANT •IDENTIFY QUANTIFIER WORDS SUCH AS SEVERAL, MANY, FEW. T (SETR 0 «l (TO OUANTP-QI) (JUMP QUANTP-0 (LOOK FOR EXPRESSIONS NOT PRECEDED BY A QUANTIFIER. (E.G. MORE THAN 6... Tl 1 (QUANTP-0 [WRD AT ILOOK FOR "AT" EXPRESSIONS. (E.G. FTVE AT LEAST... •E.G. AT LEAST FOUR... ITO OUANTP-PREP-AT)) (CAT CCMP ILOOK FOR COMPARATIVE EXPRESSIONS. IE.G. MORE THAN 5... IE.G. SEVERAL MORE... T ISETR COMP (BUILDO (AOV • ) ) ) (TO QUANTP-COMP)) I JUMP QUANTP-QUANTF • IIF A QUANTIFIER HAS BEEN FOUND. TRY TO POP. (GETR Ql ISETR QWORO Tl) (OUANTP-PREP-AT " ^ ^ T ^ ^ l ^ ^ ; ^ ^ «••» SUCH A S ' (CAT SUPER T (SETR SUPER ( B U I L O Q (AOV »))l I TO QUANTP-MODS)) (QUANTP-COMP 2001 {PROCESSING A COMPARATIVE 2002 2CC3 IWRD THAN 200* 2O0S iTHIS IS A "MORE THAN" TYPE EXPRESSION. 20C6 2007 T 20C8 ITO OUANTP-MODS)I 2009 2010 I JUMP OUANTP-OUANTP 2011 2012 • IA COMPARATIVE CONSTRUCTION HAS BEEN FOUND. 2013 iE.G. SEVERAL MORE.... FIVE FEWER..... 201* i l F THE WORD "MORE" HAS BEEN FOUND AND THE NEXT WORD 2015 ;IS AN ADJECTIVE. THE ADJECTIVE IS A COMPARATIVE 2016 iFORH , SO 00 NOT POP. 2017 iE.G. THE MORE BEAUTIFUL GIRLS... 2018 • 2019 ICOND 11 AND IGETR COMPI 2020 IEO ICAOR IGETR COMPII •MORE I 2021 IGET LEX •AOJ1 2022 IEO IGET LEX 'ADJI •»!> 2023 NILI 202* ' ( T i l 2025 ISETR DWORD. (NOT (AND (GETR COMPI(GETR 01)111 2026 1 2027 2028 2029 (OUANTP-MODS 2030 2031 iLOCX FOR THE MAIN QUANTIFIER. 2C32 2033 (CAT OET 203* 2035 ILOOX FOR A PRECEDING DETERMINER. THESE OCCUR IN EXPRESSIONS 2C36 iLIKE "MORE THAN A FEW*. 2037 2038 INOT (GETR DET1I • ' 2039 (SETR DET * l 20*0 (TO QUANTP-HODSII 20*1 20*2 (PUSH OUANTP • 20*3 ' 20** ".LOOK FOR THE MAIN QUANTIFIER CONSTRUCTION. 20*5 20*6 T 20*7 ISETR QUANT »l 20*8 ITO QUANTP-QUANTP)I 20*9 2050 IJUMP 6UANTP-0UANTP 2051 2052 PROCESSING A CONSTRUCTION LIKE "FIVE AT LEAST". TRY TO POP. 2053 205* (AND (GETR 01 (NOT (GETR COMPIII) 2055 I 2056 2057 2059 (QUANTP-OUANTP 2059. 2060 iENO OF QUANTIFIER NETWORK. CONSTRUCT PARSE ANO RETURN. 2061 2062 (PGP (BUILO-QUANTP) 2043 T) 206* ) 2065 2066 • '• . 2067 "END END CF FILE A P P E N D I X k - THE DICT IONARY 139 i 2 3 * 5 6 7 e 9 10 II 12 13 1* 13 16 17 • IB 19 20 21 22 23 2* 25 26 27 28 29 30 31 32 33 3* . 35 36 37 38 39 •0 41 42 43 44 43 46 47 48 49 50 31 52 S3 5* 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 17 78 79 80 81 I THE DICTICNARV (THE OET I THE (NUMBER SG-PL))) (E*CH DET (EACH (NUMBER SG) (OUANT)1) (EVERY DET (EVERY (NUMBER SG) 1 QUANT))) (A DEI (A (NUMBER SGI II ( AN DET IA (NUMBER SG))) (THESE DET 1 THIS (NUMBER PLI1 PRO ITHIS (SUBJ) (OBJ)(NUMBER PLIIPNCOOE 3PL) )) (THOSE DET (THAT I NUMBER PL)) PRO (THAT (SUflJI (OBJKPNCOOE 3 ? l ) (NUMBER PL) II (THIS OET ITHIS (NUMBER SGII PRC (THIS (SUBJ) IOBJHPNCODE 3SG) (NUMBER SG) )) (THAT DET (THAT (NUMBER SGI) PRC (THAT (SUBJ) IPNCODE 3SG) (OBJ) INUM9ER SG) ) RELPRO • 1 I ALL DET (ALL (NUMBER PLI (OUANT)II (ANY OET (ANY (NUMBER SG-PL) (QUANT)I) (NO DET (NO (NUMBER SG-PLI)) ( SOHE DET (SOME (NUMBER SG-PL) 1 QUANT I)) (BOTH DET (BOTH 1 NUMBER PL I (OUANT))) (FEW OUANT IFEW [NUMBER PLI I ) (NONE OUANT (NONE I NUMBER SC-PLDI [MANY OUANT (MANY I NUMBER PL))) (SEVERAL QUANT [SEVERAL (NUMBER PL))) (COZEN QUANT -• ID02EN (NUMBER PLI)) (WHEN OADV * l (WHERE QADV ») (WHY QADV *) (HOW OADV • I [WHAT QDET * QPRO * RELPRO • ) (WHICH QDET • OPRO • RELPRO • I (WHOSE OOET * RELPRO » OPRO •) (WHO OPRO IWHO (SUBJ)) RELPRO «) (WHOM QPRO (WHO (OBJ)) RELPRO *) 1 HOW-MA NY . OPRO 3 GDET IHOH- MANY (QUANT))) (HOW—MUCH QPRO * SOET IHOW-MUCH (QUANT))) II PRO I I (NUMBER SG)ISUBJI(PNCOOE 1SG)I N-TYPE (ANIMATE) ) (YOU PRO IYOU ISUBJ) (06J! I NUMBER SG-PL)(PNCOOE 25GPL11 N-TYPE (ANIMATE) 1 (HE PRC 1 HE t NUMBER SGKSUBJl(PNCCOE 3SG1I N-TYPE (ANIMATE I I (SHE PRC ISHE (NUMBER ,SG)(SUBJ)IPNCODE 3SG)I N-TYPE IANIMATE) I (WE PRO IWE (SUBJI I NUMBER PL) (PNCCOE 1PLI) N—TYPE (ANIMATE) ) (THEY PRO (THEY 1 NUMBER PL I(SUBJ1(PNCCOE JPL) )> • (IT PRO (IT 15U0J1 IOBJI I NUMBER SGItPNCCDE 3SG) )) (US PRC (WE IDBJ) I NUMBER PL) (PNCOOE IPLI )) (ME PRO II IOBJI (NUMBER SGIIPNCOOE ISG) )) (HIM PRO (HE IOBJI I NUMBER SGIIPNCOOE 3SG) )) (THEN PRC ( T H E Y IOBJI | NUMBER PLXPNCOOE 3PL) )) (HIS PRO • (HE (POSSPROI) OET (HE (POSSPRO))) I HER PRO (SHE (OBJ) (NUMBER SG) IPNCODE 3SG)) DET (SHE (POSSPROI)) (THEIR OET (THEY (POSSPRO!)) (OUR OET (WE (POSSPROI)) (YOUR DET (YOU (POSSPROII) (ITS PRC I IT (POSSPRO)) OET (IT (POSSPRO))) (MY DET (I IPOSSPRODI (MINE PRO (I (POSSPROI)I (YOURS PRO IYOU (POSSPROI)) ( H f c H S P R O (SHE I P U S b P R U ) ) ) IOURS PRC IWE (POSSPRO))) (THEIRS PRO [THEY (POSSPROII) 82 (IN PREP • 1 83 (TO PREP (TO (MOTION))) 84 ( INTO PREP UNTO. (HOTION) 1) 85 (BY PREP • 1. * • • 86 (FOR PREP • 1 87 (AS PREP • 1 88 (FROM PREP * l 89 I AT PREP •1 90 (CF PREP ») 91 (NEAR PREP • ) 92 (OVER PREP • ) 93 (UNDER PREP • I 94 (LP PREP • ) 95 (WITH PREP • I 96 ION PREP ») 97 (ONTO PREP ICNTO (MOTION!)) 98 (APART PREP ••) 99 (CUT PREP «) lco (DOWN PREP «) 140 101 (AWAY P»E P »i 102 ( O N - r c P - 0 F P K 6 P •) IC.3 ( TO-THE-RIGHT-OF PREP •) 1 C ( T O - T H E - L E F T - O F PREP •! 1C5 I C 6 1 0 ? (AND C C N J »1 I C S ICR CONJ « ) 1 0 ? 1 1 0 (THAN COHPUORD « ) 1 1 1 1 1 2 1 1 3 (HAN N IRR h-TTPE [ A N ( M A T E ) I I K I WDM AN N IRR N-TYPE ( A N I M A T E ) I 1 1 5 (WOMEN N (WOMAN (NUMBER P L ) ) ) 1 1 1 ( E X P R N S) U T [ F E X P R N S> 1 1 8 (MEN N (MAN (NUMBER P C ) ) ) 1 1 9 (BOY N S N-TYPE ( A N I M A T E ) ) 120 - ( B A L L N S N-TYPE ( P H Y S O B J ) ) 1 2 1 ( G I R L N S N-TYPE ( A N I M A T E ) ) 122- (WATER N MASS) 1 2 3 ( T R E E N S N-TYPE I P H Y S O B J ) I 1 2 * I FUNCTION N S) 125 I L I S T N S V S-EDI 126 IA T CM N S ) 127 (NAME N S) 1 2 B (NUMBER N S ) 1 2 9 (ARGUMENT N S> 1 3 0 (PORA-ETER N S) 131 (ELEMENT N S) 1 3 2 ( V A L U E N . S) 1 3 3 (ROOK N S N-TYPE ( P H Y S O B J ) ) 1 3 * ( T A B L E N S N-TYPE ( P H Y S O B J ) ) 1 3 5 ( P A R T Y N S N-TYPE ( E V E N T ) ) 1 3 6 (PARK N S N-TYPE ( P L A C E P H Y S O B J ) I 1 3 7 (ONE N S 138 INTEGER »l 1 3 9 ( S I S T E R N S N-TYPE I A N I M A T E ) ) 1*9 IBROTT-ER N S N-TYPE I AN 1 MATE ) ) 1*1 ( S I S T E R S ' N ( S I S T E R I NUMBER P L ) ( P O S S ) I ) 1*2 (BROTHERS' N (BROTHER (NUMBER P L ) ( P O S S ) ) ) 1*3 ( P E N C I L N S N-TYPE ( P H Y S O B J ! ) 1** IOOG N 5 N-TYPE ( A N I M A T E ) ) 1*5 ( B L O C K N S N-TYPE I P H Y S O B J I ) 1*6 (PYRAMID N S N-TYPE ( P H Y S O B J ! ) 1*7 ( C U B E N S N-TYPE I P H Y S O B J ) ) ' 1*8 I 8 3 X h ES N-TYPE I P H Y S O B J ) ) 1*9 ( I N K N MASS N-TYPE ( P H Y S O B J I I 1 5 0 ICOVER N S N-TYPE ( P H Y S O B J 1 1 1 5 1 ( F R I E N D N S N-TYPE (ANIMATE!1 1 5 2 ( S T R E A M N S N-TYPE I P H Y S O B J ) ) 1 5 3 15* 1 5 5 1 5 6 1 5 7 1 5 8 1 5 9 1 6 0 161 ( F L Y N IRR V IRR FEATURES (TRANS INTRANS P A S S I V E ) I 1 6 2 ( F L I E S V ( F L Y ( T N S PRESENT) (PNCODE 3SG) ) N (FLY (NUMBER PLI I I 1 6 3 ( F L Y I N G V ( F L Y ( P R E S P A R T ) I I 1 6 * (FLEW V ( F L Y ( T N S P A S T ) ) ) 165 (FLOWN V ( F L Y ( P A S T P A R T ) ) ) 166 ( B E V ( B E (UNTENSEO!) FEATURES (COPULA AUXI I 1 6 7 I I S V ( B E (TN S PRESENT! (PNCODE 3SG1 I ) 166 (AM V (BE ITNS PRESENT! IPNCODE 1SGI ) l 1 6 9 ( A R E V I B E I T N S PRESENT) (PNCODE X 1 3 S G ) I ) 170 (WAS V I B E I T N S P A S T ! (PNCODE 1 3 S G I II 1 7 1 (WERE V (BE ( I N S P A S T ! (PNCOOE X 1 3 S S I I ) 172 ( B E I N G V ( B E ( P R E S P A R T ! I ) 173 ( B E E N V I BE ( P A S T P A R T ) ) ) 17* (KICK V 5 - E O SUaj-TYPE I ANIMATE) DO-TYPE ( P H Y S O B J A N I M A T E D 1 7 5 IGET V IRR FEATURES (TRANS I N O O B J COPULA P A S S I V E I I 176 ( G E T S V IGET ITNS PRESENT) (PNCODE 3SCI ) ) 177 (GST V IGET ITNS PA5T1 ) l 178 ( G E T T I N G V (GET (PRESPART) I! 179 1G0TTEN V (GET ( P A S T P A R T ! ) ) 1 8 0 (•AVE V IRR FEATURES ( I R A N S P A S S I V E A U X I ) l t l tHJS V (HAVE (TNS P R E S E N I I IPNCOOE 3 S G I ) ) 182 (HAtJ V (HAVE ITNS PAST! ( P A S T P A R T ) I ) 183 ( H A V I N G V (HAVE ( P R E S P A R T ! I I 18* (TALK V S-EO FEATURES ( I N T R A N S ) S U B J - T Y P E ( A N I M A T E ) I 185 ( C A L L V S - E O I 186 ( G I V E V IRR FEATURES (TRANS INDODJ P A S S I V E ) 1 8 7 S U B J - T Y P E (ANIMATE) DO-TYPE ( P H Y S O B J ANIMATE) I N D O - I Y P E ( A N I M A T E ) ) 188 I C I V E S V I G I V E I T N S PRESENT) (PNCODE 3 5 G I D 1 8 9 (GAVE V ( G I V E (TNS P A S T I ) I 1 9 0 I G W E N V ( G I V E ( P A S T P A R T ! ) I 191 ( G I V I N G V I G I V E I P R E 5 P A R T 1 1 I 1 9 2 ( P R I N T V S-EO OO-TYPE I P H Y S O B J I I 1 9 3 IWANT V S-ED FEATURES I T R A N S I I 1 9 * IMOPE V S-0 FEATURES (THAT INTRANS) S U B J - T Y P E ( A N I M A T E ) 1 9 5 N S I 1 9 6 ( U S E V S-0) 1 9 7 ( T A K E V IRR F E A T U R E S ( T R A N S P A S S I V E INDOBJ ) 1 9 8 P A R T I C L E S ( ( U P T A K E - U P ! ( O U T TAKE-OUT) 1 9 9 I APART T A K E - A P A R T I I O V E R T A K E - O V E R ) ) ) 2 0 0 ( T A K E S V (TAKE ( T N S PRESENT) (PNCODE 3 S G I I I ( JOHN NPR • ) IMARY NPR * l ( S I D NPR * l ( P A R I S NPR • ) Ihl 201 2C2 203 2C* 2C5 20b 207 2C8 2C9 210 211 212 213 21* 215 216 217 2IB 219 220 221 222 223 22* 225 226 227 229-229 230 231 232 233 23* 235 236 2 37 233 239 2*0 2*1 2*2 2*3 2** 2*5 2*6 2*7 2*8 2*9 250 251 252 Z53 25* 235 256. 257 258 259 260 261 262 263 26* 263 266 26? 768 269 2 70 271 272 273 27* 275 276 277 278 279 280 281 282 283 28* 285 286 287 288 289 290 291 292 293 29* 295 296 29? 298 299 (TOOK V I TAKE ( T N S PA ST 1!! ( TAKEN V (TAKE ( P A S T P A R T I I I ( T A K I N G V 1 TAKE I P R E S P A R T I I I (TAKE-UP V IRR1 I TAKE-OUT V IRRI (TAKE-APART V |RRI (TAKE-OVER V I R R I (RUN V IRUN (PNCODE X 3 S G I I UNTENSEO I I P A S T P A R T M T N S FEATURES (TRANS INTRANS P A S S I V E I S U B J - T Y P E (RUNS V 1 RUN (TNS PRE SEN T1 (PNCODE 3 S C I 1 I ( RAN V (RUN ITNS P A S T ) I I (RUNNING V (RUN I P R E S P A R T I I ) ( 0 0 V IKR FEATURES I TRANS P A S S I V E A U X I I I D C E S V (DO ( I N S PRESENT) (PNCOOE 3 S G ) ) ) ( 0 1 0 V ( 0 0 (TNS P A S T ) 1 1 1 DONE V (DO I P A S T P A R D I I ( D O I N G V 100 ( P R E S P A R T ) I ) ( E X E C U T E V S-0) (E V A L U A T E V S-D) (KNOW V IRR FEATURES I T S A N 5 P A S S I V E THAT) SUBJ-TYPE IKNOHS V IKNOW I T N S PRESENT) (PNCOOE 3 S G I I ) IXNEW V IKNOW ITNS P A S T ) 1 ) ' 1 KNOWN V 1 KNOW ( P A S T P A R T I I I * (KNOWING V (KNOW I P R E S P A R T I I I ( L O S E V IRR S U B J - T Y P 6 ( A N I M A T E D ( L O S E S V I L O S E I T N S PRESENT) (PNCCOE 3 S O I I (LOST V - ( L O S E ( T N S P A S T I I P A S T P A R T 1 ) ) ( L O S I N G V (LOSE I P K E S P A R T D I ( W I L L V (W I L L t TNS PRESENT 1(PNCDCE ANY!) FEATURES ( A U X I I ( S M A L L V ( S H A L L (TNS PRESENT!(PNCCOE ANY!1 FEATURES ( A U X I I ( P I C K V S -ED S U B J - T Y P E ( A N I M A T E ) PARTICLES ((APART P[CK-APART)(OUT PICK-OUT) (OVER PICK-OVERIIU? PICK-UP))) (PICK-APART V S-ED SUBJ-TYPE I AN I MATE)) (PICK-OUT V S-EO SUBJ-TYPE (ANIMATE)) .' ':' (PICK-OVER V S-EO SUBJ-TYPE (ANIMATED IPICK-UP V S-EO SUBJ-TYPE (ANIMATE)) IPUT V (PUT (PNCODE ANY)(UNTENSEOIITNS PAST)IPASTPART)) PARTICLES ((DOWN PUI-OOWNIION PUT-ON) (AWAY PUT-AWAVXOUT PUT-OUT) ) SUBJ-TYPE (ANIMATE) . V-SEMANTICS (OR (GETR PREPPHRASES) (GETR ADVERBS)) FEATURES (TRANS PASS(VE)) (PUT (TNS PRESENT) (PNCCOE 3SGDI IPRESPART))) SUBJ-IYPE I AN I MATE I I SUBJ-TYPE IANIMATEII SUBJ-TYPE lANI'ATEII SUBJ-TYPE (ANIMATED SUM-TYPE-- (ANIMATE): FEATURES I TRANS INTRANS THAT PASSIVE)! (PUTS V IPUTTING V (PUT-COWN V IPUT-ON V (P'JT-AWAY V (PUT-CUT V (BELIEVE V (CAN V (MUST V (MAY V (MIGHT • V (COULO V (SHOULD V (WOULD V (COME V (COMES V (CAME V (COMING V (SEE V IRR (SEES V • SEE (SAW. V ISEE (SEEN V (SEE 1 SEEING V (SEl (PUT IRR IRR IRR IRR S-EO FEATURES (AUX H O O A D I FEATUP.ES I AUX MODAL) ) FEATURES (AUX MODAL)) FEATURES (AUX MODAL!) FEATURES IAUX MODAL)) FEATURES IAUX H O D A L I I FEATURES I A U X MODAL I ) ICAN ITNS PRESENT) (PNCOOE ANY)) (MUST (TNS PRESENT! IPNCODE ANY!! (MAY (TNS PRESENT) (PNCODE ANY)) (MIGHT (TNS PRESENT) (PNCCOE ANY)! (COULD VTNS PRESENT! IPNCCDE ANY I 1 (SHOULD (TNS PRESENT) (PNCODE ANY 11 IWOULO ITNS PRESENT! IPNCODE ANY! I ICCME ITNS PRESENT)(PNCODE X3SG)1UNTENSEO11PASTPART!) FEATURES IINTRANS!1 (COME (PNCODE 3SG1 (TNS PRESENTIII (COME (TNS PAST I}) ICCME IPRESPARTIII FEATURES I TRANS PASSIVE THAT) SUBJ-TYPE I ANIMATE!I ITNS PRESENT)-IPNCODE 3SGIII' ITNS PASTIII (PASTPART))) EE i PMESPAfcl))) IBIG ADJ ER-ESTI I BLUE ADJ R-ST) (YOUNG AOJ ER-ESTI (WET AOJ ER-ESTI (BEAUTIFUL ADJ •! I SHORT AOJ ER-ESTI (SMALL AOJ ER-EST) I RED AOJ ER-EST IGOOO AOJ •> (BETTER AOJ IGOOD (COMPARATIVE) (BEST ADJ (GOOD (SUPERLATIVE! IOL0 ADJ ER-EST) (FAT AOJ ER-EST AQJ-TVPE (PHYSOOJ ANIMATE)) AOJ-TYPE•(PHY50BJ ANIMATE)). I) )) (RECURSIVE AOJ • I (NEW AOJ ER-ESTI (HAPPY AOJ ER-ES7I -(ANGRY AOJ ER-EST) (FAST AOV ER-EST AOJ ER-ESTI (EARLY AOV ER-EST AOJ ER-EST) (LESS ADV • CCMP • I (LEAST ADV » SUPER »l (FEWER COMP • I • -(VERY ADV • ) (SUPRISINGLY AOV ») (MUCH AOV • ) 3C0 (MORE AOV • }C1 COHP »» 30? (MOST AOV . » 303 SUPER » 30* QUANT (HOST INUHBER PLI)) 305 (FAR AOV * l . 3CA (FURTHUR ADV (FAR [COMPARAT[VE) I I 307 (FURTHEST ADV (FAR (SUPERLATIVE) I) 3CB (RECURSIVELY ADV (RECURSIVE NIL)) 3C9 (WELL AOV •) 310 (PLEASE ADV •) 311 312 313 (SOMETHING GENPRO •) 31* (ANYTHING GENPRO *) 315 (NOTHING GENPRO ») 316 (EVERYTHING GENPRO •) 317 318 319 120 321 322 323 32* 325 326 327 328 329 330 351 312 333 33* 335 INOT NEG *) 3 3 6 L 317 (ISN'T SUBSTITUTE I I S NOT)) 338 (AREN'T SUBSTHUTE (ARE NOT)) 339 (WASN'T • SUBSTITUTE I WAS NOT II 1*0 (WEREN'T SUBSTITUTE (WERE NOTI) 3*1 (HASN'T SUBSTITUTE (HASNOTII 3*2 (HADN'T SUBSTITUTE (HAD NOT)) 3*3 (HAVEN'T SUBSTITUTE (HAVE NOTI I 3** (CCN'T SUBSTITUTE (DO NOT)) J*S (DOESN'T SUBSTITUTE (DOES NOTII J46 (DIDN'T SunSTITUTE (010 NOTII J*7 (WON'T SUBSTITUTE (WILL NOTI) J*B ISHANT SUBSTITUTE (SHALL NOT)) 349 (SHAN'T SUBSTITUTE (SHALL NOTII 350 ICAN'T SUBSTITUTE (CAN NOT 11 551 ICANNCT SUBSTITUTE ICAN NOTII 352 (MUSTN'T SUBST[TUTE (MUSI NOT)) 353 (COULCN'T . SUBSTITUTE (COULD NOT)I 354 (WOULDN'T SUBSTITUTE (WOULD NODI 355 (SHOULON'T SUBSi(TUTE (SHGULO NOTII * 356 (MIGHTN'T SUBSTITUTE IHIGHT NOTII 157 158 (CN COMPOUND (((CN TOP OF) ON-TOP-OFIII 159 (TO COMPOUND • (((TO THE R[GHT OF) IO-THE-RIGHT-OF) 560 (ITO THE LEFT OF) TO-THE-LEFT-OF)I) 161 IHOW COMPOUND (((HOW MANY) HCW-MANYI 162 ((HOW MUCH) HOW-MUCHIII 161 16* •END * INO CF FI L E (FIRST - . ORD • AOV *> 1 SECOND ORO * ADV • 1 (THIRD ORO - • ADV • 1 (NEXT ORO » ADV •) (LAST ORO • AOV • 1 (TWO INTEGER • 1 (THREE INTEGER *| (FOUR • INTEGER *) (FIVE INTEGER • ) A P P E N D I X 5 - MORPH T A B L E 143 1 ; THE MORPH TABLE 2 3 4 1 5 I IS "•») 6 INIL N T (POSS)) 7 (NIL NPR T IPOSS)) I 8 I IS I 9 INIL N (NTVPE S) (NUMBER PLI) 10 (NIL V (OR (VBTYPE S-EO) IVBTYPE S-D)> (TNS PRESENT) 11 (PNCODE 3SGI) I 12 ( (S E I) ' 13 ( (Y) N (NTYPE ES) (NUMBER PL)) I* ( IY) V (VBTYPE ES-EO) (TNS PRESENT) IPNCODE 3SG)I I 15 1 (S E V) 16 I IE F( N (NTYPE S) (NUMBER PL)) 17 ( ( F ) N (NTYPE ES) (NUMBER PL)) 1 18 I (5 E l 19 (NIL N (NTYPE ES) (NUMBER PL)) 20 (NIL V (VBTYPE ES-EO) ITNS PRESENT) IPNCODE 3SG)I ) 21 I IG N I *) 22 (NIL V T (PRESPART)) 23 ( (E) V T (PRESPART)) ( 24 ( (0) 25 I N K V (VBTYPE S-0) (TNS PAST) (PASTPART)) » 26 I ID E *> 27 (NIL V IDR IVBTYPE S-ED) (VBTYPE ES-EO)) ITNS PASTI 28 (PASTPART)) ) 29 I ID E I) 30 .( (Y) V (VBTYPE ES-EO) (TNS PAST] (PASTPART)) ) 31 I (Rl 32 (NIL ADJ (AOJTYPE'R-STI (COMPARATIVE)) 33 (NIL ADV (ADVTYPE R-STI ICCMPARATIVEI) ) 34 ( IR E •> 35 INIL ADJ IAOJTYPE ER-EST) ICOHPARATIVEI) 36 (NIL ADV (ADVTYPE ER-EST) (COMPARATIVE)) ) 37 I 1R E I) j 3S I (Y) ADJ IADJTYPE ER-ESTI IC0MPARAT1VE)I 39 ( (Y) AOV (ADVTYPE ER-EST) (COMPARATIVE)) ) 40 I IT S) 41 INIL ADJ IADJTYPE R-STI ISUPERLATIVE1I 42 INIL ADV IADVTYPE R-ST) ISUPERLATIVEI) ) 43 I IT S E ») 44 INIL ADJ IADJTYPE ER-ESTI (SUPERLATIVE)) 45 (NIL AOV (AOVTYPE ER-ESTI ISUPERLATIVEI) I 46 I ( T S E I 1 47 I (Y) ADJ (AOJTYPE ER-EST) (SUPERLATIVE I) 48 I IYI ADV IADVTYPE ER-EST) (SUPERLATIVE)) I 49 I END CF FILE A P P E N D I X 6 - THE PREPASS ROUTINES 1 : THE SYSTEM INITIALLIZATION ROUTINES 2 3 (OEFUN ItNCPRINTJI I) (REPEAT •IEVAL (REAO)I 10001 I A 5 (tSNOPRIHTtJ) 6 -7 ISTATUS (<.7 01 ) 8 9 (OEFUN ItPRINTII (I (UNEVAL •SJNOPRINTIA "'-PRINT ON"I ) 10 11 1OEFUN REAO-DICT (FILE) IPROC (ENTRY) 12 ; THIS ROUTINE READS THE DICTIONARY INTO MEMORY 13 I EVAL ILIST 'OPEN ILIST • ROR 255 F I L E D ) I * LCOP ISETO ENTRY IREAD ROR)) 15 (CONO 14 ((ATOM ENTRY) (CONO ((EQ F(LE ••SOURCE*)) . IT ((EOF ROR)) ) 18 (RETURN '-DICTIONARY READ")I 19 ) 20 (ENTERDICT (CAR ENTRY) ICDR ENTRY)) 21 IGO LOOP) 22 ) I 23 2* 25 (DEFUN READ-GRAMMAR [F(LE> (PROG (INPUT) 24 1 THIS ROUTINE READS THE GRAMMAR INTO MEMORY 27 I EVAL (LIST • OPEN ILIST "ROR 255 F I L E D ) 28 LCOP ICCND 29 KATOM (SETO INPUT (READ RDM I) ) (CCNO 30 IIEQ FILE ••SOURCE*)I . , 31 IICCF RORD I 32 (RETURN •"GRAMMAR READ")) 33 ) 3* (PUT (CAR INPUT) 'GRAMMAR (COR INPUT)). 35 (GO LOOP) 36 )) 37 . . 3a (DEFUN READ-MTABLE (FILE) 39 I THIS ROUTINE READS THE MORPH TABLE INTO MEMORY 40 (EVAL (LIST 'OPEN (LIST 'ROR 255 F I L E D ) 41 (SETO MCRPHTABLE (READ RDR)) (COND ((EQ FILE '*SOURCE*ll 42 11 EOF RDR)1 1 43 .'"MGRPHTABLE READ" 4* I 45 46 47 ? -48 (DEFUN P FEXPR (LI 49 ; THIS ROUTINE CALLS PREPASS AND INVOKES 7HE PARSER 50 (PROG (SENT! 51 (ST1ME) 52 (CONO ((SETO SENT (PREPASS (CAR L ) ) ) 53 IPRINI (CAR L l l 54 (PR[NTL PREPASS TIME - I(ETIME)) MSI 55 (PRINT SENT) 36 ISTIMEI 5T (PRINT (EVAL (LIST • PARSE SENT ICAOR L I D I . ' .55 IPRINTL PARSE TIME - KETIMEI) MS)I 59 ((PR1NTL PREPASS FAILURE)) 60 )) 1 61 62 63 (DEFUN PARSER FEXPR (L) 6* (EVAL (LIST 'P (CAR L) «S)I) 65 66 67 (DEFUN INIT () • 68 ; THIS ROUTINE INITIALIZES THE SYSTEM TABLES 69 (VERBOS NIL) TO (REAO-DICT •JEJ:0ICTI0NARY) T l IREAO-MTABLE «JEJ:MORPH) 72 (READ-GRAMMAR •JEJ:GRAMMAR)) 73 74 75 I 7HE PREPASS ROUTINES 76 77 (DEFUN PREPASS (.SENTENCE) .78 (PROG INEWSENT COMPI 79 (SfcTO NEHSENT (LIST •STAtfT)) 80 LOOP ISETO NEWSENT • I 1APPEN0 NEHSENT •2 .. (COND 83 " IISETO COMP (FINO-COMPOUNO)) (CHECKUORO COMPII •». ((CHECKUORO (CAR SENTENCE) )) 65 ((RETURN NIL)) ) 86 I 87 ! E8 ICCNO 89 (ISETO SENTENCE ICOR SENTENCE )) (GO LOOP) ) I 90 (RETURN ICOR NEWSENTII 91 I ) 92 93 . 94- IOEFUN CHECKWCRD (WORDMPROG IVAL L NEM U) 95 (SETQ VAL (COND 96 ((SETQ H (GET WORD 'SUBST(TUTEI) 97 ICONO KAIOM W) ICHECKUOflO WD 98 IT IMAPCAN 'CHECKWORO WD) I 99 ((GET WORD 'OICTI WCRDI ICO (IMJMBERP WORD I (SUBNUM3ER WORO) I H5 I C l KNOT (ATOM W0RO11 (SUBLlST WOKO II 102 (( MENQ (CAR (SETO L (EXPLODE WCRDI I) '(3 t l I IOJ . (SPECIAL (CAR LI (IKPLOOE ICOR L l l l IC+ I 105 IIH0RPH7 WORD)I 1C6 I I 1CT (RETURN (COND ' -108 (I NULL VALI (NOTFOUND WOROI ) IC9 [(ATOM VAL1 (LIST VAL) ) 110 IVAL) 111 )> 112 11 113 11* 115 (DEFUN FIND-CQMPOUNDII 116 (PRCG (ENIKYLFOUND) 117 (CCNO KNOT (SEIO ENTRVL (GET (CAR SENTENCE) "COMPOUND!!! 118 (RETURN NIC)) 119 (T (MAPC MLAHSOA (ENTRY) ' 120 (COND ((LESSP (LENGTH SENTENCE)(LENGTH (CAR ENTRY)))) 121 ((EQUAL (NTH (REVERSE SENTENCE) 122 (SUB (LENGTH SENTENCE) 123 (SU91 (LENGTH (CAR ENTRY)!))) 12* (REVERSE (CAR ENTRY 11) 125 ( SETQ FOUND (CADR ENTRY) 126 SENTENCE (NTH SENTENCE 127 (LENGTH (CAR ENTRY)))) 123 (UNEVAL "MAPC NIL)) 129 ) ) 130 ENTRYL) 131 (RETURN FOUND) 132 I ) 133 )) IS* 135 136 137 (DEFUN SUBNUMBER (NUN) 138 (TAB 1 IMPLODEBUFFER) [PR(Nl ••««« IMPLODEBUFFER) 139 (PRINl NUM IMPLODEBUFFER) 1*0 (PRINl •«"-» IMPLODEBUFFER) 1*1 (ENTERWCRD (READ IMPLODEBUFFER) 1*2 •INTEGER 1*3 ' * l I** I l*S 1*6 1*7 IDEFUN SUBLIST (LSTI 1*8 (ENTERWCRD 1*9 (IMPLODE (EXPLODE (GENSYHl "L1STI I I 150 'NPR 151 (LIST LST '(LIST) I 152 I) 153 15+ 155 (OEFUN ENTERWORO (WORD TYPE PROP) ' , 156 (PUT WORD '0(CT 'MORPH! 1ST (PUT WORD TYPE* PROP) 158 WCRD 159 1 160 161 162 (DEFUN SPECIAL (TYPE WRDI 163 (ENTERWCRO WORD 16* 'NPR 165 (LIST WRO 166 ICONO ((EQ TYPE '3 I •(ATOM)I 167 ( " (FUNCTION) ) 168 I 16« I 170 11 171 172 173 (DEFUN NOTFCUNO (WORD) (PROG (NEW) 17* (FRINTL THE WORO (WORO) IS NOT IN THE DICTIONARY I 175 ENTER EITHER A NEW OICTIONARY ENTRY OR NIL TO CANCEL I 176 I RETURN 177 ICONO 178 ((ATOM (SETO NEW (READ! II NILI 179 IT IENTEROICT (CAR NEW) (COR NEW) I 180 ICHECKWORO WORO) I 181 11 182 I I 183 -IB* 185 (OEFUN ENTEROICT (WORD D L i S I l 186 (COSO 187 ((EQ (CAR CLISTI •SUBSTITUTE!I 188 (I PUT WORD '01CT 'DICTIONARY) II 189 IREPEAT • I AND ( PUT WORO I CAR DLISTI .1 CADR DLIST) I 190 (SETQ OL(ST (CODR DLISTII 1 191 10 NIL I 192 ' I 193 19+ 195 I THE MORPHEMIC ANALYSIS ROUTINES 196 197 (OEFUN MORPH? (AWOROI 198 (PRCG (WORO RET! 199 (SETC WORD (REVERSE (EXPLODE AWORO) I I 2=0 (SETQ RET lhS 201 (ERRSET 2C2 (NULL (MAPC 'SUFFIKTEST N0RPHTA8LE1) 203 NIL 20* 1 2C5 ) 204 IRETURN (COND 207 ((NULL RETI (ERROR '"LISP ERROR IN MORPH?")) ' 2C8 (IEO RET 'FOUND) AWORDI 209 I 210 1 211 I) 212 2 1 1 21* (DEFUN 5UFFIXTEST (ENTRY) (PROG (STEM FOUNO DOUBLE) 215 (CONO ((NOT ( SETO STEM (CETSTEM (CAR ENTRY) WORD ))) 216 (RETURN NILI ) ) 217 LOCPIHAPC 'MAKE-ENTRY ( CDR ENTRY)) 218 (CONO (FOUNO (ERRUR 'FOUNO)I ?19 (0CU8LE ISETO STEM (CDR STEM I) (SETO DOUBLE NIL) (GO LOOP) ) ) 220 (RETURN N I L ) ) ) 221 ' 222 223 (OEFUN CETSTEM ( SUFFIX WORD) 22* ICONO l ( NULL SUFFIX) WORO I 225 (( EQ I CAR SUFFIXI •») 226 ICONO HAND (GREATERP (LENGTH WORD) 3) 227 (EQ ( CAR WORO) (CADR WORD) ) 228 (CONSONANT (CAR WORD) I ) 229 (SETQ OOUBLE T) I I 230 WORD ) 231 ((NULL WGR01 NILI 232 I I EQ I CAR SUFFIX) ICAR WORD)) 233 (GETSTEH ( CDR SUFFIX) (COR WOROI )) . 23* (T NIL) 1) 233 236 237 (OEFUN MAKE-ENTRY (S-ENTRYI (PROG ( TESTWORD ATTRIBUTES TYPE I ' 238 (SETQ TESTWORD I IMPLODE I APPEND (REVERSE STEM I 239 (CAR S-ENTRY) ) ) ) 2*0 (SETO ATTRIBUTES (CDODR S-ENTRYI ) 2*1 (SETO TYPE ( CADR S-ENTRYI I 2*2 (COND (( AND 2*3 (GET IESIWORD TYPE I 2** IEVAL I CADDR S-ENTRY) )) 2*5 ISETQ FOUND Tl 2*6 I ENTERWORD AWORD TYPE ICONS TESTWORD ATTRIBUTES!) 2*7 I RETURN Tl I 2*8 (T (RETURN NIL I I) II 249 250 251 252 (DEFUN NTYPE FEXPR (TYPE)(EQ (CAR TYPE) (GET TESTWORO 'N) ) ) 253 25* (OEFUN VBTYPE FEXPR (TYPE) (EO (CAR TYPE) (GET TESTWORD 'VI I) 255 256 (DEFUN ADJTYPE FEXPR (TYPE) (EO (CAR TYPE) (GET TESTWORO «ADJ) )) 257 ' 258 (OEFUN ADVTYPE FEXPR (TYPE) IEO (CAR TYPE) (GET TESTWORD •AOV) )) 259 260 261 IDEFUN CONSONANT ILI (MEMO L M B C O F G H J K L M 262 N P Q R S T V W X 2 ) ) ) 263 26* 265 ' (DEFUN HORPH (WORD) T) 266 267 268 269 1 MISCELLANEOUS LISP ROUTINES 270 271 (NULL IADDPROP 'OEFUN 'EXPR 272 MFLAMBDA (DEF1 273 (PRCG (NAME TYPE I-27* (SETQ NAME (CAR DEF)> 275 (SETQ OEF (CDR DEFII 276 (SETQ TYPE 277 (SELECT (CAR OEFI 278 I'EXPR (SETQ OEF (COR OEFll 'LAMBDA) 279 ('FEXPR (SETO OEF (COR OEF)) 'FLAMBDA) 280 I'NEXPR (SETO DEF (CDR DEF>) •NLANBDAI 28) •LAMBDA 282 )) 283 ICOND 28* (IGETL JJAHE •(EXPR SUBR FSUSR NSUBR) I 285 ITERPRII IPRINI NAME) 286 IPRINI 287 "•HAS BEEN PREVIOUSLY DEFINED. NEW DEFINITION WILL BE USED-) 288 (TERPRII 289 )) 290 IA0DPROP NAME 'EXPR (CONS TYPE OEF)) 291 (SETQ DEF (GET 'FUNCTIONS' 'FUNCTIONS*)) 292 ICONO I I AND OEF (MEM! NAME OEFll I 293 (T IPUT 'FUNCTIONS* 'FUNCTIONS* (CONS NAME DEF)) ) 29* ) 295 IRETURN NAME) 296 ) ) • 29T I) 298 300 301 (OEFUN UNOEFUN FEXPR IL) (PROG (LSI 302 (MAPC 'ILAMBDA IFUNI 303 (CCND 30* ((SETO IS (GET FUN "EXPRD 305 (PR I NT L DEFINITION OF (FUN) AS AN EXPR REMOVED) 3C5 I REN FUN (CAR LSI 1) ) 30? (T IPRINTL NO PREVIOUS DEFINITION OF IFUNI TO REMOVE I 308 II 309 L I 310 )I i 311 312 313 31+ (DEFUN VERBUSI7I 315 ICONO 316 I? (STATUS (+T 111 1 317 IT (STATUS 147 0)1 I 318 II 319 320 321 (STATUS (7 LISPOUT 120)1 322 323 324 (DEFUN PUTPROP IA1 SI FLAGI (PUT A l FLAG S i l l 325 326 32T (PUT 'FLAGP •SUBR (GET "GET •SUBR11 328 329 330 (PUT 'GENSYHL •SUBR (GET •GENSYH 'SUBRI1 331 3 32 333 (DEFINE (SCLCCK SUBR (1 'LIBRARY SCLOCKDI 334 335 336 (DEFUN TRACE FEXPR(L1 337 (PUT L 'BUG 338 '((FLAMBDA ( A l l 339 (TERPRIKPRINl '">»ENTERINC" ) 340 (PRINl ICAR {BINDING ' A l 1 T i l ) (TERPRl) 341 (TAB I0KPRIN1 • ARGUMENTS" ) 342 (MAPC 'PRINl A l ) 343 (TERPRl) (PRINl •" ") (TERPRl) 344 ) . 345 (LAMBDA (A2I 346 ITERPRl 1 IPRINI '"<«EXITING" ) 347 (PRINl (CAR (BINDING -A2 1 T)))(TERPRI) 348 (TAB 10XPRIN1 'VALUE- 1IPRIN1 A2KTERPRI) 349 A2 350 II 351 1 352 I 353 354 355 (DEFUN UNTRACE FEXPR (L) (MAPC '(LAMBDA (FUN) (REM FUN 'BUG)) L )) 356 357 358 ' 359 360 (DEFUN IHPLCOE (LI .- 361 (TAB 1 IMPLOOEBUFFERI 362 (MAPC •(LAHRDA (XI (PRINl X IMPLODEBUFFER)) I ) • 363 I READ IKPLOOEBUFFER) . 364 I 365 366 367 • . . • 368 (OPEN IIMPLODEBUFFER 100)) 369 (STATUS 15 IMPLODEBUFFER T ) l 370 • 371 372 (DEFUN ERRSET FEXPR (SEXPS) (LIST (EVAL ICAR SEXPtlJ) I 373 374 375 (DEFUN ERROR FEXPR O V A L t l (UNEVAL 'ERRSET (CAR t V A L t l l I 376 377 37B 379 (OEFUN PRINTL FEXPR (ILL) 380 (TERPRII 381 (MAPC *(LAMBDA (»Xt) 382 (CCND (IEO IX» M) I TERPRl 11 383 ( (ATOM .XI) (PRINl IXSM 384 (T (MAPC ' (LAMBDA (»Y») (PRINl (EVAL I Y U I I JXII I 385 I) JLt J 386 IIERPRI) 387 I ' 388 339 390 391 (DEFUN PARSETRACEO (SETO XTRACE (NOT XTRACE1) I 392 393 394 395 (OEFUN ETIHEI) (FIX (TIMES ISCLOCX ISCLOCKi) 1000)) 1 316 397 398 (DEFUN STIMEO (SETS ISCLOCK. (SCLOCK 0.0)1 I 399 400 401 tCONTINUE WITH JE4:SEMANTICS»JEJ:AUX RETURN END OF FILE A P P E N D I X 7 - THE SEMANTICS ROUTINES 148 1 ; THE SEMANTICS ROUTINES 2 3 ; THE SENTENCE SEMANTICS ROUTINES 4 . 5 IOEFUN S-SEMANT1CS ISUBJ VERB DO INOO) 6 I THIS ROUTINE CHECKS THE SEMANTIC AGREEMENT AMONG THE SUBJECT, VERB,• 7 ; DIRECT AND INDIRECT OBJECTS IN A SENTENCE. 8 IPROG I RET I 9 ICOND (INCT IEO (CAR VERB I 'VIII 10 (INOT (S-V-SEMANTICS SUBJ VERB 11 11 (RETURN N I D I 12 (INCT IV-OO-SEMANTICS VERB 00)1 11 I RETURN NILI I 14 ((VFEATUP.E ICAOR VERB I 'INOOBJI 15 (AND (NOT (V-IND0-SEHANT1CS VERB INDOD 16 I RETURN NIL ) ) ) ) IT (COND ((VFEATURE ICADR VERB) 'COPULA) 18 (ANO (NOT (COPULA-V-SEMANTICSX 19 (RETURN NIL ) ) ) ) 20 (CONO (IGET (CADR VERB) 'V-SEMANTICSI 21 (PTRACE SPECIAL VERB SEMANTICS TEST I .22 - " VERB » I VERB)) 23 ISETO RET 1EVAL (GET (CADR VERB) •V-SEMANTICS))) 24 ISETO VAL (SUCCESS?)) 25 (PTRACE " " IVAD - VALUE IS (RET)) 26 (RETURN RET))) 2? (RETURN T) )) ' 28 29 30 [DEFUN S-V-SEHANTICS (SUBJ VERB) 31 32 ; THIS ROUTINE CHECKS THE SEMANTIC AGREEMENT BETWEEN THE SUBJECT AND VERB 33 34 (PROG (RET VAL) 35 (PTRACE SUBJECT-VERB SEMANTIC AGREEMENT t 36 » " SUBJECT « (SUBJ) : 37 " VERB = (VERB) I 38 (ScTO RET 39 (COND ((OR (NULL SUBJ)' 40 (NULL VERB)I " . . . 41 NILI 42 UHEHQ (CAR SUBJ) ' (N PRO)) 43 (COND ((ATOM ICAOR SUBJ)) 44 (INTERSECT (LIST IGET (CADR SUBJI 'N-TYPE) 45 (GET (CADR VERB) * SUBJ-TYPE11)) 46 IT (COMPOUND-NP-CHK ICAOR SUBJI[CET (CAOR VERB) 'SUBJ-TYPE))))) 47 (T) )) 48 ISETQ.VAL (SUCCESS?)!-49 (PTRACE " • (VAL) -VALUE IS (RET)) 50 I RETURN RET))) 51 52 53 (DEFUN V-DO-SEHANTICS (VERB DO) 54 ' 55 -.THIS ROUTINE CHECKS THE SEMANTIC AGREEMENT BETWEEN THE VERB AND DIRECT 56 ;OBJ£CT. 57 58 IPROG (RET VAL! 59 (PTRACE VERB-DIRECT-OBJECT SEMANTIC AGREEMENT » 60 'mm VERB =• (VERB! s 61 " " DIRECT-OBJECT - IDOI ) 62 (SETO RET • . 63 (COND ((NULL VERB) NIL) 64 ((ANO (NULL 001 65 (OR IVFEATURE (CADR VERB) •INTRANS) 66 IVFEATURE (CADR VERB) 'COPULAI )) I 67 ((NULL DO! NILI 6B IIMEMQ (CAR 00! • IN PROD 69 (COND (I ATOM (CADR 0011 70 [INTERSECT [LIST (GET (CADR 00) 'N-TYPE) 7 1 (GET (CADR VERB) 'DO-TYPEIII! 7 2 IT (COMPOUND-NP-CHK (CADR DOHGET (CADR VERB I 'OO-TYPEIID) 73 IT) )) 74 (SETQ VAL (SUCCESS?11 75 (PTRACE « " (VAL! - VALUE IS I RET)) 76 (RETURN RETII) 77 78 • 79 (DEFUN V-tNCO-SEMANTICS (VERB INOO) 80 81 I THIS ROUTINE CHECKS THE SEMANTIC AGREEMENT BETWEEN THE VERB AND 82 ; INDIRECT OBJECT. 83 e4 IPROG (RET VAL) 85 (PTRACE VERB-INDIRECT-OBJECT SEMANTIC AGREEMENT t 86 m • m VERB » (VERB! : 87 " " INDIRECT-OBJECT - IINOOI ) 88 ISETO RET 89 (CONO ((NULL VERB I NIL! 90 I I NULL INOO! II 91 ((MEMO I CAR INOO) 'IN PROD 9J (CONO ( I ATOM (CAOR INCDD <,j (INTERSECT (LIST (GET (CADR INDO) 'N-TYPE) 9* (CET (CADR VERB) •INDO-TYPE D ) ) 9 5 (T (COMPOUND-NP-CHK (CADR INDOIIGET (CADR VERB! •INDO-TYPEII11) 96 ( T i l l 97 ISETQ VAL I SUCCESS?11 98 (PTRACE - " IVALI - VALUE IS 1RETII 99 I RETURN RET)I) ICO 14 9 101 102 (OEFUN 5-V-NUMBER-CHK 1SU3J VERB1 103 -10* S THIS ROUTINE CHECKS THE NUMBER AND CASE AGREEMENT BETWEEN THE 105 : GRAKMAT ICAL SUBJECT AND THE VERB 1C6 • 107 (PROG (PRO NUM PN RET VAL) 103 (PTRACE SUDJECT-VERB NUMBER AGREEMENT i . . IC9 " « SUBJECT - ISUBJ1 I 110 " » VERB - (VERBII 111 (COND ((NOT (MEMO (CAR SUBJ I MPRO N CENPR01I1 112 (SETQ VAL 'SUCCEE0S1 113 (PTRACE " - (VAL) - VALUE IS T l (RETURN T l I 11* ((EU (CAR SUBJ) -PRO! 115 (COND ((NOT (ASSQ 'SUBJ (CAODR SUBJIII l i t (SETO VAL "FAILS) U 7 (P TRACE " - (VAL I - VALUE IS NIL) IRETURN NIL)) l i e (T 119 (SETQ PRO T) 120 ISETO PN (CADR (AS50 •PNCODE (CAOOR SUBJ)))) III . 121 IT 122 (SETO NUM (CAOR (ASSQ 'NUMBER ICADDR SUBJIII I I I 123 ISETQ RET (SELECTU (CADR (ASSQ 'PNCOOE (CAOOR VERBID 12* CANY II 125 (MSG (COND ((AND PRO (EQ PN '1SGIDII 126 I • 3SG ICONO I I AND PRO (MEMO PN 'I3SG 3 5G1PLI I) ) ' 127 ( (ANO (NOT PRO) (MEMO NUM MSG MASS SG-PLHD )) 128 (M3SG ICONO 11 AND PRO IMEMQ PN MISG 3SG 3SG3PLDD 129 (UNO INOT PRO) |M£MQ NUM MSG MASS SG-PLIID )) 130 (."X35G (COND ( (AND PRO INOT (EO PN '3SGD1I 131 MANO (NOT PROI (MEMC NUM MPL SG-PL)))) I) 132 I•X13SG (COND ((AND PRO (NOT (MEMO PN MISG 3SG))))) 133 ((ANO (NOT PRO) [MEMQ NUM MPL SG-PL)))))) 13* NIL) ) 135 (SETO VAL [SUCCESS?)) 136 (PTRACE " " (VAL I - VALUE IS (RED > (RETURN RET))) 137 138 (OEFUN COMPOUND-NP-CHX (NP V) 139 1*0 ; THIS ROUTINE CHECKS THAT EACH HEAO NOUN OF A COMPOUND NOUN PHRASE AGREES 1*1 I SEMANTICALLY WITH THE VERB. 1*2 1*3 (PROG (INOIC) I * * - (SETQ IHOIC T l • .' 1*S IMAPC MLAHBOA (XI 1*6 (CONO KNOT IMEMQ (CAR XI MN PRO)))) l«T ((NOT (INTERSECT (LIST (GET (CADR NP) "N-TYPEI V ) ) I 1*8 ISETQ INOIC NIL)) I t 1*9 NPI 150 (RETURN INDICI )) 151 152 153 (DEFUN SUCCESS7 I) 15* (CONO (RET 'SUCCEEDS I 155 IT 'FAILS))), 156 157 158 IOEFUM COPULA-V-SEMANTICS () ' 159 1 THIS ROUTINE CHECKS THAT A COPULA VERB HAS SOME TYPE OF POST-VERBAL NODIFIER PRESENT. 160 161 162 IPROG I RET VAL TYPE) 163 (PTRACE CQPULA-VER8.SEMANTICS) 16* ISETO TYPE 165 ICONU ((SETO RET (GETR OBJ)) —SUBJECT COMPLETION") 166 I(SETQ RET (GETR PREPPHRASES)) '"PREPOSITION PHRASE-I 167 ((SETO RET (GETR CONPLD 'COMPLEMENT) 168 ((SETQ RET (GETR ADVERBS)) "ADVERB) 169 (T •"NO POST VERBAL MODIFIER"))) 170 ISETO VAL (SUCCESS?)) 171 (PIRACE " " (TYPE) HAS BEEN FOUNO > 172 . > (y/iLi _ VALUE IS (RET.) 17} (RETURN RET) )I 17* :,. 175 176 (OEFUN PRECAOJ-SEMANTICS (AOJ SUBJ) 177 178 179 180 (PRCG (RET VALI lei (PTRACE SUBJECT-PREOICATE-AOJECTIVE SEMANTIC AGREEMENT s 182 » • SUBJECT;- (SUBJI I 183 « • PREOICATE ADJECTIVE - (AOJD 18* (SETQ RET 185 (CCNO (I0R (NULL SUBJ)(NULL AOJ) 186 (NOT (EQ (CAR SUBJI 'N>))> 187 ((CO (CA'iR ADJ i 'VI 188 NIL I 169 ((ATOM (CAOR SUBJ)) 190 I INTERSECT ILIST I GET ICADR SUBJI "N-TYPE) 191 (6ET (CAOAR ADJ) "AOJ-TYPE!))) 192 (T (COMPOUNO-NP-CHK (CADR SUBJ) 193 (GET (CAOAR AOJ) "AOJ-TYPEID II 19* ISETQ VAL (SUCCESS7D 195 (PTRACE " " (VAL) - VALUE IS (RET I) 196 (RETURN RET))) 197 196 (DEFUN V-OO-AGREEMENT () 199 ICCNO I(VFEATURE (GETR VI 'COPULA)) 2C0 ((NOT (VFEATUME (GETR VI MNDOBJD ICMECK THE SEMANTIC AGREEMENT BETWEEN THE SUBJECT AND PREDICATE ADJECTIVE. 150 201 (V-DO-SEHANTICS IGETR S-VERBI IGETR S-DOIII 202 I T ) ) ) 203 20* 205 IDEFUN INTERSECT I D 2 06 207 ; THIS ROUTINE FIRST REMOVES THE NULL SUBLISTS OF I AND THEN PRODUCES 208 ; THE INTERSECTION OF THE REMAINING SUBLISTS. 209 210 IPROG ILL INDIC INT II 211 IMAPC 'I LAMBDA (X) 212 ICOND I INULL X)) 213 IT ISETQ LL I APPEND LL (LIST X ) ) ) ) 21* I I 215 D 216 ICOND ((NULL LL) (RETURN T)> 217 (INULL (CDR LL I I (RETURN ICAR L D ) II 213 (MAPC f(LAMBDA (FIRSTELTI 219 ISETO I T ) 220 (MAPC MLAHBDA (SUBLIST) 221 (SETQ INDIC NILI 222 IMAPC •(LAMBDA (SUBLISTELTI 223 (COND ((EQ FIRSTELT SUBLISTEL-T) 22* (SETO (NOIC Tl 225 (UNEVAL "MAPC NIL) I 226 ) ) 227 SUBLIST) 228 ICOND ((NULL INDIC) 229 (SETO 1 NIL) 230 (UNEVAL 'HAPC NIL) )) 231 ) 232 (CDR L D ) 233 (COND ( I {SETQ INT [APPEND INT ILIST FIRSTELT))) )) 23* ) 235 ICAR L D ) 236 I RETURN INT) I) 237 238 239 ; NOUN PHRASE SEMANTICS ROUTINES 2*0 2*1 [OEFUN NP-SEMANTICS IOET AOJS NOUN) 2*2 (CHECK NUMBER AGREEMENT AND SEMANTIC AGREEMENT -2*3 (CCND (INP-NUHBER-CHKjDET NOUN) 2** (NP-SEMANT1C-CHK OET AOJS NOUN) ) I) 245 2*6 2*7 (DEFUN NP-NUMBER-CHK (DET NOUN 1 2*8 (CHECK NUMBER AGREEMENT BETWEEN THE DETERMINER AND NOUN . 249 IPROG (RET VAL1 250 (PTRACE NP NUMBER AGREEMENT s 251 " " DETERMINER =• (DET) r 252 " * NOUN » (NOUN) ) 253 ISETO RET 25* (COND ((OR (NULL NOUNI 255 (AND DET (NOT (EQ (CAR DETI "DET))) 256 INOT IEO (CAR NOUNI ' N i l ) 257 T) 258 I(SELECTQ [CAOR (ASSQ 'NUMBER (CADOR N0UNI1 ) 259 ('MASS T l 260 ('SG-PL Tl 261 I'SG ICOND ((ANO (NULL DETKGETR CONJFLAG))) 262 ((NULL DET) NIL) 263 ((NOT IEO (CAOR (ASSQ 'NUMBER (CADDR DETII ) 26* -PL))) 265 ) ) 266 I'PL ICOND (I NULL DET) I 267 11 NOT IEQ (CADR (ASSQ •NUMBER ICADDR CET1I I 268 'SCI)) 269 I > 270 NIL ) ) ) ) . 271 (SETO VAL (SUCCESS?)) 272 (PTRACE " « (VALI - VALUE IS (RET1I 2 73 (RETURN RET I I) 2 75 276 10EFUN NP-SEHANTIC-CHK IDET ADJS NOUN) 277 ; THIS ROUTINE CHECKS THE SEMANTIC AGREEMENT BETWEEN THE DETERMINER. 278 ; ADJECTlVESi ANO THE NCUN IN A NOUN PHRASE. 279 tPROG IRET VALI 280 IPTRACE NP SEMANTIC AGREEMENT ! 281 " " DETERMINER » IDET) J 2B2 " " ADJECTIVES = (ADJS) 1 283 " " NOUN • 1NCUNI) 284 (SETO RET 285 (COND ((OR (NULL NOUN) 286 (NULL ADJS) 287 [NOT (EQ (CAR NOUN) ' N i l II 288 IT 289 (INTERSECT (APPEND (LIST IGET (CADR NOUN) •N-TTPEI) 290 (MAPCAR 'CONSTRUCT AOJS)) 11)1 291 ISETO VAL (SUCCESS?)) 292 (PTRACE " " (VAL) - VALUE IS (RET)) 293 ICONO ((ANO RET 294 (EO (CAR NOUN) 'N> : 295 (GET (CAOR NOUN) •N-5EMANTICS)) 296 [PTRACE SPECIAL NOUN SEMANTICS TEST » 297 " " NOUN • (NOUN) I 298 ISETO RET (EVAL (GET (CADR NOUN) 'N-SEMANTICSII) 299 (SETQ VAL (SUCCESS?)) 300 [PTRACE " " (VAL) - VALUE IS IRET!I II 301 [RETURN RET) )) 3C2 ' i 303 304 (OEFUN CONSTRUCT (ADJ) 305 306 ; THIS ROUTINE CONSTRUCTS A LIST OF THE ADJECTIVES' SEMANTIC MARKERS. 307 308 1SELECT0 (CAR ADJI 309 ('AOJ (GET (CAOR ADJI 'ADJ-TYPEH 310 I'V (GET [CADR ADJ) S l l (SELECTQ (CAAODR ADM) 312 (•PRESPART 'SUBJ-TYPE! 313 ('PASTPART 'DD-TYPEI 314 NIL) 315 I I 316 K I D ) 317 END OF FILE APPENDIX 8 - THE AUX I L l .ARY GRAMMAR ROUTINES 152 1 : THE STRUCTURE-BUILDING ROUTINES 2 3 [DEFUN EUILC-S II A (SETR TYPE 5 (BUILOQ (3 IHOODI • • ) NEG TYPED * I COND ( IGETR VOICED 7 IT ISCTR VOICE MVDICE ACTIVE D D 8 (SETR AUX 4 (BUILOQ IAUX (3 (TNS! • •!! TENSE ASPECT)! 10 (COND ((GETR HODALI (ADOR AUX (GETR HODAL)) II 11 (SETR V 12 (BUILDO ((V • ) ) V)) 13 (SETR OBJ I A (CCND ((GETR OBJKLIST (GETR O B J D I I I 15 (SETR V P 16 (BUILDO (a (VPI * * • * * ) V OBJ COMPL PREPPHRASES ADVERBS)I 17 (SETR S (BUILOO IS • • » • ») TYPE VOCE SUBJ AUX VP)) 18 (CONO (IGETR S-CONJ) 19 - (BUILDO IS <» » •DCONJ S S-CONJ)! 7.0 IT IGETR S D D 21 22 (OEFUN BUILD-NP I I 23 ISETR CET 2» • IBUILDO I(GET + ) J DET) ) 25 (SETR PUSS 26 (CONO (IGETR POSS) (BUILDO KPOSS •)) POSSI 1)1 27 ISETR N 28 ICCND ((GETR N ( (BUILDO (3 (N ») ») N NFEAT)) 29 ((GETR NPRI IBUILDO (3 (NPR ») ») NPR NFEAT)) 30 ((GETR PROPER)) )) 31 ISETR NU 32 (BUILOQ ((NU • )> NU) ) 33 3* (SETR N P (BUILOQ 13 INPI • • • ( • ) • • • ) 35 OET 34 PUSS 37 NOCS 38 N 39 NU AO PP • 1 RED) *2 (CCNO ((GETR CONJI A3 (BUILOQ (NP !• • • >) CDNJ NP NP-CONJD AA )T IGETR NPD I) AS +4 A7 IOEFUN BUILO-NPU () *8- (SETR'TYPE" " (K033> N?U)T •9 IBUILDQ IS • •) TYPE SUBJ)) 50 51 • 52 IOEFUN EUILD-PPU () 53 (SETR TYPE "(8000 PPUII . 5* (BUILDQ IS • A). TYPE (CAR (GETR PREPPHRASES)))) 55 5* (OEFUN BUILD-QP (> 57 (SETR PP (COND ((GETR PP) (LIST (GETR P P H I I I 58 (BUILOQ (3 (NP) ((OET NILI) ((QPRO «)) ((NU SG-PLI) • ! QPRO PP1I 60 61 IOEFUN BUILC-CUANTP I) 62 ICOAD UANO (GETR OWORD) (GETR Q)> 63' (BUILDO (QUANT • ) t ) l 6A ((ANO (GETR OWORD) IGETR CONPII 65 (BUILOQ I QUANT *) COHPD 66 IT 67 (SETR Q (COND ((GETR 0) IBUILDQ (lOgANT »)> Q ) l l ) 68 (SETR COHP (CONO IICETR COfP) (BUILOQ KCOHP •)) COHPJDI 69 ISETR SUPER (CCND IIGETR SUPER) IBUILDO IISUPER »)) SUPER)))) TO ISETR OET ICONO (IGETR OET) IflUILOO ((OET • >) DET1ID 71 (SETR QUANT (COND ((GETR 0UANT1 (LIST (GETR QUANT))))) 72 (BUILOQ (3 (QUANTP) • • » • » ! T l Q 7* COHP 75 SUPER 76 OET 7T OUANT)})) 78 79 80 (OEFUN BUILD-S—CONJ () •1 ISETR C-TYPE IBUILDQ 13 INOODI * • ( NEG TYPE) I 82 ICONO ((GETR VOICE! (SETR C-VOICE IGETR VOICED! 81 IT (SETR C-VOICE "IVOICE ACTIVE)))1 8* ISEIR C-AUX 85 (BUILDO (AUX (3 (TNS) • •I) TENSE ASPECT!) 86 (SETR CONJ-V (8UIL0U ((V " I I CONJ-VI! 87 ICONO I(GETR CONJ-PASSIVE) 88 (SETR C-OBJ ICONO (IGETR OBJI IL(ST (GETR O B J D D ) e9 — - • -90 [SETR 41 (BU(LOQ (3 (VP) • • •! CONJ-V C-OBJ C-AOVERBSD 92 IBUILOQ (S » » • • •) C-TYPE C-VOICE SUBJ C-AUX C-VP) ) 93 9* (OEFUN 8UIL0-ADJP I ) 95 (COND (IGETR AOV) IADOR ADV IGETR ADJI) 96 IBUILDQ 13 (ADJP) "I AOV!) 97 IIGETR ADJI))) 98 - l i u t m u o . l l I L I J l I V l C I K U B J I I | | | C-vp 1" C " 4 0 V E " a S , C C N 0 < I E 0 U J I- «GETR TYPE) ' (QADV)) (GETR A0VER8S)))) )) 99 ; THE AUXILIARY GRAMMAR ROUTINES 1DO 101 IDEFUN PASSIVE II 102 UNO (PASSIVE*) 103 IES IGETR VI •66)11 104 105 IC* IDEFUN PERFECT I) 107 (AND IEC IPARTICIPLE) 'PASTPART! ICS (EO IGETR V) 'HAVE!)) 109 110 111 IOEFUN PROGRESSIVE <l 112 (ANO (EC IPARTICIPLE) 'PRESPART) 113 (EQ (GETR V) *BE))) 1)5 (DEFUN CO-AUX I ) 116 (ANO 117 (EQ IGETR VI '001 118 (CEIF UNTENSEOIII 119 120 121 (DEFUN FUTURE II 122 (ANO (GETF UNIENSEO) 123 IMEMQ IGETR V) '(MILL SHALL)) II 12* 125 126 (DEFUN MODAL I) 127 (ANO (GETF UNTENSEOI 128 (VFEATURE IGETR V) 'MOOAL))) 129 130 131 (OEFUN VFEATURE IV TYPE) 132 (PRCG (A) 133 (COND 13* • ((NULL (SETQ A (GET V 'FEATURES!)) 135 (RETURN (MEMO TYPE •(TRANS PASSIVE))) 1 136 ((RETURN (MEMO TYPE A l l l l l l 117 138 119 • (OEFUN COMPVERB (VERS) 1*0 ICONO 1*1 I(ATOM VERSI NIL) 1*2 I(MEMBER '(COMPARATIVE! VERB!) 1*1 ((COMPVERB (LAST VERB))))) 1** 1*5 1*6 147 (OEFUN PASSIVE* ( I 1*8 .(PRCG (A) 1*9 (RETURN 150 (AND (GETF PASTPART) 151 (OR (NULL (SETO A (GET • 'FEATURES))) 152 IMEMQ 'PASSIVE A D D ) ) 151 IS* 155 156 157 IOEFUN AUX* (( 158 (AND (GETF TNSI 159 (MEMO 'AUX (GET * 'FEATURES))11 160 161 , 162 ' (OEFUN UNTENSEDV (LEX) 161 (PRCG (CAT) 164 (SETO CAT «V) 165 (RETURN (AND (GET LEX CAT) 166 (ASSQ "UNTENSED (GETCATFEATURESIII 111 167 166 169 IOEFUN AUXV ILEX) 170 (PRCG (CATI 171 (SETQ CAT "V) 172 IRETURN I AND (GET LEX CAT) 171 (ASSO 1TNS (GETCiTFEATURES)) 174 IMEMQ 'AUX IGET (GETROOTI "FEATURES!I I) 175 ' . ' * 176 177 (OEFUN OUeSlfORB ILEX! 176 (OR IAUXV LEX) 179 UHQFCRM LEX) I) 180; 181 182 (OEFUN MHQFORM (LEX) 181 (OR (GET LEX "QOET) 18* (GET LEX 'QPROI IRS (GET LEX 'QAOVII I 186 187 (OEFUN PARTICIPLE!) 188 (COND 189 (IGETF PRESPART! "PRESPART! 190 IIGETF PASTPART) "PASTPART))) 191 192 (OEFUN COMP-SUPER ( ) 191 ICADR IASSQ • |9* "((MORE COMPARATIVE) 145 IHOST SUPERLATIVE)))!) 196 197 198- (OEFUN NEXT FSXPR (TYPE) 149 (CONO I(NULL (COR STRING)) NIL) 100 I(GET (CAOR SIRING) (CAR TYPE))))) 201 END OF FILE APPEND IX 9 - THE PARSER 15k 1 IOEFPROP SETR EXPR 2 (FLAMEOA (XI 3 (SETQ REGS ICONS (CONS (CAR X) (EVAL (CADR XIII REGSIDI * 5 6 (OEFPROP GETR EXPR 7 (FLAM8DA (LSI) 8 (COND ((NULL (CDR LSTI) IGETRV ICAR 1ST))) 9 ((NUNBERP (CACR LSTI I 10 (COND ((ZEROP (CAOR LSTI) (GETRV (CAR LSTI)) H IT (CDR (ASSQ (CAR LSTI (CADAR (NTH STACK ICADR L S T I I I I ) ) ) ) 12 (T (CDR (ASSQ (CAR LSTI ICADR IASSQ ICADR LSTI STACX) ) )) I 111 13 I * 15 IDEFPROP GETRV EXPR 16 ILAMBCA IRECI 17 IPROG 181 18 (RETURN 19 (CONO ((EQ REG (OUOTE »)) ») 20 ((SETQ B (ASSQ REG REGS I) (COR B11 I ) ) ) ) 21 22 23 IOEFPROP BUILOQ EXPR 2* (FLAHBDA (L) 25 (BUILD ICAR L) (CDR L I ) ) ) 26 27 28 (OEFPROP BUILD EXPR 29 ILAMBDA (FRAG REG* I 30 (PROG IREGLSTI 31 (SETQ REGLST REG*) 32 (RETURN (BUIL01 FRAG))))) 33 34 35 IDEF PROP BUIL01 EXPR 36 I LAMBDA I FRAG I 3 7 IPROG (A) 38 (RETURN 3 9 (COND ((NULL FRAG I NIL) 40 ((EC FRAG (CUOTE *D (GETRV (CAR REGLST11 I 41 IIEQ FRAG (CUOTE I ) ) IFVAL (CAR REGLST 111 42 ' • ((£0 FRAG ICUOTE * l l »l 43 11 ATOM FRAG I FRAG I 44 ((EO ICAR FRAG) ICUOTE * ) l 45 (SETQ A (UNCCNS REGLST (OUOTE REGLST)) ) 46 (CONS IGETRV A) IBUIL01 (COR FRAG)))) 4 7 I IEO I CAR FRAG) (OUOTE f l l 48 ' •• ' (SETQ A (UNCONS REGLST (QUOTE REGLST) ) ) 4 9 (CONS IE VAL A) (BUILD1 (COR FRAG 111) 50 ((EO (CAR FRAG) (QUOTE «)) ICCNS * (BUILDl (CDR F R A G l l l l 51 (IEO I CAR FRAG) (QUOTE SI) (GLUE (BUILOl (COB FRAG)))) 52 (T (CONS (BUILDl (-CAR- FRAG I I IBUILDI I CDR FRAG) ) ) ) ) I ) ) ) 53 54 . .. 55 (OEFPROP PARSEl EXPR 56 (LAMBDA (SENTENCE) 57 (PROG (A MORPHTEHP) 58 -. ' * (1NIT-TRACEI 5 9 ISETO REGS NIL) 60 (COND 61 ((SETQ A (HEVAL SENTENCE ST NIL NIL NIL (OUOTE (NIL . 0)>l>' 62 IAND :PRINTPARSE 63 (PROGN (PRINl (QUOTE PARSE:)) (TERPRII IPRINTPARSE A 01)1 64 IRETURN A ) I ) ) ) ) 65 66 67 (OEFPROP WEVAL EXPR 68 ILAMBDA (STRING1 STATE1 STACK1 REG51 HOLOl PATH1I 69 (PROG (A BODY-S ARCTYPE * LEX) 70 (PTRACE ENTERING STATE (STATED s STRING => I S I R I N G l t i • 71 (PTREGSI 72 (SETQ • 7} (COND ((NULL STRING!) NIL) 7* ((SETO MGRPHTEMP (MORPH (CAR STRING1I)I 7$ (COND ((EO MORPHTEMP T) I CAR STRING11) 76 (T (RPLACA STRING1 MORPHTEHP)))I 77 IT (ERROR (DICTERR1)1) 73 LEX 79 *) BO ICONO KNOT (GET STATE 1 (OUOTE GRAMMAR 111 (ERROR I ERROR 21) I) 81 (SETO BODY-S IGET STATE 1 (OUOTE GRAMMAR))) 82 TAG (CONO ((NULL BOOY-SI (BLOCKED) (RETURN N I D I 83 IT (SETQ ARCTYPE (CAAR BODY-SIDI 84 (COND ((SETQ A (EVAL I CAR BODY-SI)) (RETURN A l l 85 - (T (SETO BOOY-S (COR BOOY-S)) (GO TAG)I)))I 86 87 88 IDEFPROP-PUSH EXPR 89 (FLAMBDA (L) 90 IPROG ISTRING STATE STACK REGS HOLD PUSHREGSI 91 {INITIALIZE) 92 (RETURN 93 (CCND ((NULL STRINGI NIL) 94 I INOT I EVAL ICAOR L I D NILI 9 5 IT (PRINTPU5M) 96 (HEVAL STRING 9 7 ICAR L) 9 g (PUSHSTK (LIST STATE REGS (FINDACTICNS (COD* D D I 9 9 (COSENORS (CDDR LI) 100 HOLD . . . 101 ICONS STATE (SUB1 tLEVEl I » 111) 11 102 103 10* . (DEFPROP NRC EXPR 105 " IFLAMBOA ( D I f * IPROC ISTRINO STATE STACK REGS HOLO) 107 U N I T I A L I Z E ) 1U8 (RETURN 10? (CONO ((NULL STRING) N)L) 1(0 • ( ( A R P (EO » (CAR L1I (EVAL (CAOR L ) ) ) 111'.; (PR1NTARC ARCTYPE) 112 (APPLY (QUOTE PROGNXI (COOR L ) I ) ) ) ) ) I 113 11* 115. (DEFPROP PRCGNX EXPR •116 (FLAXBOA (LI 117 (CONO I(NULL LI (ERROR (ERRORll)l 118 ((NULL (COR L I ) 119 (CONO KNOT IEQ (CAAR LI !QUOTE TO))) IERROR IERRORID) 120.. (T IEVAL ICAR D D D 121 IT IEVAL (CAR LI) (APPLY (CUOTE PROGNX) ICCK D l l I D 122 12J • 12V IOEFPROP HEN EXP* 125 IFLAHBDA (L) 126 (PROG (STRING STATE" STACK REGS HOLD) 127 (IN1TIALI2EI 128 (RETURN tZ>. (CUNp ((NULL STRING) NIL) 130 I (ANO (HENS • (CAR L>> (EVAL (CADR L l l l "'. 131 IPRINTARC ARCTYPE) 132 IAPPLY (OUOTE PROGNXI ICOBR L)))1)>)> 133 13* 135 IOEFPROP POP EXPR 136 IFLAHBDA I D 137 IPROG I STRING STATE STACK REGS HOLD PS LEV) l i e U N I T I A L I Z E ) 139 ICONO {(NULL (CDR D ) (ERROR (ERRCR3) 1) 1*0 ((NOT (EVAL ICAOR L l l l (RETURN N I L I I 1*1 ( t 1*2 (RETURN (APPLY (QUOTE PUSHPROPN) (CADOR P S | ) ) ) ) ) M ) J 143 ICONO 1*4 • (UNO (NULL STRING) (NULL STACK) (NULL HOLD)) 1*5 IPTRACE ABOUT TO POP : SUCCESS! 1*6 IEVAL ICAR L D ) 147 I(NULL STACK I NIL) 148 I INOT (HOLDLEVELD N I D 14* IT (SETQ PS (CAR STACK)) 150 I (P0P5TK) 151 (SETQ « (EVAL ICAR L D REG5 (CADR PS) LEV SIEVED 152 (PR(NTPOP) 153 15* 155 156 (DEFPROP OOSENORS EXPR 1ST (LABBOA ( D ' 158 (CONO ((OR I NULL L) (NOT (EQ (CAAR L> (QUOTE SENDR)))) NIL) 159 IT IEVAL (CAR L D (OOSENORS (CDR L ) ) PUSHRECSDD 160 161 162 (OEFPROP SENOR EXPR 163 IFLAHBDA IL) 16* (CONO IINOT (EQ ARCTYPE (QUOTE PUSHDI (ERROR IERR0R61ID 165 ISETO PUSHREGS 166 ICONS ICONS (CAR LI (EVAL (CAOR 1)11 PUSHREGS))) 1 16? 168 169 (DEFPROP FINDACTICNS EXPR 170 (LAHBOA (LI . 171 ICONO I(NULL L) NIL) 172 ((NOT (EO (CAAR L) (QUOTE SENURD) L I 173 IT IFINDACTIONS ( C D R D ) D I I 17* 175 176 IOEFPROP PUSHSTK EXPR 177 ILAMBCA IS) 178 ICONS S STACK 111 . 179 180 ' 181 IOEFPROP POPSTX EXPR 182 (LAMBDA NIL 183 ISETO STACK (CDR STACK)))) 184 -IBS 186 IOEFPROP TO EXPR 187 IFLAHBDA (S) 188 (CONO ((NULL STRING) NIL) 189 I t 190 IWEVAL ICOR STRING) ICAR S) SIACK REGS HOLD 195 ICONS STATE :LEVEL))DI) 196 197 198 IOEFPROP JUMP EXPR 199 IFLAMBDA I D 200 IPROG (STRING STATE STACK REGS HOLO) 191 192 193 19* 201, (INITIALIZE) 202 ' I RETURN 203 ICONO ((NOT (EVAL ICAOR L ) ) ) NIL) 20* IT (MAPC (CUOTE EVAL) (COOR L ) l 205 (PTRACE JUMP TO ((CAR L l l l 206 (WEVAL SIR(NG (CAR L) STACK REGS HOLO (CONS STATE : L E V E L ) ) ) ) ) ) ) ) 20T 206 * 2C3 •• (OEFPROP CAT EXPR 210 (FLAMBDA (L) 211 (PROG (STRING STATE STACK REGS HOLO FEATURES) 212 • UNITIALIZE) 213 IRETURN 21* ICONO IINULL STRING) NIL) 215 I IANO (CATEGORY (CAR LI) (EVAL (CADR L I D 216 (PRINTARC ARCTVPE) 217 (APPLY I QUOTE PROGNX) ICDOR LI))))))» 218 219 220 " (DEFPROP PUSHPROGN EXPR 221 (FLAMBDA (L) 222 (COND ((NULL L) (ERROR (ERRORl))) 223 ((NULL (CDR L)) 22* (CONO ((NOT (EO (CAAR L) (QUOTE TOD) (ERROR (ERROR!})) 225 (T (WEVAL STRING (CA3AR I) STACK REGS HOLO (CENS STATE LEV))))) 226 (T (EVAL (CAR LI) (APPLY (QUOTE PUSHPROGN) (CDR L ) l ) ) > ) 22? 228 • • 229 (DEFPROP TRACEPAR5E EXPR 230 (LAMBCA NIL 231 ISETQ :TRACE t i l l 232 - • 233 23* (DEFPROP UNTRACEPARSE EXPR 2)5 I LAMBDA N(L '' 236 (SETQ STRACE NILI)) 237 233 239 (DEFPROP INIT-TRACE EXPR 2+0 (LAMBCA N(L 2*1 (CONO 242 (STRACE (SETQ :TA8 0) • 243 (PRINT [QunTE SENTENCES!! 2*4 (PRINT SENTENCE) 2+5 . (TERPRl))))) 2+6 2+7 248 (OEFPROP PRINTARC EXPR " 249 (LAMBCA (ARCTYPEI 250 (PTRACE TAKING (ARCTYPE (CAR L)) ARC))) 251 252 253 (OEFPROP PRINTPUSH EXPR . . 25* (LAMBCA NIL 255 (SETQ :LEVEL (ADD1 sLEVEL1) . . 256 (AND (PTRACE ABOUT TO PUSH) (SETQ STAB (ADD STAB 2 D D I 257 i 258 259 (DEFPROP PRINTPOP EXPR 260 (LAMBCA NIL . • 261 (SETQ SLEVEL (SUB1 SLEVELD 262 (AND (PTRACE ABDUT TO POP * * (*)! . 263 (SETQ :TAB (SUB STAB 2 ) ) ) ) ) 264 , . 265 266 (DEFPROP PARSE EXPR - • 267 (FLAMBDA (L) 248 (PROG (A :LEVEL sTAB ST) 269 ISETQ SLEVEL 0) 270 (CCND 271 (I MULL (COR I D 272 (PERROR SECOND ARGUMEN7 TO PARSE IS UNSPECIFIED! 273 (RETURN NIL)) 274 (T (SETQ ST (CADR L ) ) ) ) 275 (SETQ A (ERRSET (PARSE1 (CAR 111)1 276 (RETURN (COND ((ATOM A) NIL) (T (CAR A ) ) ) ) ) ) ) 277 273 279 (DEFPROP ERRCR1 EXPR . 280 (LAMBDA NIL 281 I PERROR NO TERMINATING NEXT STATE ACTION ON CURRENT ARCH) 262 283 284 IOEFPROP ERR0R2 EXSR 285 I LAMBDA NIL 286 (PERROR STATE (STATED UNDEFINED))! 287 288 , 289 (OEFPROP HOLCLEVEL EXPR 290 (LAMBDA NIL 291 (COND ((NULL HOLD) T) 292 (IEQ (CAAR HOLD) sLEVEL) NIL! 293 ( T D D 294 - % 295 296 (OEFPROP VIR EXPR 29? (FLAM80A (LI 298 (PROG (STRING STATE STACK REGS HOLO LEV! 299 (INITIALIZE) 300 301 302 303 30* 305 3C* 307 . 308 ' 309. 310 311 312 3t-5 31*. 315 31* 317 318 319 320 321 322 323 32* 325 326 327 328 329 330 331 332 333 33* 335 3 36 337 338 339 3*0 3*1 3*2 3*3 3** 3*5 3*6 3*7 3*8 3*9 350 351 352 353 35* 355 356 357 158 3S9 160 361 162 361 166 165 166 167 168 369 170 171 172 171 17* 175 176 177 178 179 180 181 382 181 38* 385 386 387 3es 369 390 391 392 393 39* 395 396 397 398 399 »C0 (RETURN (CONO ((NULL HOLD) NILI ((ANO ISETO • ICDAR HOLD)) IVIRCATEGOKV (CAR L)) (EVAL (CAOR I I I ) IPRINTARC ARCTYPE) (POPHOLO) (SETO LEV :LEV£LI (APPLY (OUOTE PUSHPROCN) (CCDR L ) ) l ) ) ) ) l (OEFPROP POPHOLO EXPR ILAKBCA NIL (SETQ HOLD (COR HOLO)) (PTRACE POPPING HOLD LIST (*l CURRENT HOLO IS (ICONO IHOLD (COAR HOLD))I)))) (OEFPROP ERR0R3 EXPR (LAMBDA NIL (PERROR NO TEST ON POP ARC OF STATE (STATE)I)) (DEFPROP BLOCKED EXPR (LAMBDA NIL (PTRACE BLOCKED) ISETO =LEVEL ICDR PATH!) : TAB I ADD UEVEL : LEVEL)) ICCND I1CAR PATH1I (PTRACE BACKEO UP TO STATE ((CAR P A T H l l ) ) ) ) ) ) (DEFPROP HOLD EXPR IFLAHBDA (L) (PROG ( A l (SETQ A IEVAL ICAR L I D (PTRACE HOLDING I A D (SETQ HOLO ICDNS ICONS :LEVEL A) HOLD) I D ) [OEFPROP CATEGORY EXPR ' (LAMBOA (CAT) ICOND ([GET LEX CAT) (SETO FEATURES (GETCATFEATUR6SI * (CETROGTI). T) I) I (DEFPROP GETCATFEATURES EXPR I LAMBDA NIL i (PROG IPROPI ISETO PROP (GET LEX CAT!) (CONO • • ; ((ATOM PROP) (RETURN (SELECT CAT IIOUOTE N) (COND (IEO PROP (QUOTE MASS)) (QUOTE ((NUMBER MASS)))) IT (OUOTE ([NUMBER SG ) ) ) ) ) ) IIOUOTE V) ILIST (QUOTE ITNS PRE SENT I) 10U0TE IPNCODE X3SG1) IOUOTE (UNTENSEO)1)) N I L ) ) ) ) (SETO PROP (COR PROP!) (RETURN (COND (IANO (EO CAT (OUOTE V ) ) (ASSQ (QUOTE TNS) PROP) (NOT (ASSQ (OUOTE PNCODE) PRO?))) (CONS (OUOTE (PNCOOE ANYII PROPD (IANO (EQ CAT (CUOTE PROD (NOT (ASSQ [ QUOTE SUBJ) PROPD INOT (ASSQ IQUUTE OBJI PROPID (CONS (QUOTE (SUBJI) PROPD IT PROPID))) IOEFPROP GETROOT EXPR .. (LAMBDA NIL IPROG (PROP) (SETO PROP (GET LEX CAT)) (RETURN (CONO ((NOT (ATOM PROP)) (CAR PROP)) IT L E X ) ) ) ) ) ) IOEFPROP GETF EXPR IFLAHBDA IFEATUREI IPROG ITEMPI ICONO IINOT IEO ARCTYPE (QUOTE CAT))) (ERROR (ERRORS)))) (SETQ TEMP (ASSQ (CAR FEATURE) FEATURES)1 (CONO (TEHP (RETURN (COND ((NULL (COR TEMPI) T) (T (CADR TE M P ) ) ) ) ) ) ) ) ) (OEFPROP V[RCATEGORY EXPR +01 (LAMBCA (CAT) * 0 2 ' (E0 CAT (CAR * ) l | ) + 03 + 0+ +05 (DEFPROP PRINTPARSE EXPR +06 (LAMBCA (PARSE TAB) * 0 7 (CCND ((NULL PARSED i lol I i 4 " " ( C 4 R " « « ) ) ISXIP TAB) (PR1 PARSE) I 1,1 " IPRINTPARSE (CAR PARSE) TAB) Hi IPRINTPARSE (CDR PARSE) TAB) ) ) ) ) + 12 +13 (DEFPROP PR1 EXPR +1+ (LAMBCA (PARSE) * J * (COND ((NULL PARSE) (TERPRlD + 17 !i*{?ERp") P " S E " ' P R ' N 1 ' C 4 R P A " S E " i t , R l , C°» PARSE)))' lit IPRINTPARSE (CAR PARSE) (ADD TAB +)) 1^0 IPRINTPARSE (CDR PARSE) (ADD TAB +}))))) *21 + 22 (DEFPROP 01 SPLAY EXPR +23 (FLAMBDA (L) [SETO :REGS " ? (CAR L) Tf 6. SSTATES ? " (COND ((NULL, (CDR L)) NIL) HI „, ,T 'CA°» >•')»> + 30 + 31 +32 (OEFPROP UNO(SPLAY EXPR +33 (LAMBDA NIL J 3 * (SETQ :REGS NIL ESTATES N I D I ) + 16 +37 (OEFPROP PRINREGS EXPR +38 (LAMBDA (REGLSTI +39 (MAPC **° (QUOTE *JJ (LAHBOA (XI III (PRINl XI ill IPRINI (QUOTE :)) 22. (PR(Nl (GETRV XI) •ill (TERPRl))) J* 6 , REGLST))) ++B **S> (DEFPROP ERROR* EXPR +50 (LAMBDA,NIL * 5 ' IPRINI . •52 [QUOTE I R R I N l > « « N t ? r " * T T e " P T T ° A C D l ° R * 0 M " " W S C V * t U E D AGISTER *'* (SKIP *| * 5 * (PRINl (CAR LI) 111 (PXRINl (QUOTE - ) ) * 5 8 (PRINl A) 1?* (PRINl (QUOTE » STATE -«ll **° (PRINl STATE) •61 (IERPRID) •+62 • 63 +6+ (OEFPROP ACOL EXPR •65 (FLAMBOA (LI **J (PROG - (A 1 * " (SETO A HI 'GETRV (CAR LI I +70 (CONS (CONS (CAR. LI (CCNS (EVAL (CAOR L ) ) A l l REGS)) +71 • ICONO ((AND (ATOM A) (NOT (NULL A D ) (ERROR*) T D D ) + 72 + 73 +7+ (DEFPROP AODR EXPR +75 (FLAMBDA I D -+76 (PROG (A I +77 (SETO A +78 (GETRV ICAR L I ) +79 REGS +60 (CONS ICONS (CAR L) (APPEND A (LIST (EVAL (CAOR L D D ) +B1 R t r . t l l + 82 +81 +8* •85 (OEFPROP GETREGS EXPR +86 (LAMBCA NIL +B7 (PROG (A) +88 (MAPC 489 (QUOTE +40 (LAMBDA (X) +91 ICONO IIMEMQ (CAR X) A l l +42 IT (SETO A (CONS (CAR X) A))) I ) ) +91 REGS) 49* (RETURN A D ) ) *95 *96 497 (OEFPROP PTREGS EXPR *9S (LAMBCA NIL 499 (CONO SCO CREGS EGS))(COND ((ANO (ATOM A) INOT (NULL A I D (ERR0R4I T I I D I 501 ICONO 502 IIOR I NULL :STATESI (MEMO STATE1 :STATES)1 503 ICCNO < »C* 11 NULL tTRACEI 505 IPRINI ICUOTE "STATE »">) 5C6 IPRINI STAIE1) SU7 (TERPRIIII 503 IPRINREGS ICONO KEO :REGS (QUOTE ALL!) (GETREGS)l (T «REGSI 11111111 509 510 . 511 IOEFPROP OICTERR EXPR 512 (LAMBDA NIL 513 (PESROH (ICAR STRINGIII CANNOT BE HORPHEOll) 51* 515 516 (OEFPROP INITIALIZE EXPR 517 ILAMBOA NIL 518 (SETQ STRING 519 STRINGl 520 STATE 521 STATE I 522 STACK 523 STACK1 52* REGS 525 REGSl 526 HOLD 527 H O l D l i n 528 529 530 (DEFPROP 1ST EXPR 531 (FLAM30A (LI 532 [PROG (STRING STATE STACK REGS HOLD! 533 UNITIALIZE) 53* IRETURN 535 (COND ((NULL STRING) NILI , . . 536 IIEVAL (CAR LI I 337 (PRINTARC ARCTYPE) 538 (APPLY (QUOTE PROCNX) (COR L)))>>)>) 539 5*0 5*1 (DEFPROP ERRORS EXPR 5*2 (LAMBDA NIL 5*3 (PERROR ATTEMPT 5** TO 3*5 EVALUATE •><•«• GETF ON NON CAT ARC ARC (ARCTYPE)))) 5*6 5*7 5*8 5*9 550 551 HI CURRENT ill r * T E III (STAT?I " * i " J CURRENT 559 560 561 562 563 (OEFPROP ERRCR6 EXPR 56* (LAM3CA NIL f 6 5 (PERROR ATTEMPT 5 6 6 TO " I SENDR 5 M ON " » NON " ° PUSH 571 «ar 572 . • , ''IH CURRENT lit *»* IS (STATE) ?!S CURRENT III A" 580 m HI (ARCTYPE)lll 583 58* (OEFPROP GLUE EXPR 585 ILAM8CA IX) ICCNO I(NULL X) NIL) 5 8 e 1 1 IMPEND (CAR X) (GLUE (CDR X ) ) ) ) ) ) , •? 589 590 (OEFPROP PERROR EXPR 591 IFLAHBDA ( t L t l J 9 * ITERPRI1 ?!? (PRINl (QUOTE " » » ERROR—-II 59* IMAPC * , S ICUOTE v *** ILAMBDA l i X J ) 598 ' C 0 N D , " E 0 * X» , C U 0 T E ' I I (TERPRI) (TAB 121) "•-599 ((ATOM tx«) (PRINl i x * l ) (T. (MAPC (QUOTE ILAMBDA ( m i (PRINl IEVAL m i l l ) » , * , , , ) ) 160. 6CO U t l *°l (TERPRI))) 602 603 60* (DEFPROP PTRACE EXPR 605 (FLAH8DA (»Li) 606 (CONO 6 0 7 (!TRACE (TERPRI) " ? (SKIP :TAB) 609 610 ( MAPC (OUOTE 611 (LAMBDA (ix») 612 (CONO (IEO 1X1 (QUOTE i l l (TERPRI! tSKIP :TABI1 613 ((ATOM »X») IPRINI »X4)l 61* (T (MAPC (QUOTE (LAMBDA (JYV) (PRINl (EVAL AYS)))) S X t ) ) ) ) ) 615 $LJ> 616 ' (TERPRI1 . 61T T i l l ! 618 619 620 IOEFPROP PPARSE? EXPR 621 ILAMBDA NIL 622 ISETO .-PRINIPARSE (NOT : PR I NT PARSE 1111 623 62* 625 (OEFPROP ERRSEI EXPR 626 (FLAMBOA (SEXPH 627 (LIST (EVAL ICAR SEXPSIUI) 628 629 630 (DEFPROP ERROR EXPR 631 (FLAMBDA (tVALSI 632 IUNEVAL (QUOTE ERRSETI (CAR SVALSIII) 633 63* 635 IOEFPROP ABCRT EXPR 636 (LAMBDA NIL 637 (PTRACE ABORTED) 638. (SETQ 80DY-S (COR BOOY-S)) 639 ICO TAG!II 6*0 6*1 6*2 (OEFPROP IREPLACE EXPR 6*3 (LAMBDA (LST EL Nl 6** I APPEND 1 BUT-NTH LST N) (CONS EL (CDR (NTH LST N i l ) ) ) ! 6*5 6*6 6*7 (DEFPROP BUT-NTH EXPR-6*8 (LAMBDA (L Nl 6*9 ICOND ((EO N I) NIL) 650 IT (CONS (CAR LI IBUI-NTH (COR LI (SUB1 H ) ) I ) I ) J 651 662 653 {DEFPRCP FIN0HE1CHI EXPR • 65* ILAMBOA I XI NO . IT (FIHDPOS STACK X l l l l I 656 ' C 0 N 0 ! i N " " " " n o J , . l " N D . i ! V ! 5 S ' ' "-ENGTH STACK) X) O) ( X I I I 657 658-659 IOEFPROP FINDPOS EXPR 660 (LAMBDA (L ST) 661 (PROG ICNT PTR) 662 (SETQ CNT 0 PTR L) 663 TAG ICOND ((NULL PTR) (RETURN D)) 66* • ((EO (CAAR PTR) ST) (RETURN IA0D1 CNTII) 465 (T (SETQ PTR (COR PTR) CNT IA001 CNTII (GO TAG)))))) 666 667 • 66B IOEFPROP LIFTR EXPR 669 (FLAMBDA (L) 670 (PRCG (HEIGHT TEMPI 671 ICOND 672 ((NULL (CDOR I I I 671 (RETURN (APPLY (QUOTE LIFTR) (APPEND L (LIST 111)11) 67* (SETQ HEIGHT (FINDHglGHT ICAOOR L I ) ) 675 (RETURN 676 ICOND UZEROP HEIGHT)! 677 IT 678 ISETO STACK 679 IlREPLACE STACK 680 ... . • l:REPLACE ISETO TEMP (CAR (NTH STACK HEIGHT! I) 681 * ICONS (CONS (CAR L I (EVAL (CAOR L I ) ) 682 ICAOR TEMP)) • — -'683 21 68* HEIGHT)))))!)) 685 6e6 687 ISETQ JPRIN1PARSE T SREGS NIL) 688 689 690 IUNTRACEPARSE) 691 692 END CF FILE 

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            data-media="{[{embed.selectedMedia}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
https://iiif.library.ubc.ca/presentation/dsp.831.1-0051768/manifest

Comment

Related Items