|
ABL4J (Alignment Based Learning for Java) - 0.9.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.schwiebert.abl4j.data.impl.abl.Word<T>
public final class Word<T>
This class is used to store a "word".
In Abl4J, a word can be any java object. Note: Internally, ABL uses
index to determine the equality of two words. The index is generated
with the help of WordMapping and requires that Object.equals(Object)
and Object.hashCode() are overwritten properly.
| Field Summary | |
|---|---|
private int |
index
index of current word |
private static long |
serialVersionUID
|
static int |
UNDEF
|
| Constructor Summary | |
|---|---|
Word()
|
|
| Method Summary | |
|---|---|
void |
addSentenceToWord(int sentenceId)
This method registers the use of the current word in a sentence specified with parameter "sentenceId". |
boolean |
equals(Object obj)
Two words are equal, if their indices are equal. |
int |
getIndex()
Returns the index of the word. |
List<Integer> |
getSentenceOccurrences()
Returns all sentences which contain this word. |
T |
getWord()
Returns the underlying string of the word. |
int |
hashCode()
Returns the hashcode of index, which is,
as in Integer, the value itself. |
void |
init(int index)
Initialize this word with the given index. |
String |
toString()
Returns a String-representation of this word. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
public static final int UNDEF
private int index
| Constructor Detail |
|---|
public Word()
| Method Detail |
|---|
public int hashCode()
IWordindex, which is,
as in Integer, the value itself.
hashCode in interface IWord<T>hashCode in class Objectpublic boolean equals(Object obj)
IWord
equals in interface IWord<T>equals in class Objectpublic void init(int index)
IWordIWord
is mapped to index.
init in interface IWord<T>index - the unique identifier of this IWordpublic int getIndex()
IWord
getIndex in interface IWord<T>public T getWord()
IWord
getWord in interface IWord<T>public void addSentenceToWord(int sentenceId)
addSentenceToWord in interface IWord<T>sentenceId - the id of the sequencepublic List<Integer> getSentenceOccurrences()
IWord
getSentenceOccurrences in interface IWord<T>public String toString()
IWordString-representation of this word.
toString in interface IWord<T>toString in class Object
|
ABL4J (Alignment Based Learning for Java) - 0.9.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||