edu.northwestern.at.monk.model
Class WordPart

java.lang.Object
  extended by edu.northwestern.at.monk.model.WordPart
All Implemented Interfaces:
java.lang.Comparable<WordPart>

public class WordPart
extends java.lang.Object
implements java.lang.Comparable<WordPart>

A word part.

See Also:
MONK Datastore Overview, Licensing Agreement

Method Summary
 int compareTo(WordPart other)
          Compares this instance with another.
 boolean equals(java.lang.Object obj)
          Returns true if this object equals some other object.
static java.lang.String formatAsString(WordPart... wordParts)
          Formats a sequence of word parts as a string.
 Lemma getLemma()
          Gets the lemma.
 Pos getPos()
          Gets the part of speech.
 Word getWord()
          Gets the word.
 int hashCode()
          Returns a hash code for this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWord

public Word getWord()
Gets the word.

Returns:
The word to which the word part belongs.

getLemma

public Lemma getLemma()
Gets the lemma.

Returns:
The lemma of the word part.

getPos

public Pos getPos()
Gets the part of speech.

Returns:
The part of speech of the word part.

formatAsString

public static java.lang.String formatAsString(WordPart... wordParts)
Formats a sequence of word parts as a string.

Parameters:
wordParts - Sequence of contiguous word parts.
Returns:
Word sequence for word parts formatted as a string, with punctuation, and with lime breaks represented by " / ".

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(WordPart other)
Compares this instance with another.

Word parts are ordered by lemmma first, then by pos.

Specified by:
compareTo in interface java.lang.Comparable<WordPart>
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.