jcolibri.extensions.textual.IE.representation
Class Token

java.lang.Object
  extended by jcolibri.extensions.textual.IE.representation.Token

public class Token
extends java.lang.Object

A token represents an elementary piece of text. It is usually a word or punctuation symbol. This object stores some flags extracted by specific methods:

Version:
1.0
Author:
Juan A. Recio-Garcia

Field Summary
protected  boolean isMainName
           
protected  java.lang.String postag
           
protected  java.util.List<WeightedRelation> relations
           
protected  java.lang.String stem
           
protected  boolean stopWord
           
protected  java.lang.String text
           
 
Constructor Summary
Token(java.lang.String text)
          Creates a token from a string
 
Method Summary
 void addRelation(WeightedRelation relation)
          Adds a relation
 java.lang.String getPostag()
          Returns the POS tag
 java.lang.String getRawContent()
          Returns the original content of the token
 java.util.List<WeightedRelation> getRelations()
          Returns the relations
 java.lang.String getStem()
          Returns the stem
 boolean isMainName()
          Returns if the token is a Main Name
 boolean isStopWord()
          Returns if the token is a stop word
 void setMainName(boolean isMainName)
          Sets if the token is a Main Name
 void setPostag(java.lang.String postag)
          Sets the POS tag
 void setStem(java.lang.String stem)
          Sets the stem
 void setStopWord(boolean stopWord)
          Sets if the token is a stop word
 java.lang.String toString()
          Prints the content and annotations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stopWord

protected boolean stopWord

isMainName

protected boolean isMainName

stem

protected java.lang.String stem

postag

protected java.lang.String postag

relations

protected java.util.List<WeightedRelation> relations

text

protected java.lang.String text
Constructor Detail

Token

public Token(java.lang.String text)
Creates a token from a string

Method Detail

getRawContent

public java.lang.String getRawContent()
Returns the original content of the token


addRelation

public void addRelation(WeightedRelation relation)
Adds a relation


getRelations

public java.util.List<WeightedRelation> getRelations()
Returns the relations


isMainName

public boolean isMainName()
Returns if the token is a Main Name


setMainName

public void setMainName(boolean isMainName)
Sets if the token is a Main Name


getPostag

public java.lang.String getPostag()
Returns the POS tag


setPostag

public void setPostag(java.lang.String postag)
Sets the POS tag


getStem

public java.lang.String getStem()
Returns the stem


setStem

public void setStem(java.lang.String stem)
Sets the stem


isStopWord

public boolean isStopWord()
Returns if the token is a stop word


setStopWord

public void setStopWord(boolean stopWord)
Sets if the token is a stop word


toString

public java.lang.String toString()
Prints the content and annotations.

Overrides:
toString in class java.lang.Object

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es