|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.patternlearning.PatternExtractor
public class PatternExtractor
Extracts answer patterns from text passages and adds them to the
AnswerPatternFilter.
| Field Summary | |
|---|---|
private static int |
MAX_TAGS
Maximum number of NE and CONTEXT tags in a pattern (for time performance). |
| Constructor Summary | |
|---|---|
PatternExtractor()
|
|
| Method Summary | |
|---|---|
static void |
extract(Result result,
java.lang.String as)
Extracts answer patterns from the answer string of a Result
object and adds them to the AnswerPatternFilter. |
private static java.lang.String[] |
extractPatterns(java.lang.String sentence)
Extract basic answer patterns from the sentence. |
private static java.lang.String[] |
generalizePatterns(java.lang.String[] patterns,
java.lang.String prop)
Generates more generic patterns from the initial patterns. |
private static java.lang.String |
prepSentence(java.lang.String sentence,
java.lang.String to,
java.lang.String[] cos,
java.lang.String po,
java.lang.String[][] nes)
Prepares a sentence for pattern extraction. |
private static java.lang.String |
replaceContext(java.lang.String sentence,
java.lang.String[] cos,
java.lang.String[][] nes)
Replaces all CONTEXT objects in the sentence. |
private static java.lang.String |
replaceNes(java.lang.String sentence,
java.lang.String[][] nes)
Replaces all NEs in the sentence. |
private static java.lang.String |
replaceProperty(java.lang.String sentence,
java.lang.String as,
java.lang.String[][] nes)
Replaces all PROPERTY objects in the sentence. |
private static java.lang.String |
replaceTarget(java.lang.String sentence,
java.lang.String to,
java.lang.String[][] nes)
Replaces all TARGET objects in the sentence. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int MAX_TAGS
| Constructor Detail |
|---|
public PatternExtractor()
| Method Detail |
|---|
private static java.lang.String replaceTarget(java.lang.String sentence,
java.lang.String to,
java.lang.String[][] nes)
sentence - input sentenceto - the TARGET object of the questionnes - the NEs in the sentence
null, if the sentence
does not contain the TARGET
private static java.lang.String replaceProperty(java.lang.String sentence,
java.lang.String as,
java.lang.String[][] nes)
sentence - input sentenceas - the answer to the questionnes - the NEs in the sentence
null, if the sentence
does not contain the answer
private static java.lang.String replaceContext(java.lang.String sentence,
java.lang.String[] cos,
java.lang.String[][] nes)
sentence - input sentencecos - the CONTEXT objects of the questionnes - the NEs in the sentence
private static java.lang.String replaceNes(java.lang.String sentence,
java.lang.String[][] nes)
sentence - input sentencenes - the NEs in the sentence
private static java.lang.String prepSentence(java.lang.String sentence,
java.lang.String to,
java.lang.String[] cos,
java.lang.String po,
java.lang.String[][] nes)
sentence - input sentenceto - the TARGET object of the questioncos - the CONTEXT objects of the questionpo - the answer to the questionnes - the NEs in the sentence
null, if
there is no TARGET or PROPERTY object in the input sentenceprivate static java.lang.String[] extractPatterns(java.lang.String sentence)
sentence - input sentence
private static java.lang.String[] generalizePatterns(java.lang.String[] patterns,
java.lang.String prop)
patterns - initial patternsprop - PROPERTY that the patterns extract
public static void extract(Result result,
java.lang.String as)
Result
object and adds them to the AnswerPatternFilter.
result - Result objectas - the answer to the question
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||