cc.mallet.types
Class TokenSequence
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Token>
cc.mallet.types.TokenSequence
- All Implemented Interfaces:
- Sequence, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Token>, java.util.Collection<Token>, java.util.List<Token>, java.util.RandomAccess
- Direct Known Subclasses:
- StringTokenization
public class TokenSequence
- extends java.util.ArrayList<Token>
- implements Sequence, java.io.Serializable
A representation of a piece of text, usually a single word, to which we can attach properties.
- See Also:
- Serialized Form
Fields inherited from class java.util.AbstractList |
modCount |
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 |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
TokenSequence
public TokenSequence(java.util.Collection<Token> tokens)
TokenSequence
public TokenSequence()
TokenSequence
public TokenSequence(int capacity)
TokenSequence
public TokenSequence(Token[] tokens)
TokenSequence
public TokenSequence(java.lang.Object[] tokens)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.util.AbstractCollection<Token>
toStringShort
public java.lang.String toStringShort()
add
public void add(java.lang.String string)
removeLast
public java.lang.Object removeLast()
addAll
public void addAll(java.lang.Object[] objects)
toFeatureSequence
public FeatureSequence toFeatureSequence(Alphabet dict)
toFeatureVector
public FeatureVector toFeatureVector(Alphabet dict)
setNumericProperty
public void setNumericProperty(java.lang.String key,
double value)
setProperty
public void setProperty(java.lang.String key,
java.lang.Object value)
getNumericProperty
public double getNumericProperty(java.lang.String key)
getProperty
public java.lang.Object getProperty(java.lang.String key)
hasProperty
public boolean hasProperty(java.lang.String key)
getProperties
public PropertyList getProperties()