up
Class SimpleParser

java.lang.Object
  extended by up.SimpleParser
All Implemented Interfaces:
Parser

public class SimpleParser
extends java.lang.Object
implements Parser

A simple chart-based CKY parser.


Constructor Summary
SimpleParser(Grammar grammar)
          Constructs a new parser for the specified grammar.
 
Method Summary
 Tree getBestParse(java.util.List<java.lang.String> tokens)
          Returns a best parse tree for the specified word sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleParser

public SimpleParser(Grammar grammar)
Constructs a new parser for the specified grammar.

Parameters:
grammar - the grammar to be used by this parser
Method Detail

getBestParse

public Tree getBestParse(java.util.List<java.lang.String> tokens)
Description copied from interface: Parser
Returns a best parse tree for the specified word sequence.

Specified by:
getBestParse in interface Parser
Parameters:
tokens - a sequence of word tokens
Returns:
a best parse tree for the specified word sequence, or null if this parser cannot parse the specified sequence