|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.querying.parser.Query org.terrier.querying.parser.MultiTermQuery org.terrier.querying.parser.PhraseQuery
public class PhraseQuery
Models a phrase query, which can have a proximity requirement.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.terrier.querying.parser.Query |
---|
Query.ForEachQueryNode |
Field Summary | |
---|---|
protected int |
proximityDistance
Indicates the distance, in number of blocks, that the phrase terms can appear in a document. |
Fields inherited from class org.terrier.querying.parser.MultiTermQuery |
---|
prefix, suffix, v |
Fields inherited from class org.terrier.querying.parser.Query |
---|
child, tmpSTQ |
Constructor Summary | |
---|---|
PhraseQuery()
A default constructor that calls the constructor of the super class. |
|
PhraseQuery(int proxDistance)
Constructs a phrase query and sets the proximity distance |
Method Summary | |
---|---|
java.lang.Object |
clone()
Deep copy this Query object |
void |
getTermsOf(java.lang.Class<? extends Query> c,
java.util.List<Query> alist,
boolean req)
Returns all the query terms, in subqueries that are instances of a given class |
boolean |
obtainControls(java.util.Set<java.lang.String> allowed,
java.util.Map<java.lang.String,java.lang.String> controls)
This object cannot contain any controls, so this method will always return false. |
void |
obtainQueryTerms(MatchingQueryTerms terms)
Stores the query terms of the phrase query in the given matching query terms structure. |
void |
obtainQueryTerms(MatchingQueryTerms terms,
boolean required)
Stores the query terms of the phrase query in the given matching query terms structure. |
void |
setProximityDistance(int prox)
Sets the allowed distance, in blocks, between the phrase terms. |
java.lang.String |
toString()
Returns a string representation of the phrase query. |
Methods inherited from class org.terrier.querying.parser.MultiTermQuery |
---|
add, add, apply, applyTermPipeline, getNumberOfTerms, getTerms, obtainAllOf, parseTree, replace |
Methods inherited from class org.terrier.querying.parser.Query |
---|
setChild |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int proximityDistance
Constructor Detail |
---|
public PhraseQuery()
public PhraseQuery(int proxDistance)
proxDistance
- int the distance, in number
of blocks, that the phrase terms can appear
in a document.Method Detail |
---|
public java.lang.Object clone()
clone
in class MultiTermQuery
public void setProximityDistance(int prox)
prox
- the allowed distance between the phrase terms.public java.lang.String toString()
toString
in class MultiTermQuery
public void obtainQueryTerms(MatchingQueryTerms terms)
obtainQueryTerms
in class MultiTermQuery
terms
- MatchingQueryTerms the structure that stores
the query terms for matching.public void obtainQueryTerms(MatchingQueryTerms terms, boolean required)
obtainQueryTerms
in class MultiTermQuery
terms
- MatchingQueryTerms the structure that stores
the query terms for matching.required
- boolean indicates whether the phrase is
required or not.public boolean obtainControls(java.util.Set<java.lang.String> allowed, java.util.Map<java.lang.String,java.lang.String> controls)
obtainControls
in class MultiTermQuery
allowed
- The HashSet of control names that are allowed to be set.controls
- The Hashtable into which child objects much add
found controls
public void getTermsOf(java.lang.Class<? extends Query> c, java.util.List<Query> alist, boolean req)
getTermsOf
in class MultiTermQuery
c
- Class a class of queries.alist
- ArrayList the list of query terms.req
- boolean indicates whether the subqueries
are required or not.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |