|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.questionanalysis.QuestionInterpreter
public class QuestionInterpreter
The QuestionInterpreter parses a question and determines the
TARGET, the CONTEXT and the PROPERTY it asks for.
| Field Summary | |
|---|---|
private static java.util.Hashtable<java.lang.String,java.lang.String> |
answerTemplates
For each PROPERTY a template for an answer string. |
private static java.util.Hashtable<java.lang.String,HashDictionary> |
keywords
For each PROPERTY a dictionary of keywords. |
private static java.util.ArrayList<QuestionPattern> |
questionPatterns
The patterns that are applied to a question. |
private static java.util.Hashtable<java.lang.String,java.lang.String> |
questionTemplates
For each PROPERTY a template for a question asking for it. |
| Constructor Summary | |
|---|---|
QuestionInterpreter()
|
|
| Method Summary | |
|---|---|
private static void |
addKeywords(java.lang.String expr,
java.lang.String prop)
Adds the keywords in a descriptor of a question pattern to the dictionary for the respective PROPERTY. |
static java.lang.String |
getAnswer(java.lang.String po,
java.lang.String prop)
Returns an answer string that expresses that the property object is an instance of the specified property or null if no answer
template is available for the property. |
static java.lang.String |
getQuestion(java.lang.String to,
java.lang.String prop)
Returns a question string that asks for the specified property of the target object or null if no question template is available
for the property. |
static QuestionInterpretation[] |
interpret(java.lang.String qn,
java.lang.String stemmed)
Interprets a question by applying the question patterns and returns the interpretations of minimal length. |
static boolean |
loadPatterns(java.lang.String dir)
Loads the question patterns from a directory of PROPERTY files. |
static boolean |
lookupKeyword(java.lang.String word,
java.lang.String prop)
Looks up a word in the dictionary for the given PROPERTY. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static java.util.ArrayList<QuestionPattern> questionPatterns
private static java.util.Hashtable<java.lang.String,HashDictionary> keywords
private static java.util.Hashtable<java.lang.String,java.lang.String> questionTemplates
private static java.util.Hashtable<java.lang.String,java.lang.String> answerTemplates
| Constructor Detail |
|---|
public QuestionInterpreter()
| Method Detail |
|---|
private static void addKeywords(java.lang.String expr,
java.lang.String prop)
expr - pattern descriptorprop - PROPERTY the question pattern belongs topublic static boolean loadPatterns(java.lang.String dir)
QuestionPattern.
dir - directory of the question patterns
public static QuestionInterpretation[] interpret(java.lang.String qn,
java.lang.String stemmed)
qn - normalized question stringstemmed - stemmed question string
public static boolean lookupKeyword(java.lang.String word,
java.lang.String prop)
word - the word to be looked upprop - the PROPERTY
word is in the dictionary for
prop
public static java.lang.String getQuestion(java.lang.String to,
java.lang.String prop)
null if no question template is available
for the property.
to - target objectprop - property
null
public static java.lang.String getAnswer(java.lang.String po,
java.lang.String prop)
null if no answer
template is available for the property.
po - property objectprop - property
null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||