public class SentenceAndWordNumber
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
protected boolean |
eos
The end-of-sentence flag.
|
protected java.lang.String |
id
The word ID.
|
protected int |
ord
The word ordinal.
|
protected java.lang.String |
part
Word part flag.
|
protected int |
sentenceNumber
The sentence number for the word.
|
protected int |
wordNumber
The word number within the sentence.
|
Constructor and Description |
---|
SentenceAndWordNumber(java.lang.String id,
int ord,
java.lang.String part,
boolean eos)
Create SentenceAndWordNumber entry.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object object)
Compare this object with another.
|
boolean |
getEOS()
Get end of sentence flag.
|
java.lang.String |
getID()
Get word ID.
|
int |
getOrd()
Get word ordinal.
|
int |
getSentenceNumber()
Get sentence number for word.
|
int |
getWordNumber()
Get word number in sentence.
|
int |
hashCode()
Hash code is hash value for word ID.
|
boolean |
isFirstPart()
Check if word is first (or only) part of a split word.
|
boolean |
isLastPart()
Check if word is last (or only) part of a split word.
|
boolean |
isMiddlePart()
Check if word is middle (or only) part of a split word.
|
void |
setID(java.lang.String id)
Set word ID.
|
void |
setSentenceAndWordNumber(int sentenceNumber,
int wordNumber)
Set sentence number and word number.
|
java.lang.String |
toString()
Return a string representation of this object.
|
protected java.lang.String id
protected int ord
protected java.lang.String part
N for an unsplit word. I for the the first part of a split word. M for the middle part(s) of a split word. F for the final part of a split word.
protected boolean eos
protected int wordNumber
protected int sentenceNumber
public SentenceAndWordNumber(java.lang.String id, int ord, java.lang.String part, boolean eos)
id
- The word ID.ord
- The word ordinal.part
- The word part flag.eos
- True if word at end of sentence.public void setSentenceAndWordNumber(int sentenceNumber, int wordNumber)
wordNumber
- The word number within the sentence.sentenceNumber
- The sentence number.public java.lang.String getID()
public void setID(java.lang.String id)
id
- The word ID.public int getOrd()
public boolean isFirstPart()
public boolean isMiddlePart()
public boolean isLastPart()
public int getSentenceNumber()
public int getWordNumber()
public boolean getEOS()
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
object
- The other object.We compare the word IDs only.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object