|
Parsing Engine | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanbikel.parser.Word
public class Word
A Word object is a structured representation of a word. It includes:
WordFactory,
Words,
WordFeatures,
Serialized Form| Field Summary | |
|---|---|
protected Symbol |
features
A word-feature vector of word. |
protected Symbol |
tag
The part-of-speech of word. |
protected Symbol |
word
The word itself. |
| Constructor Summary | |
|---|---|
protected |
Word()
Constructs a new instance with null for all data members. |
|
Word(Sexp s)
Constructs a word using the symbols contained in the specified S-expression, which must be a list of at least two symbols. |
|
Word(Symbol word,
Symbol tag)
Creates a new Word object with the specified word and part of speech. |
|
Word(Symbol word,
Symbol tag,
Symbol features)
Creates a new Word object with the specified word, part of speech and word-feature vector. |
| Method Summary | |
|---|---|
protected void |
checkSexp(Sexp s)
Checks that the S-expression passed to Word(Sexp) is the right
format. |
Object |
clone()
Returns a clone of this object, which is effectively a deep copy, since all data members of unique Symbol references. |
Word |
copy()
Returns a clone of this object. |
boolean |
equals(Object obj)
Determines whether two Word objects are equal. |
Symbol |
features()
Returns the features of this word, or null if no features
have been set for this word. |
int |
hashCode()
Returns a hash value for this object. |
Word |
set(Symbol word,
Symbol tag,
Symbol features)
Sets all three data members for this word. |
void |
setFeatures(Symbol features)
Sets the features for this word. |
void |
setTag(Symbol tag)
Sets the part-of-speech tag for this word. |
void |
setWord(Symbol word)
Sets the word itself of this Word object. |
Symbol |
tag()
Returns the part-of-speech tag of this word. |
Sexp |
toSexp()
Converts this object to an S-expression. |
String |
toString()
Converts this Word object to a string (in S-expression format). |
Symbol |
word()
Returns the word itself of this Word object. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Symbol word
protected Symbol tag
word.
protected Symbol features
word.
WordFeatures| Constructor Detail |
|---|
protected Word()
null for all data members.
public Word(Symbol word,
Symbol tag)
word - the word itself (all lowercase).tag - its part-of-speech tag.
public Word(Symbol word,
Symbol tag,
Symbol features)
word - the wordtag - the word's part of speechfeatures - the word's feature vector (see WordFeatures)public Word(Sexp s)
features is
left null if the specified list has only two elements).
s - the S-expression from which to construct a new Word
instance; this S-expression must be a SexpList of length
at least two, and containing all Symbol objects as its
elements| Method Detail |
|---|
protected void checkSexp(Sexp s)
Word(Sexp) is the right
format. Throws an IllegalArgumentException if the specified Sexp is not in the right format.
s - the S-expression from which to construct a new Word
instance; this S-expression must be a SexpList of length
at least two, and containing all Symbol objects as its
elementspublic Symbol word()
Word object.
public void setWord(Symbol word)
Word object.
word - the word itselfpublic Symbol tag()
public void setTag(Symbol tag)
tag - the part-of-speech tagpublic Symbol features()
null if no features
have been set for this word.
public void setFeatures(Symbol features)
public Word set(Symbol word,
Symbol tag,
Symbol features)
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectobj - the Word object to compare with.public String toString()
toString in class Objectpublic Object clone()
Symbol references.
clone in class Objectpublic Word copy()
public Sexp toSexp()
SexpConvertible
toSexp in interface SexpConvertible
|
Parsing Engine | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||