edu.stanford.nlp.parser.oldparser
Class ChartParser

java.lang.Object
  |
  +--edu.stanford.nlp.parser.oldparser.ChartParser

public final class ChartParser
extends Object

ChartParser. This is my haiku about this parser: Chart parser of mine, Experimental but fast, Please parse correctly. That pretty much sums it up.


Field Summary
static boolean ALL_PARSES
          Keep all parses for a sentence in the chart
static boolean BEST_ONLY
          Keep only best edges over a span in a chart, based on edge score
static int BOTTOM_UP
          Argument to constructor: parse bottom up
static boolean EMPTIES_OFF
          Do not place empty nodes in the chart
static boolean EMPTIES_ON
          Place an empty (edu.stanford.nlp.trees.Word.EMPTY at each chart vertex, so that rules with empties on the RHS will parse.
static boolean SCANNER_OFF
          Argument to constructor: place all words into chart on initialization
static boolean SCANNER_ON
          Argument to constructor: scan (shift) words one at a time, as in the original Earley algorithm
static boolean STATISTICS_OFF
          Do not record statistics on Agenda operations
static boolean STATISTICS_ON
          Record some statistics on Agenda operations
static int TOP_DOWN
          Argument to constructor: parse top down
 
Constructor Summary
ChartParser(DFSAGrammar grammar, Lexicon lexicon, int direction, boolean scanMode, boolean statistics, boolean bestOnly)
          Builds a parser for a grammar and lexicon.
ChartParser(DFSAGrammar grammar, Lexicon lexicon, int direction, boolean scanMode, boolean statistics, boolean bestOnly, boolean empties)
          Builds a parser for a grammar and lexicon.
 
Method Summary
 void analyzeChartRelaxation()
           
 void analyzeChartSaturation()
           
 void dumpChart()
           
 List getAllParses(Label label)
           
 List getAllParses(LabeledConstituent c)
           
 Tree getBestParse(Label label)
           
 Tree getBestParse(LabeledConstituent c)
           
 long getNumEdges()
           
 long getNumEdgesAtGoal()
           
 long getNumTraversals()
           
 long getNumTraversalsAtGoal()
           
 void parse(Sentence s, Label goal)
          The basic call for parsing a sentence once the chart structure has been created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOTTOM_UP

public static final int BOTTOM_UP
Argument to constructor: parse bottom up

See Also:
Constant Field Values

TOP_DOWN

public static final int TOP_DOWN
Argument to constructor: parse top down

See Also:
Constant Field Values

SCANNER_ON

public static final boolean SCANNER_ON
Argument to constructor: scan (shift) words one at a time, as in the original Earley algorithm

See Also:
Constant Field Values

SCANNER_OFF

public static final boolean SCANNER_OFF
Argument to constructor: place all words into chart on initialization

See Also:
Constant Field Values

EMPTIES_ON

public static final boolean EMPTIES_ON
Place an empty (edu.stanford.nlp.trees.Word.EMPTY at each chart vertex, so that rules with empties on the RHS will parse.

See Also:
Constant Field Values

EMPTIES_OFF

public static final boolean EMPTIES_OFF
Do not place empty nodes in the chart

See Also:
Constant Field Values

STATISTICS_ON

public static final boolean STATISTICS_ON
Record some statistics on Agenda operations

See Also:
Constant Field Values

STATISTICS_OFF

public static final boolean STATISTICS_OFF
Do not record statistics on Agenda operations

See Also:
Constant Field Values

ALL_PARSES

public static final boolean ALL_PARSES
Keep all parses for a sentence in the chart

See Also:
Constant Field Values

BEST_ONLY

public static final boolean BEST_ONLY
Keep only best edges over a span in a chart, based on edge score

See Also:
Constant Field Values
Constructor Detail

ChartParser

public ChartParser(DFSAGrammar grammar,
                   Lexicon lexicon,
                   int direction,
                   boolean scanMode,
                   boolean statistics,
                   boolean bestOnly)
Builds a parser for a grammar and lexicon.


ChartParser

public ChartParser(DFSAGrammar grammar,
                   Lexicon lexicon,
                   int direction,
                   boolean scanMode,
                   boolean statistics,
                   boolean bestOnly,
                   boolean empties)
Builds a parser for a grammar and lexicon.

Method Detail

getBestParse

public Tree getBestParse(Label label)

getBestParse

public Tree getBestParse(LabeledConstituent c)

getAllParses

public List getAllParses(Label label)

getAllParses

public List getAllParses(LabeledConstituent c)

getNumEdges

public long getNumEdges()

getNumTraversals

public long getNumTraversals()

getNumEdgesAtGoal

public long getNumEdgesAtGoal()

getNumTraversalsAtGoal

public long getNumTraversalsAtGoal()

parse

public void parse(Sentence s,
                  Label goal)
The basic call for parsing a sentence once the chart structure has been created. To parse from the tag level, the easiest supported thing to do is to make lexicon null, and then to pass in a sentence of type TaggedWord.

Parameters:
s - The sentence to be parsed
goal - The Label of the goal

analyzeChartSaturation

public void analyzeChartSaturation()

analyzeChartRelaxation

public void analyzeChartRelaxation()

dumpChart

public void dumpChart()


Stanford NLP Group