ABL4J (Alignment Based Learning for Java) - 0.9.7

org.schwiebert.abl4j.data
Interface IWord<T>

All Known Implementing Classes:
Word

public interface IWord<T>

This class is used to store a "word". In Abl4J, a word can be any java object. Note: Internally, ABL uses Word.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. Default implementation is Word.

Author:
sschwieb

Method Summary
 void addSentenceToWord(int sequenceid)
          Adds the sequence with id sequenceId to this word.
 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.
 

Method Detail

hashCode

int hashCode()
Returns the hashcode of index, which is, as in Integer, the value itself.

Overrides:
hashCode in class Object

equals

boolean equals(Object obj)
Two words are equal, if their indices are equal.

Overrides:
equals in class Object

getIndex

int getIndex()
Returns the index of the word.

Returns:

getWord

T getWord()
Returns the underlying string of the word.

Returns:

getSentenceOccurrences

List<Integer> getSentenceOccurrences()
Returns all sentences which contain this word.


toString

String toString()
Returns a String-representation of this word.

Overrides:
toString in class Object
Returns:

addSentenceToWord

void addSentenceToWord(int sequenceid)
Adds the sequence with id sequenceId to this word.

Parameters:
sequenceid - the id of the sequence

init

void init(int index)
Initialize this word with the given index. That is, the unique represenation of the type of this IWord is mapped to index.

Parameters:
index - the unique identifier of this IWord

ABL4J (Alignment Based Learning for Java) - 0.9.7

© 2007 Stephan Schwiebert