ABL4J (Alignment Based Learning for Java) - 0.9.7

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

All Superinterfaces:
ISentence<T>
All Known Implementing Classes:
Tree

public interface ITree<T>
extends ISentence<T>

An ITree is an ISentence which additionally contains IConstituents. Default implementation: Tree.

Author:
sschwieb

Method Summary
 void addAllWords(List<IWord<T>> otherWords)
          Adds the given list of words to the list of words already contained in the ITree, as in List.addAll(java.util.Collection)
 boolean addStructure(IConstituent<T> c)
          Adds a constituent c to the tree.
 void addWord(IWord<T> w)
          Adds IWord w to the list of words, as in List.add(Object)
 void changeSentence(List<IWord<T>> words)
          Removes all words currently contained in this Tree, and adds all Word objects in words.
 void clear()
          This procedure clears the entire tree (sentence and structure).
 ITree<T> cloneTree()
          Returns a copy of this object.
 ISentence<T> createSubStructure(int begin, int end)
           
 Iterator<IConstituent<T>> findStructure(IConstituent<T> c)
          This procedure returns an iterator to c in the tree.
 List<IConstituent<T>> getConstituentStructure()
          Returns all Constituents stored in this Tree.
 int getNumberOfConstituents()
          This procedure returns the number of hypotheses the tree contains
 double getSentenceScore()
          Returns the probability of the sentence.
 void setSentenceScore(double score)
          Sets the probability of the sentence to the given value.
 
Methods inherited from interface org.schwiebert.abl4j.data.ISentence
addWords, buildSimilarSentencesSet, get, getCommentLine, getSequenceId, getSequenceText, getWords, indexOf, isSimilarTo, registerWordsInSentence, setCommentLine, setSequenceId, size, subList
 

Method Detail

cloneTree

ITree<T> cloneTree()
Returns a copy of this object.


addStructure

boolean addStructure(IConstituent<T> c)
Adds a constituent c to the tree. If a constituent with the same begin and end indices already exists, the nonterminals of c are added to that constituent, and false will be returned. Otherwise, c is added itself and the method returns true.


clear

void clear()
This procedure clears the entire tree (sentence and structure).


changeSentence

void changeSentence(List<IWord<T>> words)
Removes all words currently contained in this Tree, and adds all Word objects in words.

Parameters:
words -

getNumberOfConstituents

int getNumberOfConstituents()
This procedure returns the number of hypotheses the tree contains


findStructure

Iterator<IConstituent<T>> findStructure(IConstituent<T> c)
This procedure returns an iterator to c in the tree.


getConstituentStructure

List<IConstituent<T>> getConstituentStructure()
Returns all Constituents stored in this Tree.

Returns:

createSubStructure

ISentence<T> createSubStructure(int begin,
                                int end)

setSentenceScore

void setSentenceScore(double score)
Sets the probability of the sentence to the given value.

Parameters:
score -

getSentenceScore

double getSentenceScore()
Returns the probability of the sentence.

Returns:

addWord

void addWord(IWord<T> w)
Adds IWord w to the list of words, as in List.add(Object)

Parameters:
w -

addAllWords

void addAllWords(List<IWord<T>> otherWords)
Adds the given list of words to the list of words already contained in the ITree, as in List.addAll(java.util.Collection)

Parameters:
otherWords -

ABL4J (Alignment Based Learning for Java) - 0.9.7

© 2007 Stephan Schwiebert