up
Class StupidParser

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

public class StupidParser
extends java.lang.Object
implements Parser

A fallback implementation of the Parser interface.


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

Constructor Detail

StupidParser

public StupidParser(Grammar grammar)
Constructs a new parser based on the specified grammar.

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

getBestParse

public Tree getBestParse(java.util.List<java.lang.String> tags)
Returns a dummy parse tree for the specified tag sequence.

Specified by:
getBestParse in interface Parser
Parameters:
tags - a sequence of part-of-speech tags
Returns:
the right-branching binary tree whose leaves are the specified tags, and whose inner nodes are labelled with the root symbol of the grammar