edu.northwestern.at.monk.model
Class WordForm

java.lang.Object
  extended by edu.northwestern.at.monk.model.ComboFeature
      extended by edu.northwestern.at.monk.model.WordForm
All Implemented Interfaces:
Feature, java.lang.Comparable<WordForm>

public class WordForm
extends ComboFeature
implements Feature, java.lang.Comparable<WordForm>

A word form combination feature.

See Also:
MONK Datastore Overview, Licensing Agreement

Constructor Summary
WordForm(Lemma lemma, Pos pos, Spelling spelling)
          Creates a new word form.
 
Method Summary
 int compareTo(WordForm other)
          Compares this instance with another.
 boolean equals(java.lang.Object obj)
          Returns true if this object equals some other object.
 Lemma getLemma()
          Gets the lemma.
 Pos getPos()
          Gets the part of speech.
 Spelling getSpelling()
          Gets the spelling.
 int hashCode()
          Returns a hash code for this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordForm

public WordForm(Lemma lemma,
                Pos pos,
                Spelling spelling)
Creates a new word form.

Parameters:
lemma - Lemma.
pos - Part of speech.
spelling - Spelling.
Method Detail

getLemma

public Lemma getLemma()
Gets the lemma.

Returns:
Lemma.

getPos

public Pos getPos()
Gets the part of speech.

Returns:
Part of speech.

getSpelling

public Spelling getSpelling()
Gets the spelling.

Returns:
Spelling.

equals

public boolean equals(java.lang.Object obj)
Returns true if this object equals some other object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Other object.
Returns:
True if this object equals the other object.

hashCode

public int hashCode()
Returns a hash code for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code.

compareTo

public int compareTo(WordForm other)
Compares this instance with another.

Word forms are ordered by lemmma first, then by pos, then by case and diacritical-insensitive spelling.

Specified by:
compareTo in interface java.lang.Comparable<WordForm>
Parameters:
other - The other instance to be compared.
Returns:
A negative integer, zero, or a positive integer as this instance is less than, equal to, or greater than the specified instance.