public class Interpreter extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
addUnprocessed |
boolean |
autoir |
static boolean |
coref |
static List<String> |
days |
String |
fname |
boolean |
inference |
static boolean |
ir |
static List<String> |
months |
boolean |
question |
static List<String> |
qwords |
RuleSet |
rs |
static boolean |
showr |
static boolean |
showrhs |
static boolean |
simFlood |
static TFIDF |
tfidf |
static int |
timeOut_value |
static boolean |
verboseAnswer |
static boolean |
verboseParse |
static boolean |
verboseProof |
| Constructor and Description |
|---|
Interpreter() |
Interpreter(RuleSet rsin) |
| Modifier and Type | Method and Description |
|---|---|
String |
addQuantification(String form) |
static void |
addUnprocessed(ArrayList<String> kifoutput,
CNF cnf) |
static RuleSet |
canon(RuleSet rsin) |
static boolean |
excluded(String word) |
static List<String> |
findWSD(List<String> clauses,
Map<String,String> posMap,
EntityTypeParser etp) |
static String |
formatAnswer(Formula query,
List<String> inferenceAnswers,
KB kb)
generates the answer to a query by replacing the variables with the results from the inference call
|
String |
fromKIFClauses(ArrayList<String> kifcs) |
protected ArrayList<CNF> |
getCNFInput(String input)
Method (mainly for testing) to get list of CNFs from input sentence.
|
protected Document |
getUserInputs() |
void |
initialize() |
void |
interpInter() |
List<String> |
interpret(String input)
Take in a any number of sentences and return kif strings of declaratives
or answer to questions.
|
ArrayList<String> |
interpretCNF(ArrayList<CNF> inputs) |
CNF |
interpretGenCNF(String input)
Take in a single sentence and output CNF for further processing.
|
CNF |
interpretGenCNFBasic(String input)
Take in a single sentence and output CNF for further processing.
|
String |
interpretSingle(String input)
Take in a single sentence and output an English answer.
|
static List<String> |
lemmatizeResults(List<String> results,
List<edu.stanford.nlp.ling.CoreLabel> tokens,
ClauseSubstitutor substitutor)
Lemmatize the results of the dependency parser, WSD, etc.
|
void |
loadRules() |
void |
loadRules(String f) |
static void |
main(String[] args) |
static String |
postProcess(String s) |
static void |
preProcessQuestionWords(CNF inputs) |
String |
printKB(ArrayList<CNF> inputs) |
static List<String> |
processPhrasalVerbs(List<String> results)
Combine phrasal verbs in dependency parsing results.
|
void |
testAddQuantification() |
static void |
testGraphMatch() |
static void |
testInterpret() |
static void |
testPostProcess() |
static void |
testPreserve()
A test method
|
static void |
testQuestionPreprocess() |
static void |
testTimeDateExtraction() |
static void |
testUnify() |
static void |
testUnify2() |
static void |
testUnify3() |
static void |
testUnify4() |
static void |
testWSD() |
String |
toFOL(ArrayList<String> clauses) |
public RuleSet rs
public String fname
public boolean inference
public boolean question
public static boolean addUnprocessed
public static boolean verboseParse
public boolean autoir
public static boolean ir
public static boolean simFlood
public static boolean verboseAnswer
public static boolean verboseProof
public static int timeOut_value
public static boolean showrhs
public static boolean showr
public static boolean coref
public static TFIDF tfidf
public Interpreter()
public Interpreter(RuleSet rsin)
protected Document getUserInputs()
public static boolean excluded(String word)
public static List<String> findWSD(List<String> clauses, Map<String,String> posMap, EntityTypeParser etp)
public List<String> interpret(String input)
public CNF interpretGenCNFBasic(String input)
public CNF interpretGenCNF(String input)
public String interpretSingle(String input)
protected ArrayList<CNF> getCNFInput(String input)
input - string representing input sentencepublic static List<String> processPhrasalVerbs(List<String> results)
public static List<String> lemmatizeResults(List<String> results, List<edu.stanford.nlp.ling.CoreLabel> tokens, ClauseSubstitutor substitutor)
public static void preProcessQuestionWords(CNF inputs)
public String fromKIFClauses(ArrayList<String> kifcs)
kifcs - a list of String simple KIF clausespublic static String formatAnswer(Formula query, List<String> inferenceAnswers, KB kb)
public void interpInter()
public void loadRules(String f)
public void loadRules()
public void initialize()
throws IOException
IOExceptionpublic static void testUnify()
public static void testUnify2()
public static void testUnify3()
public static void testUnify4()
public static void testInterpret()
public static void testPreserve()
public static void testQuestionPreprocess()
public static void testPostProcess()
public static void testWSD()
public static void testGraphMatch()
public static void testTimeDateExtraction()
throws IOException
IOExceptionpublic void testAddQuantification()
public static void main(String[] args) throws IOException
IOExceptionCopyright © 2015. All rights reserved.