|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.retrieval.parser.Transformer com.sun.labs.minion.retrieval.parser.LuceneTransformer
public class LuceneTransformer
This class transforms the output of a JavaCC/JJTree tree into a tree of query elements that the query evaluator can understand.
Constructor Summary | |
---|---|
LuceneTransformer()
|
Method Summary | |
---|---|
protected static java.util.ArrayList |
collapseAnds(SimpleNode node,
boolean parentIsAnd)
Collapse any AND nodes that are just a chain of ANDSs into a single AND node with many children. |
protected static java.util.ArrayList |
collapseOrs(SimpleNode node,
boolean parentIsOr)
Collapse any OR nodes that are just a chain of ORs into a single OR node with many children. |
protected static void |
collapsePhrases(SimpleNode node,
TokenCollectorStage tcs)
Creates phrases for terms that would have been tokenized by the tokenizer upon indexing. |
protected static void |
handleAttributes(SimpleNode node)
Handles the extra attributes attached to terms in Lucene. |
protected static boolean |
isPassThrough(SimpleNode node)
Determines if the node has any significance or if it is just a passthrough that can be skipped. |
static void |
main(java.lang.String[] args)
|
protected static QueryElement |
makeQueryElements(SimpleNode node,
int defaultOperator)
This recursive method creates the tree of query elements based on the root node passed in. |
protected static java.util.ArrayList |
removeClutter(SimpleNode node)
Removes clutter nodes -- the nodes that have only a single child and provide no additional context. |
QueryElement |
transformTree(SimpleNode root)
Transforms an abstract syntax tree provided by JJTree+JavaCC into a tree of QueryElements that can be used by the query evaluator. |
QueryElement |
transformTree(SimpleNode root,
int defaultOperator)
Transforms an abstract syntax tree provided by JJTree+JavaCC into a tree of QueryElements that can be used by the query evaluator. |
Methods inherited from class com.sun.labs.minion.retrieval.parser.Transformer |
---|
isDoubleQuoted, isQuoted, isSingleQuoted |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LuceneTransformer()
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public QueryElement transformTree(SimpleNode root) throws java.text.ParseException
transformTree
in class Transformer
root
- the root node of the tree returned from the Parser
java.text.ParseException
public QueryElement transformTree(SimpleNode root, int defaultOperator) throws java.text.ParseException
transformTree
in class Transformer
root
- the root node of the tree returned from the ParserdefaultOperator
- specified the default operator to use when no
other operator is provided between terms in the query. Valid values are
defined in the Searcher
interface
java.text.ParseException
protected static QueryElement makeQueryElements(SimpleNode node, int defaultOperator) throws java.text.ParseException
node
- defaultOperator
- specified the default operator to use when no
other operator is provided between terms in the query. Valid values are
defined in the Searcher
interface
java.text.ParseException
protected static boolean isPassThrough(SimpleNode node)
node
- the node to check
protected static java.util.ArrayList removeClutter(SimpleNode node)
node
- the node to clean: pass in the root when calling
externally
protected static java.util.ArrayList collapseOrs(SimpleNode node, boolean parentIsOr)
node
- protected static java.util.ArrayList collapseAnds(SimpleNode node, boolean parentIsAnd)
node
- protected static void handleAttributes(SimpleNode node)
node
- the node whose children should be analyzedprotected static void collapsePhrases(SimpleNode node, TokenCollectorStage tcs)
node
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |