info.ephyra.querygeneration
Class Query

java.lang.Object
  extended by info.ephyra.querygeneration.Query
All Implemented Interfaces:
java.io.Serializable

public class Query
extends java.lang.Object
implements java.io.Serializable

A Query is a data structure representing a search engine query.

The required fields are a query string, the analyzed question, a score that is the higher the more specific the query and the extraction techniques applied to results retrieved with this query.

This class implements the interface Serializable.

Version:
2007-05-01
Author:
Nico Schlaefer
See Also:
Serialized Form

Field Summary
private  AnalyzedQuestion analyzedQuestion
          The analyzed question.
private  java.lang.String[] extractionTechniques
          The answer extraction techniques applied to results retrieved with this query.
private  java.lang.String originalQueryString
          the original query String before normalization
private  QuestionInterpretation qi
          The interpretation of the question used to generate this query (optional).
private  java.lang.String queryString
          The query string.
private  float score
          The score of the query.
private static long serialVersionUID
          Version number used during deserialization.
 
Constructor Summary
Query(java.lang.String queryString)
          Creates a new Query object and sets the query string.
Query(java.lang.String queryString, AnalyzedQuestion analyzedQuestion, float score)
          Creates a new Query object and sets the query string, the analyzed question and the score of the query.
 
Method Summary
 boolean addExtractionTechnique(java.lang.String technique)
          Adds an answer extraction technique that is applied to results retrieved with this query.
 boolean extractWith(java.lang.String technique)
          Checks if the given answer extraction technique is applied to results retrieved with this query.
 AnalyzedQuestion getAnalyzedQuestion()
          Returns the analyzed question
 Query getCopy()
          Return a copy of this Query object.
 QuestionInterpretation getInterpretation()
          Returns the interpretation of the question used to generate this query.
 java.lang.String getOriginalQueryString()
           
 java.lang.String getQueryString()
          Returns the query string.
 float getScore()
          Returns the score of the query.
 void setAnalyzedQuestion(AnalyzedQuestion analyzedQuestion)
          Sets the analyzed question.
 void setExtractionTechniques(java.lang.String[] techniques)
          Sets the answer extraction techniques that are applied to results retrieved with this query.
 void setInterpretation(QuestionInterpretation qi)
          Sets the interpretation of the question used to generate this query.
 void setOriginalQueryString(java.lang.String originalQueryString)
           
 void setQueryString(java.lang.String queryString)
          Sets the query string.
 void setScore(float score)
          Sets the score of the query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Version number used during deserialization.

See Also:
Constant Field Values

queryString

private java.lang.String queryString
The query string.


originalQueryString

private java.lang.String originalQueryString
the original query String before normalization


analyzedQuestion

private AnalyzedQuestion analyzedQuestion
The analyzed question.


score

private float score
The score of the query. More specific queries receive a higher score than simple keyword queries. The score is used by the answer selection module to score the results retrieved with this query.


extractionTechniques

private java.lang.String[] extractionTechniques
The answer extraction techniques applied to results retrieved with this query.


qi

private QuestionInterpretation qi
The interpretation of the question used to generate this query (optional).

Constructor Detail

Query

public Query(java.lang.String queryString)
Creates a new Query object and sets the query string.

Parameters:
queryString - query string

Query

public Query(java.lang.String queryString,
             AnalyzedQuestion analyzedQuestion,
             float score)
Creates a new Query object and sets the query string, the analyzed question and the score of the query.

Parameters:
queryString - query string
analyzedQuestion - analyzed question
score - score of the query
Method Detail

getQueryString

public java.lang.String getQueryString()
Returns the query string.

Returns:
query string

getOriginalQueryString

public java.lang.String getOriginalQueryString()
Returns:
the original query String, before normalization

setOriginalQueryString

public void setOriginalQueryString(java.lang.String originalQueryString)
Parameters:
originalQueryString - the original query String

getAnalyzedQuestion

public AnalyzedQuestion getAnalyzedQuestion()
Returns the analyzed question

Returns:
analyzed question

getScore

public float getScore()
Returns the score of the query.

Returns:
score of the query

extractWith

public boolean extractWith(java.lang.String technique)
Checks if the given answer extraction technique is applied to results retrieved with this query.

Parameters:
technique - answer extraction technique
Returns:
true iff the technique is used

getInterpretation

public QuestionInterpretation getInterpretation()
Returns the interpretation of the question used to generate this query.

Returns:
question interpretation

setQueryString

public void setQueryString(java.lang.String queryString)
Sets the query string.

Parameters:
queryString - query string

setAnalyzedQuestion

public void setAnalyzedQuestion(AnalyzedQuestion analyzedQuestion)
Sets the analyzed question.

Parameters:
analyzedQuestion - analyzed question

setScore

public void setScore(float score)
Sets the score of the query.

Parameters:
score - score of the query

setExtractionTechniques

public void setExtractionTechniques(java.lang.String[] techniques)
Sets the answer extraction techniques that are applied to results retrieved with this query.

Parameters:
techniques - answer extraction techniques

addExtractionTechnique

public boolean addExtractionTechnique(java.lang.String technique)
Adds an answer extraction technique that is applied to results retrieved with this query.

Parameters:
technique - answer extraction technique
Returns:
true iff a new technique was added

setInterpretation

public void setInterpretation(QuestionInterpretation qi)
Sets the interpretation of the question used to generate this query.

Parameters:
qi - question interpretation

getCopy

public Query getCopy()
Return a copy of this Query object.

Returns:
copy of the Query object