This site's content was compiled from 1993 to 2006. Beyond that, Google is your friend.

Chart Parser

Maintainer

Steven White

Description

The Chart Parser allows natural language to parsed based on a grammar description and a dictionary.

An example program is included, with an example grammar and an English dictionary. The dictionary only needs to contain the root words as the RULES_OF_DETACHMENT class processes plurality and tense.

Once the parser is setup, you can fire a STRING at it and the parser returns an array of successful parses, if any.

Categories

Versions

Links

Details

The parse result is a tree. Included is a utility class called TREE_TO_TEXT which will give a parenthesized representation of the parse. For example the string "the nurses on the report see that they suffer the arrows of outrageous fortune" becomes:

   (S (NP (DET (ART THE)) (NP (N NURSE)) (PP (PREP ON) (NP (DET (ART THE))(NP(N REPORT)))))
    (VP (V SEE) (REL THAT)(S (NP (N (PRO THEY))) (VP (V SUFFER) (NP (DET (ART THE)) (NP (N ARROW)))
    (PP (PREP OF)) (NP (ADJ OUTRAGEOUS) (NP (N FORTUNE)))))))))

Displayed as a tree this is how the parse looks: (this diagram was built manually :-)

         +--------------S--------------+                               
         |                             |
  +------NP------+             +-------VP-------+                         
  |    |         |             |    |           |
 DET   NP     +-PP--+          V   REL   +------S-------+                      
  |    |      |     |          |    |    |              |
 ART   N    PREP  +-NP--+     SEE  THAT  NP      +------VP------+                  
  |    |      |   |     |                |       |              |
 THE NURSE   ON  DET    NP               N       V      +-------NP-------+            
                  |     |                |       |      |     |          |
                 ART    N               PRO    SUFFER  DET    NP   +----PP-----+          
                  |     |                |              |     |    |           |
                 THE  REPORT            THEY           ART    N   PREP     +---NP----+    
                                                        |     |    |       |         |
                                                       THE  ARROW  OF     ADJ        NP    
                                                                           |         |
                                                                       OUTRAGEOUS    N    
                                                                                     |
                                                                                  FORTUNE

Supported compilers

Licensing

Dependencies

Google
 
Web eiffelzone.com