|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.wordhoard.model.Word
public class Word
A word occurrence.
A word records an occurrence of a specific word in a specific work at a specific location. Each word occurrence has the following attributes:
work part
in which the word occurs.
work
in which the word occurs.
line
in which the word occurs. This attribute may be null.
location
of the word in the text for the work part.
word parts
for this word occurrence.
speech
in which the word occurs, or null if none.
prosodic
attribute.
metrical shape
attribute.
The tag is required. It permanently and uniquely identifies the word occurrence across all corpora. It may be used to refer to the word from outside the object model. It is guaranteed not to change across versions of the object model. For example, the tag for the first word in Hamlet Act 3, Scene 2 is "sha-ham30200101".
Constructor Summary | |
---|---|
Word()
Creates a new word. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object obj)
Implement Comparable interface. |
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. |
Spelling |
getBriefDescription()
Gets a brief description of a word. |
long |
getColocationOrdinal()
Gets the colocation ordinal. |
java.util.List |
getGroupingObjects(java.lang.Class groupBy,
int partIndex)
Gets grouping objects. |
java.lang.Long |
getId()
Gets the unique id. |
Line |
getLine()
Gets the line. |
TextRange |
getLocation()
Gets the word location. |
MetricalShape |
getMetricalShape()
Gets the metrical shape. |
Word |
getNext()
Gets the next word. |
java.lang.String |
getPath()
Gets the path. |
Word |
getPrev()
Gets the previous word. |
Prosodic |
getProsodic()
Gets the prosodic attribute. |
java.lang.String |
getPuncAfter()
Gets the punctuation following the word. |
java.lang.String |
getPuncBefore()
Gets the punctuation preceding the word. |
SearchCriterion |
getSearchDefault(java.lang.Class cls)
Gets a search criterion default value. |
Speech |
getSpeech()
Gets the speech. |
Spelling |
getSpelling()
Gets the spelling. |
Spelling |
getSpellingInsensitive()
Gets the insensitive spelling. |
java.lang.String |
getTag()
Gets the tag. |
java.util.List |
getWordParts()
Gets the word parts. |
Work |
getWork()
Gets the work. |
int |
getWorkOrdinal()
Gets the work ordinal. |
WorkPart |
getWorkPart()
Gets the work part. |
java.lang.String |
getWorkTag()
Gets the work tag. |
int |
hashCode()
Returns a hash code for the object. |
void |
initDerivedValues()
Initializes derived values. |
void |
setId(java.lang.Long id)
Sets the unique id. |
void |
setLine(Line line)
Sets the line. |
void |
setLocation(TextRange location)
Sets the word location. |
void |
setMetricalShape(MetricalShape metricalShape)
Sets the metrical shape. |
void |
setMetricalShape(java.lang.String metricalShape)
Sets the metrical shape. |
void |
setNext(Word next)
Sets the next word. |
void |
setPrev(Word prev)
Sets the previous word. |
void |
setProsodic(byte prosodic)
Sets the prosodic attribute. |
void |
setProsodic(Prosodic prosodic)
Sets the prosodic attribute. |
void |
setPuncAfter(java.lang.String puncAfter)
Sets the punctuation following the word. |
void |
setPuncBefore(java.lang.String puncBefore)
Sets the punctuation preceding the word. |
void |
setSpeech(Speech speech)
Sets the speech. |
void |
setSpelling(Spelling spelling)
Sets the spelling. |
void |
setTag(java.lang.String tag)
Sets the tag. |
void |
setWorkOrdinal(int workOrdinal)
Sets the work ordinal. |
void |
setWorkPart(WorkPart workPart)
Sets the work part. |
void |
setWorkTag(java.lang.String workTag)
Sets the work tag. |
java.lang.String |
toString()
Gets a string representation of the word. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Word()
Method Detail |
---|
public java.lang.Long getId()
getId
in interface PersistentObject
public void setId(java.lang.Long id)
id
- The unique id. public Spelling getSpelling()
public void setSpelling(Spelling spelling)
This method also sets the spelling mapped to lower case.
spelling
- The spelling. public Spelling getSpellingInsensitive()
public WorkPart getWorkPart()
public void setWorkPart(WorkPart workPart)
This method also sets the work.
workPart
- The work part. public Work getWork()
public Line getLine()
public void setLine(Line line)
line
- The line. public java.lang.String getPath()
public java.lang.String getTag()
public void setTag(java.lang.String tag)
tag
- The tag. public TextRange getLocation()
public void setLocation(TextRange location)
location
- The word location in the part text. public java.lang.String getPuncBefore()
public void setPuncBefore(java.lang.String puncBefore)
puncBefore
- The punctuation preceding the word. public java.lang.String getPuncAfter()
public void setPuncAfter(java.lang.String puncAfter)
puncAfter
- The punctuation following the word. public Word getPrev()
public void setPrev(Word prev)
prev
- The previous word. public Word getNext()
public void setNext(Word next)
next
- The next word. public java.util.List getWordParts()
public java.lang.String getWorkTag()
public void setWorkTag(java.lang.String workTag)
workTag
- The work tag. public int getWorkOrdinal()
public void setWorkOrdinal(int workOrdinal)
workOrdinal
- The ordinal of the word within the work. public long getColocationOrdinal()
public Speech getSpeech()
public void setSpeech(Speech speech)
speech
- The speech, or null if none. public Prosodic getProsodic()
public void setProsodic(Prosodic prosodic)
prosodic
- The prosodic attibute. public void setProsodic(byte prosodic)
prosodic
- The prosodic attibute. public MetricalShape getMetricalShape()
public void setMetricalShape(MetricalShape metricalShape)
metricalShape
- The metrical shape. public void setMetricalShape(java.lang.String metricalShape)
metricalShape
- The metrical shape. public void initDerivedValues()
Sets the colocation ordinal to partId << 32 | workOrdinal, where partId = the persistence id of the work part. The work part and work ordinal must be set, and the work part must have a persistence id.
Sets the word path. The line and work part must be set.
public SearchCriterion getSearchDefault(java.lang.Class cls)
getSearchDefault
in interface SearchDefaults
cls
- Model class of search criterion.
public java.util.List getGroupingObjects(java.lang.Class groupBy, int partIndex)
Returns the grouping object(s) for the word given a grouping class and a word part index.
groupBy
- Grouping class.partIndex
- Part index, or -1 if none.
public Spelling getBriefDescription()
Returns a brief one line description of the word, suitable for display in a tool tip or as a footnote.
For compound words (words with more than one part), the brief description is simply "compound word".
Otherwise, if a Benson gloss is available, the description includes his lemma, part of speech, and definition.
Otherwise, the description includes the lemma word and part of speech.
public java.lang.String toString()
toString
in class java.lang.Object
public void export(TableExporterImporter exporterImporter)
exporterImporter
- MySQL table exporter/importer. public boolean equals(java.lang.Object obj)
The two words are equal if their work parts and tags are equal.
equals
in class java.lang.Object
obj
- The other object.
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
obj
- Other word object to which to compare this object.
The word tag is used for comparison.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |