Parsing Engine

danbikel.parser
Class DefaultWordFactory

java.lang.Object
  extended by danbikel.parser.DefaultWordFactory
All Implemented Interfaces:
WordFactory

public class DefaultWordFactory
extends Object
implements WordFactory

The default—and currently only—implementation of WordFactory. This factory constructed Word instances.


Constructor Summary
DefaultWordFactory()
          Creates a word factory for constructing Word objects.
 
Method Summary
 Word get(Sexp s)
          Constructs a Word object from the specified S-expression, which must be a list of length 2 or greater, where the first two elements are symbols.
 Word get(Symbol word, Symbol tag)
          Constructs a Word object from the specified symbols.
 Word get(Symbol word, Symbol tag, Symbol features)
          Constructs a Word object from the specified symbols.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWordFactory

public DefaultWordFactory()
Creates a word factory for constructing Word objects.

Method Detail

get

public Word get(Sexp s)
Description copied from interface: WordFactory
Constructs a Word object from the specified S-expression, which must be a list of length 2 or greater, where the first two elements are symbols. The first symbol is the actual word, the second its part-of-speech tag and a third, if present, is the word's features-vector.

Specified by:
get in interface WordFactory
Parameters:
s - the S-expression from which to construct a Word object
Returns:
a new Word object
See Also:
WordFeatures

get

public Word get(Symbol word,
                Symbol tag)
Description copied from interface: WordFactory
Constructs a Word object from the specified symbols.

Specified by:
get in interface WordFactory
Parameters:
word - the word itself
tag - the word's part-of-speech tag
Returns:
a new Word object

get

public Word get(Symbol word,
                Symbol tag,
                Symbol features)
Description copied from interface: WordFactory
Constructs a Word object from the specified symbols.

Specified by:
get in interface WordFactory
Parameters:
word - the word itself
tag - the word's part-of-speech tag
features - the word's feature vector
Returns:
a new Word object
See Also:
WordFeatures

Parsing Engine

Author: Dan Bikel.