edu.northwestern.at.monk.model
Class Lemma

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

public class Lemma
extends CoreObject
implements Feature, java.lang.Comparable<Lemma>

A lemma.

See Also:
MONK Datastore Overview, Licensing Agreement

Nested Class Summary
static class Lemma.Comparator
          A multi-column lemma comparator.
static class Lemma.SortOption
          Lemma sorting options.
 
Method Summary
 int compareTo(Lemma other)
          Compares this instance with another.
static java.util.Collection<Lemma> find(java.util.Collection<SearchCriterion> criteria)
          Finds lemmas.
static java.util.Collection<Lemma> find(SearchCriteria criteria)
          Finds lemmas.
static java.util.Collection<Lemma> find(SearchCriterion... criteria)
          Finds lemmas.
static Lemma get(java.lang.String tag)
          Gets a lemma by tag.
static java.util.Collection<Lemma> getAll()
          Gets all the lemmas.
 java.lang.String getHeadWord()
          Gets the headword.
 int getHomonym()
          Gets the homonym number.
 WordClass getWordClass()
          Gets the word class.
static Lemma[] sort(java.util.Collection<Lemma> collection, Lemma.SortOption... options)
          Sorts a collection of lemmas.
static void sort(Lemma[] array, Lemma.SortOption... options)
          Sorts an array of lemmas.
 
Methods inherited from class edu.northwestern.at.monk.model.TaggedObject
getTag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static Lemma get(java.lang.String tag)
Gets a lemma by tag.

Parameters:
tag - Tag.
Returns:
Work part, or null if none.

getAll

public static java.util.Collection<Lemma> getAll()
Gets all the lemmas.

Returns:
Unmodifiable collection of all the lemmas in case and diacritical-insensitive alphabetical order by tag.

find

public static java.util.Collection<Lemma> find(SearchCriterion... criteria)
                                        throws ModelException
Finds lemmas.

Parameters:
criteria - Search criteria.
Returns:
Collection of lemmas, in an undefined order. If you want the result to be ordered, you must call a sort method.
Throws:
ModelException -
Unable to execute search

find

public static java.util.Collection<Lemma> find(java.util.Collection<SearchCriterion> criteria)
                                        throws ModelException
Finds lemmas.

Parameters:
criteria - Collection of search criteria.
Returns:
Collection of lemmas, in an undefined order. If you want the result to be ordered, you must call a sort method.
Throws:
ModelException -
Unable to execute search

find

public static java.util.Collection<Lemma> find(SearchCriteria criteria)
                                        throws ModelException
Finds lemmas.

Parameters:
criteria - Search criteria.
Returns:
Collection of lemmas, in an undefined order. If you want the result to be ordered, you must call a sort method.
Throws:
ModelException -
Unable to execute search

sort

public static void sort(Lemma[] array,
                        Lemma.SortOption... options)
Sorts an array of lemmas.

Parameters:
array - Array of lemmas.
options - Sort options, or null to use the natural ordering.

sort

public static Lemma[] sort(java.util.Collection<Lemma> collection,
                           Lemma.SortOption... options)
Sorts a collection of lemmas.

Parameters:
collection - Collection of lemmas.
options - Sort options, or null to use the natural ordering.
Returns:
Sorted array of lemmas.

getHeadWord

public java.lang.String getHeadWord()
Gets the headword.

Returns:
The lemma's headword.

getHomonym

public int getHomonym()
Gets the homonym number.

Returns:
The lemma's homonym number, or 0 if the lemma is not a homonym.

getWordClass

public WordClass getWordClass()
Gets the word class.

Returns:
The lemma's word class.

compareTo

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

Lemmas are ordered in case and diacritical-insensitve increasing alphabetical order by tag.

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