edu.washington.cs.knowitall
Class Token

java.lang.Object
  extended by edu.washington.cs.knowitall.Token
All Implemented Interfaces:
Serializable

public class Token
extends Object
implements Serializable

A representation of a token in a sentence.

Author:
schmmd
See Also:
Serialized Form

Nested Class Summary
protected static class Token.ChunkTagExpression
          A regular expression that is evaluated against the chunk tag portion of a token.
protected static class Token.Expression
          An expression that is evaluated against a token.
protected static class Token.LemmaExpression
          A regular expression that is evaluated against the lemma portion of a token.
protected static class Token.PosTagExpression
          A regular expression that is evaluated against the POS tag portion of a token.
protected static class Token.StartTypeExpression
          A regular expression that is evaluated against the type portion of a token.
protected static class Token.StringExpression
          A regular expression that is evaluated against the string portion of a token.
protected static class Token.TypeExpression
          A regular expression that is evaluated against the type portion of a token.
 
Field Summary
 int index
           
 Sentence sentence
           
static com.google.common.base.Function<Token,String> toStringFunction
           
 
Constructor Summary
Token(Sentence sentence, int index)
           
 
Method Summary
 String chunk()
          The chunk tag of this token.
 boolean containsType(String descriptor)
          Check if this token is part of a tag with the specified descriptor.
 Collection<Type> getType(String descriptor)
           
 String lemma()
          The lemma of this token.
 String pos()
          The part of speech tag of this token.
 String string()
          The string of this token.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sentence

public final Sentence sentence

index

public final int index

toStringFunction

public static final com.google.common.base.Function<Token,String> toStringFunction
Constructor Detail

Token

public Token(Sentence sentence,
             int index)
Method Detail

containsType

public boolean containsType(String descriptor)
Check if this token is part of a tag with the specified descriptor.

Parameters:
descriptor -
Returns:

getType

public Collection<Type> getType(String descriptor)

string

public String string()
The string of this token.

Returns:

lemma

public String lemma()
The lemma of this token.

Returns:

pos

public String pos()
The part of speech tag of this token.

Returns:

chunk

public String chunk()
The chunk tag of this token.

Returns:

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 University of Washington CSE. All Rights Reserved.