edu.northwestern.at.wordhoard.model.morphology
Class Lemma

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.morphology.Lemma
All Implemented Interfaces:
GroupingObject, PersistentObject, SearchCriterion, SearchDefaults, java.io.Serializable

public class Lemma
extends java.lang.Object
implements GroupingObject, PersistentObject, SearchDefaults, SearchCriterion, java.io.Serializable

A lemma.

A lemma is a "head word". Each lemma has the following attributes:

See Also:
Serialized Form

Constructor Summary
Lemma()
          Creates a new lemma.
 
Method Summary
 void appendDescription(TextLine line, FontInfo romanFontInfo, FontInfo[] fontInfo)
          Appends a description to a text line.
 boolean equals(java.lang.Object obj)
          Returns true if some other object is equal to this one.
 void export(TableExporterImporter exporterImporter)
          Exports the object to a MySQL table exporter/importer.
 void getGroupingObjects(java.lang.Class groupBy, java.util.List list)
          Gets grouping objects.
 Spelling getGroupingSpelling(int numHits)
          Gets the spelling of the grouping object.
 int getHomonym()
          Gets the homonym.
 java.lang.Long getId()
          Gets the unique id.
 java.lang.Class getJoinClass()
          Gets the join class.
 java.lang.String getReportPhrase()
          Gets the report phrase.
 SearchCriterion getSearchDefault(java.lang.Class cls)
          Gets a search criterion default value.
 Spelling getSpelling()
          Gets the spelling.
 Spelling getTag()
          Gets the tag.
 Spelling getTagInsensitive()
          Gets the insensitive tag.
 java.lang.String getWhereClause()
          Gets the Hibernate where clause.
 WordClass getWordClass()
          Gets the word class.
 int hashCode()
          Returns a hash code for the object.
 void setArg(org.hibernate.Query q, org.hibernate.Session session)
          Sets the Hibernate query argument.
 void setHomonym(int homonym)
          Sets the homonym.
 void setId(java.lang.Long id)
          Sets the unique id.
 void setSpelling(Spelling spelling)
          Sets the spelling.
 void setTag(Spelling tag)
          Sets the tag.
 void setTagInsensitive(Spelling tagInsensitive)
          Sets the insensitive tag.
 void setWordClass(WordClass wordClass)
          Sets the word class.
 java.lang.String toString()
          Gets a string representation of the lemma.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Lemma

public Lemma()
Creates a new lemma.

Method Detail

getId

public java.lang.Long getId()
Gets the unique id.

Specified by:
getId in interface PersistentObject
Returns:
The unique id.

setId

public void setId(java.lang.Long id)
Sets the unique id.

Parameters:
id - The unique id.

getTag

public Spelling getTag()
Gets the tag.

Returns:
The tag.

setTag

public void setTag(Spelling tag)
Sets the tag.

Parameters:
tag - The tag.

getTagInsensitive

public Spelling getTagInsensitive()
Gets the insensitive tag.

Returns:
The tag with all diacriticals removed and mapped to lower case.

setTagInsensitive

public void setTagInsensitive(Spelling tagInsensitive)
Sets the insensitive tag.

Parameters:
tagInsensitive - The insensitive tag.

getSpelling

public Spelling getSpelling()
Gets the spelling.

Returns:
The spelling of the lemma.

setSpelling

public void setSpelling(Spelling spelling)
Sets the spelling.

Parameters:
spelling - The spelling of the lemma.

getHomonym

public int getHomonym()
Gets the homonym.

Returns:
The homonym.

setHomonym

public void setHomonym(int homonym)
Sets the homonym.

Parameters:
homonym - The homonym.

getWordClass

public WordClass getWordClass()
Gets the word class.

Returns:
The word class.

setWordClass

public void setWordClass(WordClass wordClass)
Sets the word class.

Parameters:
wordClass - Word class.

getSearchDefault

public SearchCriterion getSearchDefault(java.lang.Class cls)
Gets a search criterion default value.

Specified by:
getSearchDefault in interface SearchDefaults
Parameters:
cls - Model class of search criterion.
Returns:
Default value for search criterion.

getReportPhrase

public java.lang.String getReportPhrase()
Gets the report phrase.

Specified by:
getReportPhrase in interface GroupingObject
Returns:
The report phrase "with lemma".

getGroupingSpelling

public Spelling getGroupingSpelling(int numHits)
Gets the spelling of the grouping object.

Specified by:
getGroupingSpelling in interface GroupingObject
Parameters:
numHits - Number of hits.
Returns:
The spelling of the grouping object.

getJoinClass

public java.lang.Class getJoinClass()
Gets the join class.

Specified by:
getJoinClass in interface SearchCriterion
Returns:
The join class, or null if none.

getWhereClause

public java.lang.String getWhereClause()
Gets the Hibernate where clause.

Specified by:
getWhereClause in interface SearchCriterion
Returns:
The Hibernate where clause.

setArg

public void setArg(org.hibernate.Query q,
                   org.hibernate.Session session)
Sets the Hibernate query argument.

Specified by:
setArg in interface SearchCriterion
Parameters:
q - Hibernate query.
session - Hibernate session.

appendDescription

public void appendDescription(TextLine line,
                              FontInfo romanFontInfo,
                              FontInfo[] fontInfo)
Appends a description to a text line.

Specified by:
appendDescription in interface SearchCriterion
Parameters:
line - Text line.
romanFontInfo - Roman font info.
fontInfo - Array of font info indexed by character set.

getGroupingObjects

public void getGroupingObjects(java.lang.Class groupBy,
                               java.util.List list)
Gets grouping objects.

Parameters:
groupBy - Grouping class.
list - A list. The grouping objects are appended to this list.

toString

public java.lang.String toString()
Gets a string representation of the lemma.

Overrides:
toString in class java.lang.Object
Returns:
The tag.

export

public void export(TableExporterImporter exporterImporter)
Exports the object to a MySQL table exporter/importer.

Parameters:
exporterImporter - MySQL table exporter/importer.

equals

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

The two lemmas are equal if their tags are equal.

Specified by:
equals in interface GroupingObject
Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object.
Returns:
True if this object equals the other object.

hashCode

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

Specified by:
hashCode in interface GroupingObject
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.