|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.questionanalysis.Term
public class Term
A Term comprises one or more tokens of text that form a unit
of meaning. It can be an individual word, a compound noun or a named entity.
This class implements the interface Serializable.
| Field Summary | |
|---|---|
static java.lang.String |
COMPOUND
Part of speech tag for terms that comprise multiple tokens |
private java.util.Map<java.lang.String,java.lang.Double> |
expansionLemmas
Maps lemmas of the expansions to their weights. |
private java.util.Map<java.lang.String,java.lang.Double> |
expansions
Maps expansions of the term to their weights. |
private java.lang.String |
lemma
The lemma of the term. |
private java.lang.String[] |
neTypes
The named entity types of the term (optional). |
private java.lang.String |
pos
The part of speech of the term or COMPOUND to indicate that
it comprises multiple tokens. |
private double |
relFrequency
Relative frequency of the term. |
private static long |
serialVersionUID
Version number used during deserialization. |
private java.lang.String |
text
The textual representation of the term. |
| Constructor Summary | |
|---|---|
Term(java.lang.String text,
java.lang.String pos)
Constructs a term from the provided information. |
|
Term(java.lang.String text,
java.lang.String pos,
java.lang.String[] neTypes)
Constructs a term from the provided information. |
|
| Method Summary | |
|---|---|
private void |
generateLemma()
Generates the lemma of the term. |
java.util.Map<java.lang.String,java.lang.Double> |
getExpansions()
|
java.lang.String |
getLemma()
|
java.lang.String[] |
getNeTypes()
|
java.lang.String |
getPos()
|
double |
getRelFrequency()
|
java.lang.String |
getText()
|
double |
getWeight(java.lang.String lemma)
Gets the weight of the term or expansion with the given lemma. |
void |
setExpansionLemmas(java.util.Map<java.lang.String,java.lang.Double> expansionLemmas)
Normalizes and sets the lemmas of the expansions. |
void |
setExpansions(java.util.Map<java.lang.String,java.lang.Double> expansions)
|
void |
setLemma(java.lang.String lemma)
Normalizes and sets the lemma of the term. |
void |
setNeTypes(java.lang.String[] neTypes)
|
void |
setRelFrequency(double relFrequency)
|
double |
simScore(java.lang.String lemma)
Calculates similarity scores for the given lemma and the lemmas of the term and its expansions based on their weights and the number of common tokens. |
java.lang.String |
toString()
Creates a string representation of the term. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
public static final java.lang.String COMPOUND
private java.lang.String text
private java.lang.String lemma
private java.lang.String pos
COMPOUND to indicate that
it comprises multiple tokens.
private java.lang.String[] neTypes
private double relFrequency
private java.util.Map<java.lang.String,java.lang.Double> expansions
private java.util.Map<java.lang.String,java.lang.Double> expansionLemmas
| Constructor Detail |
|---|
public Term(java.lang.String text,
java.lang.String pos)
text - textual representationpos - part of speech
public Term(java.lang.String text,
java.lang.String pos,
java.lang.String[] neTypes)
text - textual representationpos - part of speechneTypes - named entity types| Method Detail |
|---|
public java.lang.String getText()
public java.lang.String getLemma()
public java.lang.String getPos()
public java.lang.String[] getNeTypes()
public void setNeTypes(java.lang.String[] neTypes)
public double getRelFrequency()
public void setRelFrequency(double relFrequency)
public java.util.Map<java.lang.String,java.lang.Double> getExpansions()
public void setExpansions(java.util.Map<java.lang.String,java.lang.Double> expansions)
private void generateLemma()
public void setLemma(java.lang.String lemma)
lemma - the lemma of the termpublic void setExpansionLemmas(java.util.Map<java.lang.String,java.lang.Double> expansionLemmas)
expansionLemmas - the lemmas of the expansionspublic double getWeight(java.lang.String lemma)
lemma - the lemma
0 if there is no matchpublic double simScore(java.lang.String lemma)
lemma - lemma to compare with
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||