|
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 | |||||||||
public interface IConstituent<T>
An IConstituent is used to store a hypothesis or a nonterminal. A hypothesis is
defined by a begin and end index (in a ISentence) and one or more
NonTerminals. Default implementation: Constituent.
| Method Summary | |
|---|---|
boolean |
add(NonTerminal n)
Adds a NonTerminal to the List of NonTerminals. |
boolean |
addAllNonTerminals(Collection<NonTerminal> nonTerminals)
Adds all NonTerminals. |
void |
clear()
Clears the List of NonTerminals |
boolean |
containsNonTerminal(NonTerminal nonTerminal)
Returns true if the given NonTerminal is already contained in the List of NonTerminals. |
boolean |
empty()
Is the constituent empty (i.e. begin==end)? |
boolean |
equals(Object o)
Two IConstituent are equal, if their boundaries are
equal (this.boundaries.first == o.boundaries.first && this.boundaries.second == o.boundaries.second). |
NonTerminal |
get(int index)
Returns the NonTerminal at Position index. |
double |
getAverageLocalScore()
Returns the average local score of this hypothesis. |
int |
getBeginIndex()
Returns the begin index |
int |
getEndIndex()
Returns the end index |
double |
getHighestLocalScore()
Returns the highest local score of this hypothesis. |
Map<Integer,Double> |
getLocalScoreMap()
Returns the map of local scores, or Collections.EMPTY_MAP,
if no probabilities have been set. |
ISentence<T> |
getSentence()
Returns the sentence to which this constituent belongs to. |
List<IWord<T>> |
getWords()
Returns the list of words the constituent contains. |
int |
hashCode()
|
int |
indexOf(NonTerminal n)
Returns the index of NonTerminal n. |
void |
init(ISentence<T> sentence,
int begin,
int end)
Initializes the NonTerminal. |
void |
mergeNonterminals(NonTerminal n)
Sets the nonterminal of the hypothesis to n |
void |
setLocalScore(int sentenceId,
double score)
Sets the local score of a constituent. |
int |
size()
Returns the number of NonTerminals |
boolean |
valid()
Is the constituent valid (i.e. begin<=end)? |
| Method Detail |
|---|
int getBeginIndex()
int getEndIndex()
boolean empty()
boolean equals(Object o)
IConstituent are equal, if their boundaries are
equal (this.boundaries.first == o.boundaries.first && this.boundaries.second == o.boundaries.second).
equals in class Objectint hashCode()
hashCode in class Objectboolean valid()
void mergeNonterminals(NonTerminal n)
void setLocalScore(int sentenceId,
double score)
sentenceId - score - Map<Integer,Double> getLocalScoreMap()
Collections.EMPTY_MAP,
if no probabilities have been set.
double getAverageLocalScore()
double getHighestLocalScore()
List<IWord<T>> getWords()
ISentence<T> getSentence()
NonTerminal get(int index)
index -
int size()
int indexOf(NonTerminal n)
n -
boolean add(NonTerminal n)
n -
void clear()
boolean addAllNonTerminals(Collection<NonTerminal> nonTerminals)
nonTerminals -
boolean containsNonTerminal(NonTerminal nonTerminal)
nonTerminal -
void init(ISentence<T> sentence,
int begin,
int end)
DataFactory.
sentence - begin - end -
|
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 | |||||||||