|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.ephyra.querygeneration.QuestionReformulation
public class QuestionReformulation
A data structure consisting of an expression describing a query reformulation and a score that is used by the answer selection module to rank results that follow from that reformulation.
Before the get() method of this class can be called, a
Matcher needs to be created that applies the corresponding
question pattern to the question and its matches() method needs
to be called. This Matcher must be passed to the
get() method.
| Field Summary | |
|---|---|
private java.lang.String |
expr
Expression that describes the reformulation. |
private float |
score
Score used by the answer selection module to rank results. |
| Constructor Summary | |
|---|---|
QuestionReformulation(java.lang.String expr,
float score)
Creates a QuestionReformulation object and sets the
expression and the score. |
|
| Method Summary | |
|---|---|
private java.lang.String[] |
combineStrings(java.lang.String s1,
java.lang.String s2)
Combines two strings by inserting the second string in between each two tokens of the first string. |
private java.lang.String[] |
evalCombinedGroups(java.lang.String queryString,
java.util.regex.Matcher matcher)
Replaces combined group identifiers of the format [group_no1]<[group_no2] by the combinations of the
corresponding groups generated by the combineStrings() |
private java.lang.String |
evalGroups(java.lang.String queryString,
java.util.regex.Matcher matcher)
Replaces group identifiers of the format [group_no] by the
corresponding group captured by a Matcher that applied the
question pattern to the question string. |
java.lang.String[] |
get(java.util.regex.Matcher matcher)
Returns one or more reformulations of the original question. |
float |
getScore()
Returns the score of the reformulation, used by the answer selection module to rank results that follow from this reformulation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String expr
Expression that describes the reformulation.
The expression can contain:
Matcher that applied the corresponding question pattern to
the question string.[group_id][group_id1]<[group_id2]
private float score
| Constructor Detail |
|---|
public QuestionReformulation(java.lang.String expr,
float score)
QuestionReformulation object and sets the
expression and the score.
expr - expression describing the reformulationscore - score of the reformulation| Method Detail |
|---|
private java.lang.String evalGroups(java.lang.String queryString,
java.util.regex.Matcher matcher)
[group_no] by the
corresponding group captured by a Matcher that applied the
question pattern to the question string.
queryString - query string containing group identifiersmatcher - the Matcher that group IDs refer to
private java.lang.String[] evalCombinedGroups(java.lang.String queryString,
java.util.regex.Matcher matcher)
[group_no1]<[group_no2] by the combinations of the
corresponding groups generated by the combineStrings()
method.
- Parameters:
queryString - query string containing combined group identifiersmatcher - the Matcher that groupd IDs refer to
- Returns:
- query string without combined group identifiers
private java.lang.String[] combineStrings(java.lang.String s1,
java.lang.String s2)
n
tokens, then this method returns an array of n-1 strings.
s1 - first strings2 - second string
public java.lang.String[] get(java.util.regex.Matcher matcher)
Matcher that applied the corresponding question pattern to
the question string. The method matches() must have been
executed since group identifiers that occur in the expression used
by the reformulator refer to groups that have been captured.
matcher - the Matcher that group IDs refer to
public float getScore()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||