public abstract class Parser extends Object implements Runnable
| Modifier and Type | Field and Description | 
|---|---|
| protected CfgInstance | cfgInstanceThe CFG object that is to be parsed | 
| protected Dictionary | dictionaryDictionary with the Hashtable matching words to parts of speech | 
| protected int | numRulesThe number of rules used to define the context free grammar | 
| protected ParseNode | parseTreeTree representing a successful parse of a phrase | 
| protected static ParseRule[] | ruleSetFixed set of rules that will be used to parse phrases | 
| Constructor and Description | 
|---|
| Parser()Creates a new instance of PhraseParser but does not generate the actual instance | 
| Parser(File inFile)Creates a new instance of Parser | 
| Parser(InputStream inStream)Creates a new instance of Parser | 
| Parser(String fileName)Creates a new instance of Parser | 
| Modifier and Type | Method and Description | 
|---|---|
| protected ArrayList<Integer> | applyRules(int b,
          int c)Applies all of the rules to a portion of the subphrase | 
| protected abstract void | generateRuleSet()Generates the array of production rules that define the CFG | 
| protected String | getToken(ParseNode node,
        int n)Returns the starting token of the portion of the phrase covered by the
 nth generation right child node of this one. | 
| protected ParseNode | parse()Utilizes the CYK algorithm to Generate a parse tree for the phrase | 
| void | run()Implements Runnable
 Recursively parses all of the potential parse trees in the agenda
 using a branch and bound search | 
protected int numRules
protected CfgInstance cfgInstance
protected ParseNode parseTree
protected Dictionary dictionary
protected static ParseRule[] ruleSet
public Parser()
public Parser(String fileName) throws FileNotFoundException
fileName - path to the file to be parsedFileNotFoundExceptionpublic Parser(File inFile) throws FileNotFoundException
inFile - File object from which context free grammar instance is to be readFileNotFoundExceptionpublic Parser(InputStream inStream)
inStream - InputStream from which context free grammar instance is to be readprotected abstract void generateRuleSet()
protected ParseNode parse()
ParseNodeprotected String getToken(ParseNode node, int n)
node - whose successors are being traversedn - generation of the right child whose left child terminal is requiredpublic void run()