Class 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
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String string)  
      void addAll​(java.lang.Object[] objects)  
      double getNumericProperty​(java.lang.String key)  
      PropertyList getProperties()  
      java.lang.Object getProperty​(java.lang.String key)  
      boolean hasProperty​(java.lang.String key)  
      java.lang.Object removeLast()  
      void setNumericProperty​(java.lang.String key, double value)  
      void setProperty​(java.lang.String key, java.lang.Object value)  
      FeatureSequence toFeatureSequence​(Alphabet dict)  
      FeatureVector toFeatureVector​(Alphabet dict)  
      java.lang.String toString()  
      java.lang.String toStringShort()  
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, stream, toArray
      • Methods inherited from interface java.util.List

        containsAll
    • Constructor Detail

      • 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)
    • Method Detail

      • 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)
      • 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)