|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.search.rewriter.DefaultQueryRewriter
public class DefaultQueryRewriter
The default implementation of the QueryRewriter, implementing our first guess at a set of rewriting rules.
We implement the ParserTreeConstants so we can use them in creating Nodes, and RewriterConstants so we can use the sample queries in testing via the main method.
Field Summary |
---|
Fields inherited from interface net.sourceforge.nite.search.ParserTreeConstants |
---|
JJTCONDITION, JJTLOGICAL, jjtNodeName, JJTQUERY, JJTSIMPLEQUERY |
Fields inherited from interface net.sourceforge.nite.search.rewriter.RewriterConstants |
---|
BREAK_LINE, TEST_QUERIES |
Constructor Summary | |
---|---|
DefaultQueryRewriter()
Create a DefaultQueryRewriter with (optionally) a SearchableCorpus attached. |
|
DefaultQueryRewriter(SearchableCorpus sc)
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
Main test method. |
NodeQuery |
rewrite(NodeQuery query)
Rewrite the query plan according to the rules of our algorithm. |
java.util.List |
rewriteResult(java.util.List result)
Take the result tree and rewrite it to the form expected given the original input query. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultQueryRewriter()
public DefaultQueryRewriter(SearchableCorpus sc)
Method Detail |
---|
public static void main(java.lang.String[] args)
public NodeQuery rewrite(NodeQuery query)
In terms of the dnf vector containing the query plan: Redistribute sets of ANDed NodeConditions to single variables where possible, joining them with NodeLogicals. Keep conditions which are joined by implication or OR together. Make all exists booleans false.
TO DO: Meanwhile record a mapping for the results output. TO DO: We may need to reorder forall booleans?
rewrite
in interface QueryRewriter
query
- the NodeQuery which is to be rewritten
public java.util.List rewriteResult(java.util.List result)
rewriteResult
in interface QueryRewriter
result
- the results of the query
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |