|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.questionanalysis.QuestionInterpretation
public class QuestionInterpretation
A QuestionInterpretation is a data structure comprising
the TARGET of a question, the CONTEXT and the PROPERTY the question asks for.
This class implements the interfaces Comparable and
Serializable. Note: it has a natural ordering that is
inconsistent with equals().
| Field Summary | |
|---|---|
private java.lang.String[] |
context
The CONTEXT objects of the question. |
private int |
length
The LENGTH of this interpretation. |
private java.lang.String |
property
The PROPERTY the question asks for. |
private static long |
serialVersionUID
Version number used during deserialization. |
private java.lang.String |
target
The TARGET object of the question. |
| Constructor Summary | |
|---|---|
QuestionInterpretation(java.lang.String target,
java.lang.String[] context,
java.lang.String property)
Creates a new QuestionInterpretation object and sets
the TARGET, CONTEXT, PROPERTY and LENGTH fields. |
|
| Method Summary | |
|---|---|
private void |
calculateLength()
Calculates the LENGTH of the QuestionInterpretation, which is defined as the sum of the length of the TARGET object and all CONTEXT objects. |
int |
compareTo(QuestionInterpretation qi)
Compares this QuestionInterpretation to another
QuestionInterpretation object. |
void |
dropContext()
Drops the CONTEXT without recalculating the length. |
java.lang.String[] |
getContext()
Returns the CONTEXT of the question. |
int |
getLength()
Returns the LENGTH of the interpretation. |
java.lang.String |
getProperty()
Returns the PROPERTY that the question asks for. |
java.lang.String |
getTarget()
Returns the TARGET of the question. |
void |
setContext(java.lang.String[] context)
Sets the CONTEXT of the question. |
void |
setTarget(java.lang.String target)
Sets the TARGET of the question. |
java.lang.String |
toString()
Returns a string representation of the interpretation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private java.lang.String target
private java.lang.String[] context
private java.lang.String property
private int length
| Constructor Detail |
|---|
public QuestionInterpretation(java.lang.String target,
java.lang.String[] context,
java.lang.String property)
QuestionInterpretation object and sets
the TARGET, CONTEXT, PROPERTY and LENGTH fields.
target - the TARGET of the questioncontext - the CONTEXT of the questionproperty - the PROPERTY that the question asks for| Method Detail |
|---|
private void calculateLength()
Calculates the LENGTH of the QuestionInterpretation, which is defined as the sum of the length of the TARGET object and all CONTEXT objects.
The smaller the value, the more likely it is that the question was interpreted correctly. A smaller value also means a greater abstraction from the original formulation of the question and therefore the search will return more results.
On the other hand, a large value means - if the search does not fail - a high probability of a correct answer.
public java.lang.String getTarget()
public java.lang.String[] getContext()
public java.lang.String getProperty()
public int getLength()
public void setTarget(java.lang.String target)
target - the TARGET objectpublic void setContext(java.lang.String[] context)
context - the CONTEXT objectspublic void dropContext()
public int compareTo(QuestionInterpretation qi)
Compares this QuestionInterpretation to another
QuestionInterpretation object.
compareTo in interface java.lang.Comparable<QuestionInterpretation>qi - the QuestionInterpretation to be compared
QuestionInterpretation is less than, equal to, or
greater than the specified QuestionInterpretationpublic 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 | |||||||||