dragon.nlp
Class Phrase

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

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

Data structure for phrase

:

Copyright: Copyright (c) 2003

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
static int NAME_ASIS
           
static int NAME_LEMMA
           
 
Fields inherited from interface dragon.nlp.Concept
TYPE_PHRASE, TYPE_TERM, TYPE_TOKEN
 
Constructor Summary
Phrase(Word word)
           
Phrase(Word starting, Word ending)
           
 
Method Summary
 void addFrequency(int inc)
           
 int compareTo(java.lang.Object obj)
           
 int compareTo(Phrase term)
           
 Concept copy()
           
 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.
 double getWeight()
           
 int getWordNum()
           
 boolean isSubConcept()
           
 void setFrequency(int freq)
           
 void setIndex(int index)
           
 void setMemo(java.lang.Object memo)
           
static void setNameMode(int mode)
           
 void setSubConcept(boolean subterm)
           
 void setWeight(double weight)
           
 java.lang.String toLemmaString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME_ASIS

public static final int NAME_ASIS
See Also:
Constant Field Values

NAME_LEMMA

public static final int NAME_LEMMA
See Also:
Constant Field Values
Constructor Detail

Phrase

public Phrase(Word starting,
              Word ending)

Phrase

public Phrase(Word word)
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

setNameMode

public static void setNameMode(int mode)

compareTo

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

compareTo

public int compareTo(Phrase term)

isSubConcept

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

setSubConcept

public void setSubConcept(boolean subterm)

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.

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

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

toString

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

toLemmaString

public java.lang.String toLemmaString()

getWordNum

public int getWordNum()

addFrequency

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

getFrequency

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

setFrequency

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

equalTo

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