|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.querygeneration.QuestionReformulator
public class QuestionReformulator
A QuestionReformulator can be applied to a question to obtain
reformulations of the question that are likely to occur in text passages that
answer the question.
A question is expected to be of the format described by the
pattern field. If the question does not match this pattern,
no reformulations are created.
| Field Summary | |
|---|---|
private java.util.regex.Pattern |
pattern
The pattern that identifies questions that can be processed by this reformulator. |
private java.util.ArrayList<QuestionReformulation> |
reforms
QuestionReformulation objects that are applied to questions
that match the pattern. |
| Constructor Summary | |
|---|---|
QuestionReformulator(java.lang.String filename)
Creates a new QuestionReformulator from a file. |
|
| Method Summary | |
|---|---|
Query[] |
apply(java.lang.String verbMod)
Creates reformulations of a question if it is of the format described by the pattern field and wraps them in Query
objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.regex.Pattern pattern
private java.util.ArrayList<QuestionReformulation> reforms
QuestionReformulation objects that are applied to questions
that match the pattern.
| Constructor Detail |
|---|
public QuestionReformulator(java.lang.String filename)
throws java.io.IOException
Creates a new QuestionReformulator from a file.
The file must have the following format:
QuestionPattern:
[regular expression]
QuestionReformulations:
[expr 1]
[score 1]
...
[expr n]
[score n]
expr is an expression describing a reformulation of the
question. See the documentation of the class
QuestionReformulation for further details on the format of
such an expression. score is the score assigned to the
reformulation and should be the higher the more specialized a
reformulation is.
filename - name of the file containing the reformulation rules
java.io.IOException - if the reformulation rules could not be read
successfully| Method Detail |
|---|
public Query[] apply(java.lang.String verbMod)
pattern field and wraps them in Query
objects.
verbMod - question string with modified verbs
Querynull
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||