org.activemath.omdocjdom.index.queries
Class SpanQuerySegmenter
java.lang.Object
org.activemath.omdocjdom.index.queries.SpanQuerySegmenter
public class SpanQuerySegmenter
- extends Object
Process to split a token-stream with non-zero slop into
a composition of SpanQuery objects.
See computeSpanQuery(org.apache.lucene.analysis.TokenStream).
|
Method Summary |
org.apache.lucene.search.spans.SpanQuery |
computeSpanQuery(org.apache.lucene.analysis.TokenStream tokS)
Runs through the list of tokens and makes an appropriate SpanQuery
out of it. |
static void |
decomposeSQtoXML(org.apache.lucene.search.Query sq,
Writer out)
|
static void |
main(String[] args)
|
static void |
setMaxTermDepth(int depth)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpanQuerySegmenter
public SpanQuerySegmenter(String fieldName)
setMaxTermDepth
public static void setMaxTermDepth(int depth)
computeSpanQuery
public org.apache.lucene.search.spans.SpanQuery computeSpanQuery(org.apache.lucene.analysis.TokenStream tokS)
- Runs through the list of tokens and makes an appropriate
SpanQuery
out of it.
This converts a variable of name "?", when in surroundig,
to a query that matches any sub-term (see source for a detailed approach).
It converts all other tokens to SpanTermQuery embedded
in the sequence.
There is no way, currently, to match a series of terms, or
a term which contains, possibly very deep, something else.
main
public static void main(String[] args)
decomposeSQtoXML
public static void decomposeSQtoXML(org.apache.lucene.search.Query sq,
Writer out)