|
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.util.WordMapping<T>
public class WordMapping<T>
A helper class which provides word mappings. To map String objects,
the default implementation StringMapping can be used.
| Field Summary | |
|---|---|
private Map<Integer,Vector<Integer>> |
indexToSentence
mapping word index -> sentence index |
private Map<Integer,T> |
indexToWord
mapping word index -> word string |
private static long |
serialVersionUID
|
private Map<T,Integer> |
wordToIndex
mapping word string -> word index |
| Constructor Summary | |
|---|---|
WordMapping(Comparator<T> comparator)
|
|
| Method Summary | |
|---|---|
void |
addIndexToSentence(int index,
int sentenceId)
This method is called to register the use of the word wordId in sentence sentenceId. |
Vector<Integer> |
getSentencesOfIndex(int index)
Returns a list of all sequences which contain the word with id wordId. |
T |
getWord(int index)
Returns the word with id wordId |
int |
getWordIndexByObject(T data)
Returns the word id of data |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private final Map<T,Integer> wordToIndex
private final Map<Integer,T> indexToWord
private final Map<Integer,Vector<Integer>> indexToSentence
| Constructor Detail |
|---|
public WordMapping(Comparator<T> comparator)
| Method Detail |
|---|
public void addIndexToSentence(int index,
int sentenceId)
IWordMappingwordId in sentence sentenceId.
addIndexToSentence in interface IWordMapping<T>public Vector<Integer> getSentencesOfIndex(int index)
IWordMappingwordId.
getSentencesOfIndex in interface IWordMapping<T>public T getWord(int index)
IWordMappingwordId
getWord in interface IWordMapping<T>public int getWordIndexByObject(T data)
IWordMappingdata
getWordIndexByObject in interface IWordMapping<T>
|
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 | |||||||||