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

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.morphology.WordPart
All Implemented Interfaces:
PersistentObject, SearchDefaults

public class WordPart
extends java.lang.Object
implements PersistentObject, SearchDefaults

A word part.

A word part specifies the word form (lempos) of a part of a word occurrence. Most word occurrences have only one part. Compound words have more than one part. For example, the first word of Hamlet is the contraction "Who's". This word has two parts. The first part is the pronoun "who" with part of speech "pnq", and the second part is the verb "be" with part of speech "vp-3sg.pr".

Word parts have the following attributes:


Constructor Summary
WordPart()
          Creates a new word part.
 
Method Summary
 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.
 BensonLemPos getBensonLemPos()
          Gets the Benson lempos.
 void getGroupingObjects(java.lang.Class groupBy, java.util.List list)
          Gets grouping objects.
 java.lang.Long getId()
          Gets the unique id.
 LemPos getLemPos()
          Gets the lempos.
 int getPartIndex()
          Gets the part index.
 SearchCriterion getSearchDefault(java.lang.Class cls)
          Gets a search criterion default value.
 java.lang.String getTag()
          Gets the tag.
 Word getWord()
          Gets the word.
 WorkPart getWorkPart()
          Gets the work part.
 int hashCode()
          Returns a hash code for the object.
 void setBensonLemPos(BensonLemPos bensonLemPos)
          Sets the Benson lempos.
 void setId(java.lang.Long id)
          Sets the unique id.
 void setLemPos(LemPos lemPos)
          Sets the lempos.
 void setPartIndex(int partIndex)
          Sets the part index.
 void setTag(java.lang.String tag)
          Sets the tag.
 void setWord(Word word)
          Sets the word.
 void setWorkPart(WorkPart workPart)
          Sets the work part.
 java.lang.String toString()
          Gets a string representation of the word part.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WordPart

public WordPart()
Creates a new word part.

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 java.lang.String getTag()
Gets the tag.

Returns:
The tag.

setTag

public void setTag(java.lang.String tag)
Sets the tag.

Parameters:
tag - The tag.

getPartIndex

public int getPartIndex()
Gets the part index.

Returns:
The part index.

setPartIndex

public void setPartIndex(int partIndex)
Sets the part index.

Parameters:
partIndex - The part index.

getWord

public Word getWord()
Gets the word.

Returns:
The word.

setWord

public void setWord(Word word)
Sets the word.

Parameters:
word - The word.

getWorkPart

public WorkPart getWorkPart()
Gets the work part.

Returns:
The work part.

setWorkPart

public void setWorkPart(WorkPart workPart)
Sets the work part.

Parameters:
workPart - The work part.

getLemPos

public LemPos getLemPos()
Gets the lempos.

Returns:
The lempos.

setLemPos

public void setLemPos(LemPos lemPos)
Sets the lempos.

Parameters:
lemPos - The lempos.

getBensonLemPos

public BensonLemPos getBensonLemPos()
Gets the Benson lempos.

Returns:
The Benson lempos.

setBensonLemPos

public void setBensonLemPos(BensonLemPos bensonLemPos)
Sets the Benson lempos.

Parameters:
bensonLemPos - The Benson lempos.

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.

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 word part.

Overrides:
toString in class java.lang.Object
Returns:
The tag plus the part index.

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 word parts are equal if their words and part indexes are equal.

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.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.