Patent Publication Number: US-5297040-A

Title: Molecular natural language processing system

Description:
RELATED INSTRUMENT 
     A description of this invention was filed with U.S. Patent Office on Nov. 5, 1990, under Disclosure Document No. 266,308. 
     BACKGROUND--FIELD OF INVENTION 
     This invention relates to a language processing system, and more particularly to a natural language processing system where the syntactic and semantic requirements for each word in the language are specified in a dictionary and processing is done to verify these requirements. 
     BACKGROUND--DESCRIPTION OF PRIOR ART 
     An essential element of any natural language processing system is a parser which can identify the parts-of-speech and phrase boundaries in a sentence. There have been many attempts to create a parser which can process natural language sentences with an unrestricted grammar and vocabulary. However, a finding a satisfactory solution to this problem has proven difficult. A survey of some natural language systems appears in the textbook of Winston, Artificial Intelligence at pages 291-313. Natural language researchers have noted that conventional parsing approaches cannot adequately capture the sentence varieties found in natural languages without becoming unacceptably large and complex. All natural language processing systems heretofore known suffer from a number of disadvantages. 
     (a) Their construction relies on encoding the syntax of the language in a single data which encodes all possible combinations of word order for a well-formed sentence. The data table is commonly referred to as a parse table. Because the number of possible combinations grows exponentially with the number of words in a sentence, the size and complexity of the phase table also grows exponentially. 
     (b) This explosive growth places a practical limit on the vocabulary and syntactic variety a natural language processor can handle. Usually, this limit is far below what would be required for a general purpose natural language processor. 
     (c) Many existing systems can only be used to handle limited language domains. An example of such a system would be a language system which can only handle questions which are about airline reservations. 
     (d) Even if the language domain is restricted to a narrow vocabulary and grammar, these systems are too large and slow to be practical for most personal computing systems. 
     (e) Existing language systems which do handle an unrestricted vocabulary and grammar do not provide a reliable or complete analysis. These language systems typically process a sentence by (1) assigning the parts-of-speech to each word in the sentence by using a probabilistic analysis. (2) examining these parts-of-speech tags to determine the phase and sentence structure. The parts-of-speech tags and phrase structures can then be used to determine if an ungrammatical construction exists in the sentence. Because the parts-of-speech information alone does not indicate how words must combine to form a grammatical sentence, these systems generally cannot detect serious sentence structure errors. This limitation can be demonstrated in commercially available grammar checking products which use this approach. For example, Grammatik IV Version 1.0 can Correct Grammar Version 3.0 fail to detect anything wrong with the following mixed up sentence. 
     &#34;To the get some to walked bread I store.&#34; 
     These grammar checkers failed to notice anything wrong with this sentence because they cannot adequately determine what constitutes a grammatical sequence of words. Correct Grammar uses U.S. Pat. No. 4,864,502 of Henry Kucera filed Sep. 5, 1989. 
     (f) Since existing language processing systems are not sufficiently accurate, they cannot be used to create a comprehensive grammar checking device. 
     (g) The parse tables needed by existing natural language systems are difficult to build and diagnose. Since all of the grammar rules are encoded in a single table, it is difficult to predict the effect of adding a rule to this table. If a new rule is added or an existing rule modified, it could adversely affect every other rule in the table. The parse table can be &#34;broken&#34; very easily. 
     (h) Once a parse table has become &#34;broken&#34;, it is difficult to diagnose the cause. This is become the grammar rules that a person creates for a language system are compiled into a form which is not human readable. They are typically compiled into an efficient finite state automata (FSA). This FSA is then manipulated by a computer in a manner which is far removed from the original grammar rules. This makes it almost impossible to diagnose the effect of individual grammar rules. 
     (i) Existing language systems must use a multi-step process to do semantic analysis. Usually the syntax of the sentence is established, then another step is required to analyze the syntax information to derive the semantic information. Such semantic information would be needed to determine if the subject and verb of a sentence agree in person and number. U.S. Pat. No. 4,914,590 of Loatman et al. filed Apr. 3, 1990 discloses a natural language systems which uses a multi-step process to do semantic analysis. 
     (j) Existing language systems cannot handle words which are not defined. These systems rely on the semantic and syntactic information contained in a dictionary. Without this dictionary information, it is impossible to parse the sentence. 
     (k) Due to the ambiguity contained in a natural language, existing languages systems have difficulty in keeping track of ambiguous sentence constructs. They also have difficulty in backtracking to ambiguous points in the sentence. 
     (l) Existing language systems lack the ability to predict the next word in a sentence based upon the words which have been seen so far. Such an ability to predict the next word would be helpful in determining the definition of an unknown word. It would also be useful for speech recognition and spell checking devices because it would narrow down the possible candidates for the next word. 
     (m) Existing language systems require that the grammar rules be processed into a parse table. This processing step takes a significant amount of time and it slows down the development of a natural language grammar. 
     (n) Existing language systems express their grammar rules in a restrictive manner. Each rule can only express a small fragment of the language syntax. Consequently, an excessive number of rules are required to express the complete syntax of a language. 
     OBJECTS AND ADVANTAGES 
     Accordingly, several objects and advantages of the present invention are: 
     (a) To provide a natural language processing system which eliminates the need to encode grammar rules into a single parse table. 
     (b) To provide a natural language processing system which can accommodate an arbitrary number of grammar rules without becoming excessively complex. 
     (c) To provide a natural language processing system which can accommodate an unrestricted vocabulary and grammar. 
     (d) To provide a natural language processing system which can be easily implemented on personal computing systems. 
     (e) To provide a natural language processing system which can precisely identify the parts-of-speech, phases and word order for a grammatical sentence. 
     (f) To provide a natural language processing system which will provide an improved device for the grammatical analysis of natural language text. 
     (g) To provide a natural language processing system which can be easily modified and maintained. 
     (h) To provide a natural language processing system which can be easily diagnosed if problems occur. 
     To provide a natural language processing system which will provide an improved device for the semantic analysis of natural language text in a single step process. 
     (j) To provide a natural language processing system which can handle undefined words in the language. 
     (k) To provide a natural language processing system which will provide and improve method for resolving ambiguity and backtracking. 
     (l) To provide a natural language processing system which will allow the prediction of the next word based upon the words seen in the sentence so far. 
     (m) To provide a natural language processing system which does not require the grammar rules to be processed in any manner before a sentence can be parsed. 
     (n) To provide a natural language processing system which provides an improved method to express the grammar rules of a language in a compact and easy to understand fashion. 
     Further objects and advantages are to provide general purpose language processing system which can be extended to any natural or computer (e.g. PASCAL, COBOL, etc.) language for any use including (but not limited to) grammar/spell checking, speech recognition, data storage and retrieval, speech and text production, and cognition. Still further objects and advantages will become apparent from a consideration of the ensuring description and drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 shows a network diagram of how word requirements are related in a sentence. 
     FIG. 2 shows a block diagram of one embodiment of the natural language processing apparatus of the present invention. 
     FIG. 3 shows the data contained in the dictionary file. 
     FIG. 4 shows a flow chart of an operation in one embodiment of the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The molecular language processing method is based on the idea that each word in a language is like an atom. Like atoms can join together to form molecules, words can be join together to form sentences. Each word has particular attributes and binding characteristics. These binding characteristics determine if a set of words can attach to each other to form a complete sentence. The molecular language processing system parses a sentence by determining if the binding characteristics of each word in a sentence are satisfied. This is done by examining a word in the sentence and checking if the next word in the sentence can bind to it. A general purpose computer or specialized computing hardware is used to process digitally encoded natural language text and a dictionary file is used to store each word in the language and its binding characteristics. The molecular language processing method can be demonstrated by examining the words in the sentence: 
     &#34;The boy ate food.&#34; 
     First, examine the word &#34;the &#34;. This word is an article which specifies that a particular object is being mentioned. This word cannot stand as a sentence. For example: 
     &#34;The.&#34; 
     would not be considered a complete sentence. The nature of the word &#34;the&#34; requires that some kind of object is logically required. This requirement is satisfied by the next word in the sentence which is &#34;boy&#34;. The sequence of words: 
     &#34;The boy.&#34; 
     is still not a complete sentence. However, this completes a phrase structure since everything that the word &#34;the&#34; required was satisfied and the word &#34;boy&#34; doesn&#39;t need anything more to be logically complete. This phrase structure is commonly referred to as a noun phrase. The reason why a noun phrase cannot form a complete sentence is because sentences usually relate an object to an action. Therefore, the noun phrase logically requires some kind of action. This action is satisfied by the word &#34;ate&#34;. This forms the sequence of words: 
     &#34;The boy ate.&#34; 
     The word &#34;ate&#34; does not logically require anything, so the requirements of all the words are satisfied and a complete sentence is formed. However there is still another word to be considered in the sentence which is &#34;food&#34;. The word &#34;ate&#34; can stand alone as an action but this action infers that there is something which is receiving this action. Therefore an object can be optionally associated with the word &#34;ate&#34;. The object which is receiving the action is the word &#34;food&#34;. This completes the processing of the sentence: &#34;The boy ate food.&#34; 
     All the requirements of the words are satisfied and all of the words can be associated with each other. It can be seen from this example that there can be two kinds of word bindings. 
     1. The word or phrase is absolutely required. For example, the word &#34;the&#34; must have an object and a noun phrase must have an action. 
     2. The word or phrase can be associated with the word, but is optional. For example, the word &#34;ate&#34; can be optionally associated with an object. 
     These bindings form the basic &#34;molecular requirements&#34; of a word. Any information which restricts the kinds of words which can be associated with a word is also part of the molecular requirements for a word. This information can be syntactic or semantic. Syntactic information specifies the order in which words must appear. The syntactic information also determines the kinds of words and phrases which can immediately follow a word. A graph of the words and how the molecular requirements are satisfied is shown in FIG. 1. For example, the word &#34;food&#34; 20 must appear after the word &#34;ate&#34; 16. Semantic requirements specify what can be logically associated with a word. The nature of the word &#34;ate&#34; logically specifies that there is an object to be eaten. The word &#34;THE&#34; 10 is bound to the word &#34;BOY&#34; 12 through the &#34;requires object&#34; binding 14. The word &#34;BOY&#34; 12 is then bound to the word &#34;ATE&#34; 16 through the &#34;requires action&#34; binding 18. Finally, the word &#34;FOOD&#34; 20 is bound to the word &#34;ATE&#34; 16 through an &#34;optionally specify object&#34; binding 22. Thus, by examining each word and its molecular requirements, the molecular natural language processing system verifies that molecular requirements for each word in the sentence are satisfied. 
     The structure in FIG. 1 looks somewhat like a diagram of atoms attached together into a molecule. This structure also represents a useful semantic representation of the sentence. The bindings and the words form a semantic network. This network shows how each word in the sentence is related to each other. The bindings indicate what role each word in the sequence plays. For example, the bindings indicate what is the action taking place and what is the object of the action. A discussion of semantic networks can be found in the textbook of Winston, Artificial Intelligence at pages 314-325. 
     The process of verifying the molecular requirements of each word in a sentence forms a basic implementation of the molecular language processing system. However, there can be many other example embodiments of the invention. 
     EXAMPLE EMBODIMENT OF INVENTION 
     FIG. 2 shows a block diagram of one possible embodiment of the natural language processing apparatus of the present invention. Determining if a sentence is well-formed (grammatical) will be considered here. The language processing apparatus consists of a CPU/Controller 24 which may, for example, be a general purpose computer or specialized computing hardware. The CPU/Controller 24 receives input text 26, e.g., from keyboard entry, a communications link, or a data storage device. This input text may be further divided into words and sentences. The controller 24 then passes the input text to a language processor 32 which processes the input text to determine if it has received a grammatical sequence of words. Parse results, error messages or &#34;prompts&#34; are displayed on display 30. 
     The dictionary 28 includes a record for each word of the language. FIG. 3 shows the dictionary file and some sample records contained in the dictionary. In one particular embodiment of the present invention, the record for each word definition 34 contains five fields. These fields are: 
     1. Keyword (36) 
     This field contains the character string representation of the word to be defined. For example, &#34;apple&#34;, &#34;car&#34;, and &#34;run&#34; could be keyword entries. 
     2. Attributes (38) 
     This field describes the syntactic and semantic properties of the word in the record. Such attributes might include if a word is singular, plural, or first/second/third person. These attributes could be represented by a four letter mnemonic. Such a mnemonic representation is listed in the following table: 
     
         ______________________________________                                    
mnemonic   Description      Example word                                  
______________________________________                                    
noun       Is a noun        thing                                         
verb       Is a verb        ran                                           
adje       Is an adjective  blue                                          
adve       Is an adverb     quickly                                       
sing       Is singluar      car                                           
plur       Is plural        cars                                          
thir       Is third person  they                                          
firs       Is first person  I                                             
seco       Is second person you                                           
subj       Is subjective form                                             
                            he                                            
obje       Is objective form                                              
                            him                                           
______________________________________                                    
 
    
     These attributes can be combined by separating them with commas on a single line. For example, the word &#34;boat&#34; could have an attribute field of: 
     noun,sing,thir 
     This would imply that the word &#34;boat&#34; is a noun and that it is singular and third person. 
     3. Molecular Requirements (40) 
     This unique field indicates what kinds of words and phrases must follow or can be associated with the word in the definition. For example, the word &#34;ate&#34; can typically only be followed by a noun phrase, a prepositional phrase, an adverb, or nothing. Examples of these word usages are: 
     I ate the cake. 
     I ate in the car. 
     I ate quickly. 
     I ate. 
     This just about exhausts the possibilities for the kinds of words that can directly follow the word &#34;ate&#34;. Similarly, the word &#34;put&#34; is typically followed by a noun phrase followed by a prepositional phrase. 
     A suitable syntax is used to express the molecular requirements. One possible embodiment of this syntax is: 
     &lt; &gt; --angle brackets enclose word and phrase tokens 
     / --backslash indicates a list of tokens 
     ! --exclamation indicates required tokens 
     -- --dash represents optional tokens 
     , --commas represent attributes attached to tokens 
     The angle brackets are used to surround the tokens of the syntax. The symbols slash &#34;/&#34;, exclamation &#34;!&#34;, and dash &#34;--&#34; represent optionality flags. These indicate if a token is optional or not. For example, the molecular requirements for the word &#34;ate&#34; can be expressed. 
     &lt;&lt;nounph&gt;/&lt;prepph&gt;/&lt;adve&gt;/&gt;-- 
     The symbols &#34;nounph&#34;, &#34;prepph&#34;, and &#34;adve&#34; are tokens of the syntax. &#34;nounph&#34; and &#34;prepph&#34; are phrase tokens since they represent groups of words and &#34;adve&#34; is a word token since it only represents a single word. Each of these tokens is surrounded by angle brackets to identify them as tokens. The slash &#34;/&#34; indicates that the word &#34;ate&#34; can be followed by either a &lt;nounph&gt; or a &lt;prepph&gt; or an &lt;adve&gt;. The slash allows a list of molecular requirements to be created. The surrounding angle brackets and the optionality flag &#34;--&#34; indicate that none of these tokens are required. 
     The phrase structure tokens &lt;nounph&gt; and &lt;verbph&gt; express the high-level relationship between groups of words. For example, the phrase structure rules for &lt;nounph&gt; and &lt;verbph&gt; could be: ##STR1## 
     The &lt;nounph&gt; phrase structure rule states that a &lt;nounph&gt; consists of an optional adjective followed by a mandatory noun. This was accomplished by placing a dash &#34;--&#34; after &lt;adje&gt; and an exclamation mark &#34;!&#34; after &lt;noun&gt;. The &lt;prepph&gt; rule states that a &lt;prepph&gt; must consist of a preposition followed by a noun phrase. The right hand side of this phrase structure rule is known as the expansion of the phase rule. These phrase structure rules only act as a shorthand. By expanding the rules for &lt;nounph&gt; and &lt;prepph&gt;, the molecular requirements for the word &#34;ate&#34; could be equivalently expressed as: 
     &lt;&lt;&lt;adje&gt;--&lt;noun&gt;!&gt;/&lt;&lt;prep&gt;!&lt;&lt;adje&gt;--&lt;noun&gt;!&gt;!&gt;/&lt;adve&gt;/&gt;-- 
     This is much more difficult to comprehend, so phrase structure rules provide a useful shorthand for expressing molecular requirements. The phrase structure rules also provide a way of specifying the semantic and syntactic requirements for phrases. The semantic requirements are specified by the tokens and optionality flags contained in their expansions. The syntactic requirements are specified by the specific ordering of the tokens within the expansions. For example, within a &#34;nounph&#34;, the &lt;adje&gt; must come before the &lt;noun&gt;. The most basic phrase structure rule specifies the requirements for a complete sentence. A sentence requires an object and an action. This can be expressed as: 
     &lt;sentence&gt;→&lt;nounph&gt;!&lt;verbph&gt;! 
     Another example of a molecular requirement can be examined for the word &#34;put&#34;. The nature of the word &#34;put&#34; indicates that there needs to be an object and a place to put it. Therefore, a &lt;nounph&gt; and &lt;prepph&gt; are semantically required. In English, the &lt;nounph&gt; syntactically comes before &lt;prepph&gt;. Thus, the molecular requirement for the word &#34;put&#34; could be expressed: 
     &lt;nounph&gt;!&lt;prepph&gt;! 
     This compactly expresses the semantic and syntactic molecular requirements for the word &#34;put. If the prepositional phrase were optional, the molecular requirement could be expressed as: 
     &lt;nounph&gt;!&lt;prepph&gt;-- 
     The syntax can become more specific by attaching attributes onto the tokens inside of the angle brackets. For example, to express that a singular, third person noun is required, this can be done by: 
     &lt;noun,sing,thir&gt;! 
     A comma after the token indicates attributes that the token must have in order to match. 
     This syntax is very flexible and can express most any molecular requirement in a compact and easy to understand fashion. It specifies both the syntactic and semantic molecular requirements for each word. The same syntax can also be used to express the syntactic and semantic requirements of phrase structure rules. This syntax description contains many specificities, however, there can be many other possible additions and embodiments of this syntax. 
     4. Alternate definition (42) 
     Since many words have more than one meaning, this field is used to point to the next possible usage of a word. For example, the word &#34;paint&#34;  can be a noun as in &#34;The paint is green.&#34; or it can be a verb as in &#34;I will paint the fence.&#34; The molecular requirements for each of these usages are different, therefore two dictionary entries are required. The record for the noun use of the word &#34;paint&#34; 46 can be entered into the dictionary as &#34;paint&#34;. The alternate definition field of the definition for &#34;paint&#34; 48 will contain a unique keyword/pointer for the verb definition of &#34;paint&#34;. Such a unique keyword can be created by appending numbers onto the end of the word. For example, &#34;paint1&#34; can represent the verb form of the word &#34;paint&#34;. Another dictionary entry 50 would be created for &#34;paint1&#34; as a verb. Thus, a chain of alternate definitions can be created for each word as shown by the record for &#34;paint&#34; 46 pointing to the record for &#34;paint1&#34; 50 in FIG. 3. 
     5. Phrase structure rule or word definition flag (44) 
     The preferred embodiment of the present invention allows both phrase structure rules and word definitions to be stored in exactly the same data structure. This allows phrase structure rules to be stored in the same dictionary database as regular word definition entries. This field indicates if the record is a definition or if it is a structure rule. For words, the type flag 44 indicates that the record is a word definition. The fields are described as above. 
     If this flag is set to indicate that the record is a phrase structure rule 60, then the fields are redefined as shown in record 51. 
     1. Token field (52) 
     Instead of a word of the language, this will contain the token used to represent the phrase structure. Such tokens might be &#34;nounph&#34; and &#34;verbph&#34;. 
     2. Attributes field (54) 
     Instead of containing the attributes of a word, this field contains the attributes of the kind of words that can start the phrase structure. For example, a &lt;nounph&gt; can only be started with an &lt;adje&gt; or a &lt;noun&gt;. Therefore, its attributes field will contain: adje,noun 
     This means that a &lt;nounph&gt; can only be started with an adjective or a noun. 
     3. Expansion field (56) 
     Instead of a word&#39;s requirements, this field contains the expanded phrase structure rule for the phrase. For example, the expansion field for &lt;nounph&gt; would contain: 
     &lt;adje&gt;--&lt;noun&gt;! 
     4. Inheritor field (58) 
     Phrase structure rules can also have attributes appended onto them. For example, a singular noun phrase could be expressed as: 
     &lt;nounph,sing&gt; 
     When the &lt;nounph&gt; is expanded, the attribute &#34;sing&#34; needs to be assigned to a part of the phrase rule expansion. Otherwise, it would be lost. For &lt;nounph&gt;, the inheritor of the attribute should be the &lt;noun&gt;. Therefore, the token &lt;noun&gt; is placed in the inheritor field. The completed expansion for &lt;nounph,sing&gt; would be: 
     &lt;adje&gt;--&lt;noun,sing&gt;! 
     Parsing of a Sentence 
     FIG. 4 shows a flow chart of the processing process used in the present embodiment. The operation is explained with reference to FIG. 4. To demonstrate the operation of the parser, The sentence &#34;The boy ate food.&#34; will be considered. Before processing can begin, the input text is broken into words which can be sequentially analyzed (step 62). The processor uses a First-in Last-out (FILO) stack structure. This structure is similar to a stack of dishes where you remove and add dishes to the top of the stack. The first item placed on this stack is the phrase structure rule for a sentence (step 64). The contents of the stack at this point can be represented as: 
     &lt;sentence&gt;! 
     The stack is then checked to see if the top of the stack contains a phrase structure rule (step 66). This is done by getting the record for the token &#34;sentence&#34; in the dictionary 28 and examining the type field. The record for &#34;sentence&#34; could contain: 
     
         ______________________________________                                    
Token             sentence                                                
Attributes        noun,adje                                               
Expansion         &lt;nounph&gt;!&lt;verbph&gt;!                                      
Inheritor                                                                 
Type              Phrase                                                  
______________________________________                                    
 
    
     Since the token &#34;sentence&#34; is a phrase structure rule, the phrase is expanded (step 68). To do this the phrase rule token is first removed from the stack. The stack will then contain: 
     &lt;&gt;! 
     The phrase structure rule in the Expansion field is then inserted so that the stack will contain: 
     &lt;&lt;nounph&gt;!&lt;verbph&gt;!&gt;! 
     Steps 66 and 68 are repeated since &lt;nounph&gt; is a phrase expansion rule. After &#34;nounph&#34; has been expanded, the result is: 
     &lt;&lt;&lt;adje&gt;-&lt;noun&gt;!&gt;!&lt;verbph&gt;!&gt;! 
     The top of stack contains &lt;adje&gt; which is not a phrase structure rule. &lt;adje&gt; is a token which represents a word. Step 70 checks if a word in the sentence matches the top of the stack. The first word in the example sentence is &#34;the&#34;. The word is looked up in the dictionary 26 and the Attributes are compared to the attributes of &lt;adje&gt;. The record for the word &#34;the&#34; could be: 
     
         ______________________________________                                    
Keyword              the                                                  
Attributes           adje                                                 
Requirements                                                              
Alt. Def.                                                                 
Type                 Definition                                           
______________________________________                                    
 
    
     The attributes for &lt;adje&gt; and &#34;the&#34; match, so a word match is found. Once a match has been found, the top of the stack is removed (step 72). In step 74, the word &#34;the&#34; is checked to determine if the word has any molecular requirements. The molecular requirements for the word &#34;the&#34; have already been expressed by the &lt;nounph&gt; phrase rule. There are no other molecular requirements, so no action is taken. The stack will then contain: 
     &lt;&lt;&lt;noun&gt;!&gt;!&lt;verbph&gt;!&gt;! 
     Step 76 then gets the next word in the sentence which is &#34;boy&#34;. Step 88 returns control to step 66 if there are more words to be processed. The word &#34;boy&#34; is matched up with &lt;noun&gt; in a manner similar to the way &#34;the&#34; was matched with &lt;adje&gt;. The definition for the word &#34;boy&#34; could contain: 
     
         ______________________________________                                    
Keyword            boy                                                    
Attributes         noun,sing,thir                                         
Requirements                                                              
Alt. Def.                                                                 
Type               Definition                                             
______________________________________                                    
 
    
     The top of the stack is removed in step 72 and the stack will then contain: 
     &lt;&lt;verbph&gt;!&gt;! 
     The word &#34;boy&#34; does not have any specific molecular requirements, however, the word &#34;boy&#34; will require that the next verb in the sentence must match in person and number to the word &#34;boy&#34;. This is an agreement among clauses rule in English. To enforce this agreement rule, the attributes which need to match are transferred into the stack structure. The attributes of person and number for the word &#34;boy&#34; can be transferred to the nearest &lt;verbph&gt; in step 74. The stack will then contain: 
     &lt;&lt;verbph,sing,thir&gt;!&gt;! 
     Steps 66 and 68 will expand the phrase rule &lt;verbph&gt;. The stack will then contain: 
     &lt;&lt;&lt;adve&gt;-&lt;verb&gt;!&gt;!&gt;! 
     The &lt;verbph&gt; also had the attributes of &#34;sing,thir&#34; attached to it. The record for the taken &#34;verbph&#34; could be: 
     
         ______________________________________                                    
Token              verbph                                                 
Attributes         adve,verb                                              
Expansion          &lt;adve&gt;-&lt;verb&gt;!                                         
Inheritor          verb                                                   
Type               Phrase                                                 
______________________________________                                    
 
    
     The Inheritor field indicates that the attributes should be transferred to the &lt;verb&gt;. The stack will then contain: 
     &lt;&lt;&lt;adve&gt;1&lt;verb,sing,thir&gt;!&gt;!&gt;! 
     At this point, step 70 will check if the word &#34;ate&#34; matches &lt;adve&gt;. The record for the word &#34;ate&#34; could contain: 
     
         ______________________________________                                    
Keyword       ate                                                         
Attributes    verb,sing,thir                                              
Requirements  &lt;&lt;nounph&gt;/&lt;prepph&gt;/&lt;adve&gt;/&gt;-                                
Alt. Def.                                                                 
Type          Definition                                                  
______________________________________                                    
 
    
     The attributes of &#34;ate&#34; do not match &lt;adve&gt;. Step 78 then checks if the item at the top of the stack was a required item. This is accomplished by examining the optionality flag of the top of the stack. In this case, the flag is a dash. This indicates that the &lt;adve&gt; was optional. If the optionality flag on &lt;adve&gt; was exclamation mark &#34;!&#34;, this would indicate that the &lt;adve&gt; was mandatory and step 80 would determine whether to signal a syntax error in step 84 or to backtrack in step 82. If a syntax error is detected, analysis of the stack can be used to report an error indicative of the syntax error. Backtracking can be done if the parser accepted an ambiguous word. Ambiguous words are usually words which have an alternate definition. Step 82 sets up backtracking by going back to the ambiguous word and restoring the state of the stack to when the ambiguous word was accepted. 
     Since &lt;adve&gt; was not mandatory, processing continues at step 86 which removes &lt;adve&gt;- from the top of the stack. The state of the stack will then be: 
     &lt;&lt;verb,sing,thir&gt;!&gt;! 
     Step 70 will find that the word &#34;ate&#34; does match with the attributes of &#34;verb,sing,thir&#34;. Step 72 will remove the top of the stack. The stack will contain: 
     &lt;&gt;! 
     Step 74 will check if &#34;ate&#34; has any molecular requirements. The word &#34;ate&#34; does have a molecular requirement. This requirement is pushed onto the top of the stack. Step 76 will then get the next word &#34;food&#34;. The stack will then contain: 
     &lt;&lt;&lt;&lt;prepph&gt;/&lt;nounph&gt;/&lt;adve&gt;/&gt;-&gt;!&gt;! 
     Step 66 will check if &lt;prepph&gt; is a phrase structure rule. The record for &lt;prepph&gt; could contain: 
     
         ______________________________________                                    
Token            prepph                                                   
Attributes       prep                                                     
Expansion        &lt;prep&gt;!&lt;nounph&gt;!                                         
Inheritor                                                                 
Type             Phrase                                                   
______________________________________                                    
 
    
     Step 66 can immediately expand the phrase in step 68, but it can take a shortcut by checking if the word which is currently being examined &#34;food&#34; can start the phrase rule. The record for the word &#34;food&#34; could contain: 
     
         ______________________________________                                    
Keyword             food                                                  
Attributes          noun,sing,thir                                        
Requirements                                                              
Alt. Def.                                                                 
Type                Definition                                            
______________________________________                                    
 
    
     The attributes field in the record for the token &#34;prepph&#34; indicates that only a preposition can start a &#34;prepph&#34;. Since the noun &#34;food&#34; cannot start prepph, there is no reason to expand prepph. Instead, the parser can assume that no match was found for prepph. The parser can then skip to step 78 which will examine if the phase was required. 
     The optionality flag on &lt;prepph&gt; is the slash. This indicates that &lt;prepph&gt; is one of many possibilities. Since it is not required, the top of the stack is removed in step 86. This stack will then look like: 
     &lt;&lt;&lt;&lt;nounph&gt;/&lt;adve&gt;/&gt;-&gt;!&gt;! 
     Steps 66 and 68 will expand &lt;nounph&gt; and will result in: 
     &lt;&lt;&lt;&lt;adje&gt;-&lt;noun&gt;!&gt;/&lt;adve&gt;/&gt;-&gt;!&gt;! 
     The top of the stack &lt;adje&gt; doesn&#39;t match &#34;food&#34; and the top of the stack is removed. The stack will then contain: 
     &lt;&lt;&lt;&lt;noun&gt;!&gt;/&lt;adve&gt;/&gt;-&gt;!&gt;! 
     The word &#34;food&#34; will match the top of the stack and step 86 will remove the top of the stack. This will leave: 
     &lt;&lt;&lt;&gt;/&lt;adve&gt;/&gt;-&gt;!&gt;! 
     Since one of the tokens separated by slashes was found, there is no need to examine any of the other tokens delimited by the slashes. The parser only needs to find one of the tokens delimited by the slashes. Therefore, all of the tokens delimited by slashes can be removed in step 72 when the top of the stack is removed. The stack will then contain: 
     &lt;&lt;&lt;&gt;--&gt;!&gt;! 
     Step 88 determines that there are no more tokens left on the stack and that there are no more words to be processed. The parsing process then ends in a successful parse of the sentence &#34;The boy ate food.&#34; 
     There can be many possible embodiments of the molecular language processing system. The above embodiment is optimized for parsing natural languages like English which have a very strict syntax structure. English always places the subject first, the verb second and the object third. However in many other languages such as Korean and Russian, the subject, verb and object can appear in any order. To support these languages, the molecular requirements would still be specified for each word, but the requirements would not specify any specific order for the items in the requirement. This could be accomplished by adding an additional symbol to the molecular requirement syntax. Such a symbol could be an asterisk &#34;*&#34; which would indicate that the item can appear in any order in the sentence. The phrase structure rule for a sentence could be expressed as: 
     &lt;&lt;verbph&gt;!&gt;*&lt;&lt;nounph, subj&gt;!&gt;*&lt;&lt;nounph, obje&gt;!&gt;*&gt;! 
     This rule would assure that the sentence contained a subjective noun phrase, an objective noun phrase and a verb phrase. Instead of always looking at the top of the stack for the next kind of word that is expected, the parser would examine each of phrases marked by the asterisk and phrases could be expanded from the middle or the end of the stack. 
     From the description above, a number of advantages of the molecular language processing system become evident. 
     (a) The need to encode grammar rules by combining them into a single parse table is completely eliminated. An inspection of the preferred embodiment of the invention will reveal that all of the data used to parse the sentence came from independent entries in the dictionary. The data that was used to parse the sentence did not come from a source that represented a combination of data. All grammar rules in the form of phrase structure rules and molecular requirements are expressed independently in the dictionary. 
     (b) Since the grammar rules are expressed independently of each other, the size and complexity of the grammar data grows linearly with the number of rules instead of exponentially. Thus, a large number of grammar rules can be supported without the parser becoming uncontrollably large and complex. 
     (c) Since the complexity of the parser does not significantly rise with the addition of vocabulary or grammar rules, the parser can accommodate an unrestricted vocabulary and grammar. The prototype parser created using the present invention contained over 20,000 words in its vocabulary and over 600 unique molecular requirements and phrase structure rules. 
     (d) The molecular parsing process involves very few steps and can be easily implemented on widely available personal computers. The prototype molecular parser was implemented on an IBM compatible personal computer. The total size of the executable program which included dictionary management routines was only 81,000 bytes. The basic parsing routines account for approximately half of the total size. 
     (e) The molecular parser does not rely on a probabilistic analysis to process natural language. The molecular requirements specify a very precise description of what kinds of words must be found in a sentence and their order in a sentence. 
     (f) Since the molecular parser does a precise analysis of the sentence structure, it provides an ideal basis for a grammar checking device. The prototype molecular parser provided a 90+ percent accuracy in identifying grammatical sentences. 
     (g) Since the grammar rules of the molecular parser are expressed independently of each other, new rules can be added and rules can be modified without the fear that other rules will be broken. 
     (h) The syntax and operation of the molecular parser given in the preferred embodiments were not just a convenient notation to describe the operation. The prototype molecular parser used this syntax exactly. The parser maintained a stack which could be displayed as shown in the example embodiment. By examining this stack structure, grammar problems can be easily diagnosed if they occur. 
     (i) As shown in the preferred embodiments, a useful semantic representation of a sentence can be directly generated by the molecular parsing process. This can be done in a single step without any analysis of any intermediary sentence/data structures. Another example of this single step process can be observed in the preferred embodiments for subject and verb agreement. The conventional two step process would be to: (1) find the main subject and verb by examining the entire sentence (2) check if the subject and verb agree in person and number. The molecular parser accomplishes this in a single step by transferring the person and number attributes to the verb phrase as soon as the main noun is recognized. When the verb phrase is analyzed, the check to see if the subject and verb agree is done when the verb is identified and an error can be reported immediately. The parser doesn&#39;t even have to finish the analysis of the rest of the sentence before reporting an error. 
     (j) Because the molecular requirements explicitly specify the kinds of words and phrases that must follow a word, the molecular parser can handle undefined words by guessing the type of the word based upon the molecular requirements. For example, if the word &#34;blans&#34; was undefined in the sentence &#34;The boy ate blans.&#34;, the requirements for &#34;ate&#34; specify either a noun or prepositional phrase. If it guessed &#34;blans&#34; was a preposition, the parse would fail since a preposition requires another noun phrase. The parser could then backtrack and guess that &#34;blans&#34; was a noun. The parse would succeed in this case. The parser only has to investigate the two possibilities specified by the molecular requirement. 
     (k) The molecular parser simplifies the task of resolving ambiguity and backtracking. The molecular requirements reduce the number of phrase structure rules that must be searched. For example, to determine if a well formed verb phrase was found in other language systems, a comparison against every known verb phrase structure rule would need to be done. This is computationally expensive and leads to ambiguity. To determine if a well formed verb phrase has been found in the molecular parser, the only rule that has to be searched is the molecular requirement of the verb. Backtracking is also simplified since all of the information on the parse is contained on the stack structure. When an ambiguous word is detected, the stack can be easily duplicated. If backtracking needs to be done, the stack can be easily restored to the ambiguous point and parsing can restart. 
     (l) Since the molecular requirements specify the kinds of words that must follow a word, this lends itself to predicting the kind of word that must appear based upon the words seen so far. 
     (m) In the preferred embodiments, the syntax of the molecular requirements was shared by word definitions, phrase rule definitions and by the parser&#39;s stack. Since the syntax used by the parser and the data (words/rules) are identical, no processing of the data is needed before a sentence can be parsed. The parser can simply use the data as typed in by the grammar writer. This eliminates any delay between making a change in the data and then testing it. 
     (n) The syntax of the molecular requirements is compact and easy to understand. In other language systems, phrase structure rules are not expressed with optionality flags. Because of this, they must enumerate every possible combination as a separate rule. For example, a slightly more complex version of a &lt;nounph&gt; could be expressed in a single rule which indicates that a nounph can also have an optional prepositional phrase at the end. 
     &lt;nounph&gt;----&gt;&lt;adje&gt;--&lt;noun&gt;!&lt;prepph&gt;-- 
     Without optionality flags, it would require four separate rules to express the syntax of a &lt;nounph&gt;. These rules would be: ##STR2## 
     Thus, the syntax used to express the molecular requirements is easier to understand and is more compact. 
     SUMMARY, RAMIFICATIONS, AND SCOPE 
     Accordingly, the reader will see that the molecular language processing system of this invention can be used to precisely analyze natural language sentences without any restrictions in vocabulary and grammar. In addition the language system can be easily implemented on personal computers and is easily modified and maintained. The prototype molecular parser created by the inventor is much more complete that the one shown in the preferred embodiments. There are many refinements which can be made to detect grammar errors, implement backtracking, record semantic information and reduce the processing and memory requirements. For example, attributes which indicate past or future case can be added. Additional steps in the parsing algorithm could then check if the sentence maintained a consistent case. Such steps are usually included after a word has been accepted by the parser. Backtracking can also be enhanced by including conjunctions as a backtracking location. More attributes could be added to indicate the semantic role each token in a molecular requirement can play. An important refinement allows the parser to manage implied elements in a sentence. For example, examine the following sentence: 
     The car that John likes is blue. 
     The word &#34;likes&#34; is directly followed by the word &#34;is&#34;. This is unusual because the word &#34;likes&#34; can usually only be followed by a noun phrase as in: 
     John likes the car. 
     Or, the word &#34;likes&#34; can be followed by an infinitive phrase as in: 
     John likes to eat. 
     It would be ungrammatical to follow the word &#34;likes&#34; with a verb phrase as in: 
     John likes is blue. 
     The reason why the word &#34;is&#34; can follow the word &#34;likes&#34; in the sentence &#34;The car that John likes is blue&#34; is because this sentence contains the relative clause &#34;that John likes&#34;. It is implied that &#34;John likes the car&#34;. Yet the words &#34;the car&#34; do not appear after &#34;likes&#34;. Relative clauses can always be missing one noun phrase. To handle this situation in the molecular parser, the parser records when it sees a word which introduces a relative clause. Relative clauses are usually introduced with the word &#34;that&#34;. If the parser finds that a noun phrase cannot be satisfied in a relative clause, it substitutes the subject of the relative clause for the missing noun phrase. This allows the molecular requirements for the word &#34;likes&#34; to be satisfied in a sentence which contains a relative clause. A similar refinement is used to handle implied elements in question sentences. 
     Such refinements have enabled the prototype molecular parser to recognize grammatical sentences with a 90+ percent accuracy. On an IBM PC compatible computer, the prototype program only occupies 81,000 bytes. This level of accuracy and compactness is unprecedented. This was accomplished by satisfying the molecular requirements for each word in the language. Other language processing systems lack the concept that each word is an individual which can have specific syntactic and semantic binding requirements which can be directly used to direct the parse of a sentence. 
     The molecular language processing system solves many of the problems which have thus far prevented the implementation of effective wide-domain natural language applications. Thus, the molecular language processing system represents an enabling technology which can be used to implement any natural language application. 
     Although the description above contains many specificities, these should not be construed as limiting the scope of the invention but as merely providing illustrations of some of the presently preferred embodiments of this invention. For example, the dictionary entries can be compressed by only providing a pointer to an attribute table. All of the possible attribute combinations could be collected into a table. The dictionary entry would just contain a reference to this table of attributes instead of storing the data directly. Such a table would reduce the amount of memory that the dictionary requires since many words share the same set of attributes. This attributes table would not violate the idea that grammar information must not reside in a single table. The attributes table merely serves as a method to compress the data set and is not directly used by the parsing process. Only the complete word definitions/phrase structure rules would provide information directly to the parsing mechanism. There are many methods available for compressing data sets. Some of these methods may require pre-processing. Thus, some advantages (such as not processing the data before a sentence can be parsed) may be negated by such compression schemes. The syntax and the steps taken to manipulate the parser&#39;s stack can also be compressed. Such compression schemes could result in each item on the stack being represented by one or two bytes. The syntax of using brackets &#34;&lt;&#34; &#34;&gt;&#34; and trailing optionality flags could be eliminated in the stack. The use of a stack could also be eliminated. All that is required is a method to verify that the molecular requirements of each word in a sentence are satisfied. 
     Thus the scope of the invention should be determined by the appended claims and their legal equivalents, rather than by the examples given.