edu.northwestern.at.wordhoard.swing.calculator.modelutils
Class LemmaUtils

java.lang.Object
  extended by edu.northwestern.at.wordhoard.swing.calculator.modelutils.LemmaUtils

public class LemmaUtils
extends java.lang.Object

Lemma utilities.


Constructor Summary
protected LemmaUtils()
          Don't allow instantiation but do allow overrides.
 
Method Summary
static Lemma getLemmaByTag(java.lang.String lemmaTag)
          Get lemma from its tag.
static Lemma[] getLemmata(java.util.Collection words)
          Get lemmata corresponding to a batch of words.
static Lemma[] getLemmata(Word[] words)
          Get lemmata corresponding to a batch of words.
static Lemma[] getLemmata(Work work)
          Get lemmata for all words in a work.
static Lemma[] getLemmataByInitialString(java.lang.String initialString)
          Finds lemmas by matching an initial string of characters.
static boolean lemmaExists(java.lang.String lemmaText)
          See if specified lemma exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LemmaUtils

protected LemmaUtils()
Don't allow instantiation but do allow overrides.

Method Detail

lemmaExists

public static boolean lemmaExists(java.lang.String lemmaText)
See if specified lemma exists.

Parameters:
lemmaText - The lemma text.
Returns:
true if lemma with lemma text exists, false otherwise.

getLemmataByInitialString

public static Lemma[] getLemmataByInitialString(java.lang.String initialString)
Finds lemmas by matching an initial string of characters.

Parameters:
initialString - The initial lemma text string.
Returns:
An array of matching lemma objects whose tags begin with the specified text. Null if none.

getLemmaByTag

public static Lemma getLemmaByTag(java.lang.String lemmaTag)
Get lemma from its tag.

Parameters:
lemmaTag - The lemma tag.
Returns:
The lemma.

getLemmata

public static Lemma[] getLemmata(Work work)
Get lemmata for all words in a work.

Parameters:
work - The work.
Returns:
Array of Lemma.

The lemmata are returned in the same order as the words appear in the work. In general, there will be more lemmata than words, since each word can have more than one associated lemma. For example, "can't" has two lemmata, "can" and "not".


getLemmata

public static Lemma[] getLemmata(java.util.Collection words)
Get lemmata corresponding to a batch of words.

Parameters:
words - Collection of Word entries.
Returns:
Array of Lemma.

The lemmata are returned in the same order as the entries in the words collection In general, there will be more lemmata than words, since each word can have more than one associated lemma. For example, "can't" has two lemmata, "can" and "not".


getLemmata

public static Lemma[] getLemmata(Word[] words)
Get lemmata corresponding to a batch of words.

Parameters:
words - Array of Word.
Returns:
Array of Lemma.

The lemmata are returned in the same order as the entries in the words array. In general, there will be more lemmata than words, since each word can have more than one associated lemma. For example, "can't" has two lemmata, "can" and "not".