edu.northwestern.at.utils.corpuslinguistics.adornedword
Class BaseAdornedWord

java.lang.Object
  extended by edu.northwestern.at.utils.corpuslinguistics.adornedword.BaseAdornedWord
All Implemented Interfaces:
AdornedWord, XCloneable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
AdornedWordCountInfo, ExtendedAdornedWord

public class BaseAdornedWord
extends java.lang.Object
implements AdornedWord, XCloneable, java.lang.Comparable, java.io.Serializable

A word adorned with addition morphological information.

An AdornedWord represents a single word spelling, symbol, or punctuation mark in text.

An adorned word records the following information.

See Also:
Serialized Form

Field Summary
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.
protected  int tokenType
          Token type.
 
Constructor Summary
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 partOfSpeech)
          Create adorned word from a spelling and a part of speech.
BaseAdornedWord(java.lang.String token, java.lang.String spelling, java.lang.String partOfSpeech)
          Create adorned word from a token, spelling, and part of speech.
 
Method Summary
 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 getTokenType()
          Get the token type.
 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.
 void setTokenType(int tokenType)
          Set the token type.
 java.lang.String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

token

protected java.lang.String token
Token form of spelling.


spelling

protected java.lang.String spelling
Corrected spelling.


standardSpelling

protected java.lang.String standardSpelling
Standardized spelling.


lemmata

protected java.lang.String lemmata
Lemmata for spelling.


partsOfSpeech

protected java.lang.String partsOfSpeech
Parts of speech for spelling.


tokenType

protected int tokenType
Token type.

Constructor Detail

BaseAdornedWord

public BaseAdornedWord()
Create an empty adorned word.


BaseAdornedWord

public BaseAdornedWord(java.lang.String spelling)
Create adorned word from a spelling.

Parameters:
spelling - The spelling.

The token, the spelling, and the standard spelling are all set the the spelling parameter value.


BaseAdornedWord

public BaseAdornedWord(java.lang.String spelling,
                       java.lang.String partOfSpeech)
Create adorned word from a spelling and a part of speech.

Parameters:
spelling - The spelling.
partOfSpeech - The part of speech.

BaseAdornedWord

public BaseAdornedWord(java.lang.String token,
                       java.lang.String spelling,
                       java.lang.String partOfSpeech)
Create adorned word from a token, spelling, and part of speech.

Parameters:
token - The token.
spelling - The spelling.
partOfSpeech - The part of speech.

BaseAdornedWord

public BaseAdornedWord(AdornedWord adornedWord)
Create a adorned word from another adorned word.

Parameters:
adornedWord - A adorned word.
Method Detail

getToken

public java.lang.String getToken()
Get the original token.

Specified by:
getToken in interface AdornedWord
Returns:
The original token.

setToken

public void setToken(java.lang.String token)
Set the original token.

Specified by:
setToken in interface AdornedWord
Parameters:
token - The original token.

getSpelling

public java.lang.String getSpelling()
Get the spelling.

Specified by:
getSpelling in interface AdornedWord
Returns:
The spelling.

setSpelling

public void setSpelling(java.lang.String spelling)
Set the spelling.

Specified by:
setSpelling in interface AdornedWord
Parameters:
spelling - The spelling.

getStandardSpelling

public java.lang.String getStandardSpelling()
Get the standard spelling.

Specified by:
getStandardSpelling in interface AdornedWord
Returns:
The standard spelling.

setStandardSpelling

public void setStandardSpelling(java.lang.String standardSpelling)
Set the standard spelling.

Specified by:
setStandardSpelling in interface AdornedWord
Parameters:
standardSpelling - The standard spelling.

getLemmata

public java.lang.String getLemmata()
Get the lemmata.

Specified by:
getLemmata in interface AdornedWord
Returns:
The lemmata.

Compound lemmata are separated by a separator tring.


setLemmata

public void setLemmata(java.lang.String lemmata)
Set the lemmata.

Specified by:
setLemmata in interface AdornedWord
Parameters:
lemmata - The lemmata.

getPartsOfSpeech

public java.lang.String getPartsOfSpeech()
Get the parts of speech.

Specified by:
getPartsOfSpeech in interface AdornedWord
Returns:
The parts of speech.

setPartsOfSpeech

public void setPartsOfSpeech(java.lang.String partsOfSpeech)
Set the parts of speech.

Specified by:
setPartsOfSpeech in interface AdornedWord
Parameters:
partsOfSpeech - The parts of speech, separated by a tag set dependent separator string.

getTokenType

public int getTokenType()
Get the token type.

Specified by:
getTokenType in interface AdornedWord
Returns:
The token type.

setTokenType

public void setTokenType(int tokenType)
Set the token type.

Specified by:
setTokenType in interface AdornedWord
Parameters:
tokenType - The token type.

equals

public boolean equals(java.lang.Object object)
Check if another object is equal to this one.

Overrides:
equals in class java.lang.Object
Parameters:
object - Other object to test for equality.
Returns:
true if other object is equal to this one.

Two word objects are equal if their spellings, lemmata, and parts of speech are equal.


compareTo

public int compareTo(java.lang.Object object)
Compare this key with another.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - The other CompoundKey.
Returns:
-1, 0, 1 depending opne whether this adorned word is less than, equal to, or greater than another adorned word.

Two word objects are compared first on their spellings, then their lemmata, and finally their parts of speech.


hashCode

public int hashCode()
Get the hash code of the keys.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.

toString

public java.lang.String toString()
Return a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object = original spelling.

clone

public java.lang.Object clone()
Return a shallow cloned copy of this object.

Specified by:
clone in interface XCloneable
Overrides:
clone in class java.lang.Object
Returns:
Shallow clone of this object.
Throws:
java.lang.CloneNotSupportedException - which should never happen.