org.cogroo.entities
Class Token

java.lang.Object
  extended by org.cogroo.entities.Token
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NullToken, TokenCogroo

public abstract class Token
extends Object
implements Serializable

A token is the smallest annotated unit of the text. Examples: "home" "," "." "12.55"

Author:
William Colen
See Also:
Serialized Form

Constructor Summary
Token()
          Constructs a token without a lexeme and with a default span (0, 0).
Token(int start, int end)
          Constructs a token without a lexeme and with the given span indexes.
Token(opennlp.tools.util.Span span)
          Constructs a token with the given span.
 
Method Summary
 boolean equals(Object obj)
           
 Chunk getChunk()
           
 ChunkTag getChunkTag()
           
 String getLexeme()
           
 LexemeTypes getLexemeType()
           
 MorphologicalTag getMorphologicalTag()
           
 String[] getPrimitive()
           
 opennlp.tools.util.Span getSpan()
           
 SyntacticChunk getSyntacticChunk()
           
 SyntacticTag getSyntacticTag()
           
 int hashCode()
           
 void setChunk(Chunk chunk)
           
 void setChunkTag(ChunkTag ct)
           
abstract  void setLexeme(String lexeme)
           
 void setMorphologicalTag(MorphologicalTag tag)
           
 void setPrimitive(String[] primitive)
           
 void setSpan(opennlp.tools.util.Span span)
           
 void setSyntacticChunk(SyntacticChunk syntacticChunk)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Token

public Token()
Constructs a token without a lexeme and with a default span (0, 0).


Token

public Token(opennlp.tools.util.Span span)
Constructs a token with the given span.

Parameters:
span -

Token

public Token(int start,
             int end)
Constructs a token without a lexeme and with the given span indexes.

Parameters:
start - the start index of the span
end - the end index of the span
Method Detail

getLexeme

public String getLexeme()

setLexeme

public abstract void setLexeme(String lexeme)

getPrimitive

public String[] getPrimitive()

setPrimitive

public void setPrimitive(String[] primitive)

getMorphologicalTag

public MorphologicalTag getMorphologicalTag()

setMorphologicalTag

public void setMorphologicalTag(MorphologicalTag tag)

getChunkTag

public ChunkTag getChunkTag()

setChunkTag

public void setChunkTag(ChunkTag ct)

setSpan

public void setSpan(opennlp.tools.util.Span span)

getSyntacticTag

public SyntacticTag getSyntacticTag()

getChunk

public Chunk getChunk()

setChunk

public void setChunk(Chunk chunk)

getLexemeType

public LexemeTypes getLexemeType()

getSpan

public opennlp.tools.util.Span getSpan()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setSyntacticChunk

public void setSyntacticChunk(SyntacticChunk syntacticChunk)

getSyntacticChunk

public SyntacticChunk getSyntacticChunk()


Copyright © 2012-2013 CoGrOO. All Rights Reserved.