dragon.nlp
Class Token

java.lang.Object
  |
  +--dragon.nlp.Token
All Implemented Interfaces:
java.lang.Comparable, Concept, FrequencySortable, IndexSortable, SortedElement, WeightSortable

public class Token
extends java.lang.Object
implements Concept, java.lang.Comparable, SortedElement

Token is a cute unit data structure for handling nlp task or other operations

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
 
Fields inherited from interface dragon.nlp.Concept
TYPE_PHRASE, TYPE_TERM, TYPE_TOKEN
 
Constructor Summary
Token(int index, int frequency)
           
Token(java.lang.String value)
           
Token(java.lang.String value, int index, int frequency)
           
 
Method Summary
 void addFrequency(int inc)
           
 int compareTo(java.lang.Object obj)
           
 int compareTo(Token token)
           
 Concept copy()
           
 boolean equals(java.lang.Object obj)
           
 boolean equalTo(Concept concept)
           
 int getConceptType()
          Return 1 for ontological term, 2 for multiword phrase, and 3 for token
 Word getEndingWord()
          Gets the last word of the concept.
 java.lang.String getEntryID()
           
 int getFrequency()
           
 int getIndex()
           
 java.lang.Object getMemo()
           
 java.lang.String getName()
           
 java.lang.String getSemanticType()
           
 Word getStartingWord()
          Gets the first word of the concept.
 java.lang.String getValue()
           
 double getWeight()
           
 int hashCode()
           
 boolean isSubConcept()
           
 void setFrequency(int freq)
           
 void setIndex(int index)
           
 void setMemo(java.lang.Object memo)
           
 void setValue(java.lang.String value)
           
 void setWeight(double weight)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Token

public Token(java.lang.String value)

Token

public Token(int index,
             int frequency)

Token

public Token(java.lang.String value,
             int index,
             int frequency)
Method Detail

copy

public Concept copy()
Specified by:
copy in interface Concept

getConceptType

public int getConceptType()
Description copied from interface: Concept
Return 1 for ontological term, 2 for multiword phrase, and 3 for token

Specified by:
getConceptType in interface Concept
Returns:
the concept type

getName

public java.lang.String getName()
Specified by:
getName in interface Concept
Returns:
the descriptive name of the concept

getEntryID

public java.lang.String getEntryID()
Specified by:
getEntryID in interface Concept
Returns:
the unique entry id, usually for ontological terms.

getSemanticType

public java.lang.String getSemanticType()
Specified by:
getSemanticType in interface Concept
Returns:
the semantic type such as proteins, genes, usually for ontological terms.

isSubConcept

public boolean isSubConcept()
Specified by:
isSubConcept in interface Concept

getStartingWord

public Word getStartingWord()
Description copied from interface: Concept
Gets the first word of the concept. Phrases and ontological terms could have multiple words.

Specified by:
getStartingWord in interface Concept
Returns:
the first word of the underlying concept

getEndingWord

public Word getEndingWord()
Description copied from interface: Concept
Gets the last word of the concept. Phrases and ontological terms could have multiple words.

Specified by:
getEndingWord in interface Concept
Returns:
the last word of the underlying concept

getMemo

public java.lang.Object getMemo()
Specified by:
getMemo in interface Concept

setMemo

public void setMemo(java.lang.Object memo)
Specified by:
setMemo in interface Concept

getValue

public java.lang.String getValue()

setValue

public void setValue(java.lang.String value)

setFrequency

public void setFrequency(int freq)
Specified by:
setFrequency in interface Concept

addFrequency

public void addFrequency(int inc)
Specified by:
addFrequency in interface Concept

getFrequency

public int getFrequency()
Specified by:
getFrequency in interface Concept

getIndex

public int getIndex()
Specified by:
getIndex in interface Concept

setIndex

public void setIndex(int index)
Specified by:
setIndex in interface Concept

setWeight

public void setWeight(double weight)
Specified by:
setWeight in interface Concept

getWeight

public double getWeight()
Specified by:
getWeight in interface Concept

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

compareTo

public int compareTo(Token token)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

equalTo

public boolean equalTo(Concept concept)
Specified by:
equalTo in interface Concept

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object