ABL4J (Alignment Based Learning for Java) - 0.9.7

org.schwiebert.abl4j.data.impl.abl
Class TreeBank<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<ITree<T>>
              extended by org.schwiebert.abl4j.data.impl.abl.TreeBank<T>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<ITree<T>>, Collection<ITree<T>>, List<ITree<T>>, RandomAccess, ITreeBank<T>

public final class TreeBank<T>
extends ArrayList<ITree<T>>
implements ITreeBank<T>

A Treebank is a List of ITree objects.

Author:
Menno van Zaanen (menno@ics.mq.edu.au) (original C++ Version), Jeroen Geertzen (j.geertzen@uvt.nl) (modifications in C++ Version), Stephan Schwiebert (sschwieb@spinfo.uni-koeln.de) (Java-Implementation)
See Also:
Serialized Form

Field Summary
private  Vector<String> comments
           
private  int current
           
private  boolean exhaustive
           
private static long serialVersionUID
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
TreeBank()
           
 
Method Summary
 void addAllTrees(Collection<ITree<T>> trees)
          Adds the collection trees to the treebank, as in List.addAll(Collection)
 void addComment(String string)
          Adds a comment to this treebank.
 void addTree(ITree<T> tree)
          Adds ITree tree to this treebank, as in List.add(Object)
 void doReverse()
          TODO: This method is not tested yet, as it's only used by suffix tree alignment.
 Vector<String> getComments()
          Returns all comments on this treebank.
 int getCurrentIndex()
          Returns the current index in the Treebank.
 int getNumberOfConstituents()
          Returns the number of IConstituents stored in all trees in this treebank.
 Collection<? extends ITree<T>> getTrees()
          Returns all ITrees stored in the treebank.
 void incrementCurrentIndex()
          Increases the current index.
 int indexOf(ITree<T> t)
          Returns the index of ITree tree.
 boolean isExhaustive()
          Returns the exhaustive flag of this Treebank.
 void setCurrentIndex(int current)
          Sets the current index to current.
 void setExhaustive(boolean v)
          This procedure sets whether or not to preserve memory by aligning all possible sentence pairs.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.schwiebert.abl4j.data.ITreeBank
clear, get, size
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

comments

private Vector<String> comments

exhaustive

private boolean exhaustive

current

private int current
Constructor Detail

TreeBank

public TreeBank()
Method Detail

setExhaustive

public void setExhaustive(boolean v)
Description copied from interface: ITreeBank
This procedure sets whether or not to preserve memory by aligning all possible sentence pairs.

Specified by:
setExhaustive in interface ITreeBank<T>

isExhaustive

public boolean isExhaustive()
Description copied from interface: ITreeBank
Returns the exhaustive flag of this Treebank.

Specified by:
isExhaustive in interface ITreeBank<T>
Returns:

doReverse

public void doReverse()
Description copied from interface: ITreeBank
TODO: This method is not tested yet, as it's only used by suffix tree alignment.

Specified by:
doReverse in interface ITreeBank<T>

getCurrentIndex

public int getCurrentIndex()
Description copied from interface: ITreeBank
Returns the current index in the Treebank.

Specified by:
getCurrentIndex in interface ITreeBank<T>

incrementCurrentIndex

public void incrementCurrentIndex()
Description copied from interface: ITreeBank
Increases the current index.

Specified by:
incrementCurrentIndex in interface ITreeBank<T>

setCurrentIndex

public void setCurrentIndex(int current)
Description copied from interface: ITreeBank
Sets the current index to current.

Specified by:
setCurrentIndex in interface ITreeBank<T>

getNumberOfConstituents

public int getNumberOfConstituents()
Description copied from interface: ITreeBank
Returns the number of IConstituents stored in all trees in this treebank.

Specified by:
getNumberOfConstituents in interface ITreeBank<T>
Returns:
the number of constituents

addComment

public void addComment(String string)
Description copied from interface: ITreeBank
Adds a comment to this treebank.

Specified by:
addComment in interface ITreeBank<T>

getComments

public Vector<String> getComments()
Description copied from interface: ITreeBank
Returns all comments on this treebank.

Specified by:
getComments in interface ITreeBank<T>
Returns:

addTree

public void addTree(ITree<T> tree)
Description copied from interface: ITreeBank
Adds ITree tree to this treebank, as in List.add(Object)

Specified by:
addTree in interface ITreeBank<T>
Parameters:
tree - the tree to add

indexOf

public int indexOf(ITree<T> t)
Description copied from interface: ITreeBank
Returns the index of ITree tree. Returns -1 if the tree is not contained in the treebank.

Specified by:
indexOf in interface ITreeBank<T>
Parameters:
t - the tree
Returns:
the index of the tree
See Also:
List.indexOf(Object)

addAllTrees

public void addAllTrees(Collection<ITree<T>> trees)
Description copied from interface: ITreeBank
Adds the collection trees to the treebank, as in List.addAll(Collection)

Specified by:
addAllTrees in interface ITreeBank<T>
Parameters:
trees - the trees to add.

getTrees

public Collection<? extends ITree<T>> getTrees()
Description copied from interface: ITreeBank
Returns all ITrees stored in the treebank.

Specified by:
getTrees in interface ITreeBank<T>
Returns:
all ITree-objects

ABL4J (Alignment Based Learning for Java) - 0.9.7

© 2007 Stephan Schwiebert