public class BaseAdornedWord extends java.lang.Object implements AdornedWord, XCloneable, java.lang.Comparable, java.io.Serializable
An AdornedWord
represents a single word spelling,
symbol, or punctuation mark in text.
An adorned word records the following information.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
lemmata
Lemmata for spelling.
|
protected java.lang.String |
partsOfSpeech
Parts of speech for spelling.
|
protected java.lang.String |
spelling
Corrected spelling.
|
protected java.lang.String |
standardSpelling
Standardized spelling.
|
protected java.lang.String |
token
Token form of spelling.
|
Constructor and Description |
---|
BaseAdornedWord()
Create an empty adorned word.
|
BaseAdornedWord(AdornedWord adornedWord)
Create a adorned word from another adorned word.
|
BaseAdornedWord(java.lang.String spelling)
Create adorned word from a spelling.
|
BaseAdornedWord(java.lang.String spelling,
java.lang.String partsOfSpeech)
Create adorned word from a spelling and a part of speech.
|
BaseAdornedWord(java.lang.String token,
java.lang.String spelling,
java.lang.String partsOfSpeech)
Create adorned word from a token, spelling, and part of speech.
|
BaseAdornedWord(java.lang.String token,
java.lang.String spelling,
java.lang.String standardSpelling,
java.lang.String lemmata,
java.lang.String partsOfSpeech)
Create adorned word from a token, spelling, standard spelling,
lemmata, and parts of speech.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Return a shallow cloned copy of this object.
|
int |
compareTo(java.lang.Object object)
Compare this key with another.
|
boolean |
equals(java.lang.Object object)
Check if another object is equal to this one.
|
java.lang.String |
getLemmata()
Get the lemmata.
|
java.lang.String |
getPartsOfSpeech()
Get the parts of speech.
|
java.lang.String |
getSpelling()
Get the spelling.
|
java.lang.String |
getStandardSpelling()
Get the standard spelling.
|
java.lang.String |
getToken()
Get the original token.
|
int |
hashCode()
Get the hash code of the keys.
|
void |
setLemmata(java.lang.String lemmata)
Set the lemmata.
|
void |
setPartsOfSpeech(java.lang.String partsOfSpeech)
Set the parts of speech.
|
void |
setSpelling(java.lang.String spelling)
Set the spelling.
|
void |
setStandardSpelling(java.lang.String standardSpelling)
Set the standard spelling.
|
void |
setToken(java.lang.String token)
Set the original token.
|
java.lang.String |
toString()
Return a string representation of this object.
|
protected java.lang.String token
protected java.lang.String spelling
protected java.lang.String standardSpelling
protected java.lang.String lemmata
protected java.lang.String partsOfSpeech
public BaseAdornedWord()
public BaseAdornedWord(java.lang.String spelling)
spelling
- The spelling.
The token, the spelling, and the standard spelling are all set the the spelling parameter value.
public BaseAdornedWord(java.lang.String spelling, java.lang.String partsOfSpeech)
spelling
- The spelling.partsOfSpeech
- The part of speech.public BaseAdornedWord(java.lang.String token, java.lang.String spelling, java.lang.String partsOfSpeech)
token
- The token.spelling
- The spelling.partsOfSpeech
- The part of speech.public BaseAdornedWord(java.lang.String token, java.lang.String spelling, java.lang.String standardSpelling, java.lang.String lemmata, java.lang.String partsOfSpeech)
token
- The token.spelling
- The spelling.standardSpelling
- The standard spelling.lemmata
- The lemmata.partsOfSpeech
- The parts of speech.public BaseAdornedWord(AdornedWord adornedWord)
adornedWord
- A adorned word.public java.lang.String getToken()
getToken
in interface AdornedWord
public void setToken(java.lang.String token)
setToken
in interface AdornedWord
token
- The original token.public java.lang.String getSpelling()
getSpelling
in interface AdornedWord
public void setSpelling(java.lang.String spelling)
setSpelling
in interface AdornedWord
spelling
- The spelling.public java.lang.String getStandardSpelling()
getStandardSpelling
in interface AdornedWord
public void setStandardSpelling(java.lang.String standardSpelling)
setStandardSpelling
in interface AdornedWord
standardSpelling
- The standard spelling.public java.lang.String getLemmata()
getLemmata
in interface AdornedWord
Compound lemmata are separated by a separator tring.
public void setLemmata(java.lang.String lemmata)
setLemmata
in interface AdornedWord
lemmata
- The lemmata.public java.lang.String getPartsOfSpeech()
getPartsOfSpeech
in interface AdornedWord
public void setPartsOfSpeech(java.lang.String partsOfSpeech)
setPartsOfSpeech
in interface AdornedWord
partsOfSpeech
- The parts of speech, separated by
a tag set dependent separator
string.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- Other object to test for equality.Two word objects are equal if their spellings, lemmata, and parts of speech are equal.
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
object
- The other CompoundKey.Two word objects are compared first on their spellings, then their lemmata, and finally their parts of speech.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in interface XCloneable
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- which should never happen.