com.sun.labs.minion.retrieval.parser
Class WebTransformer

java.lang.Object
  extended by com.sun.labs.minion.retrieval.parser.Transformer
      extended by com.sun.labs.minion.retrieval.parser.WebTransformer

public class WebTransformer
extends Transformer

This class transforms the output of JavaCC into a tree of query elements that the query evaluator can understand. It's more than meets the eye.


Field Summary
protected static java.lang.String validMods
           
 
Constructor Summary
WebTransformer()
           
 
Method Summary
static java.lang.String getMods(java.lang.String term)
           
static boolean isAnd(java.lang.String mods)
           
static boolean isNot(java.lang.String mods)
           
static boolean isOr(java.lang.String mods)
           
static void main(java.lang.String[] args)
           
 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
 

Field Detail

validMods

protected static final java.lang.String validMods
See Also:
Constant Field Values
Constructor Detail

WebTransformer

public WebTransformer()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

transformTree

public QueryElement transformTree(SimpleNode root)
                           throws java.text.ParseException
Transforms an abstract syntax tree provided by JJTree+JavaCC into a tree of QueryElements that can be used by the query evaluator.

Specified by:
transformTree in class Transformer
Parameters:
root - the root node of the tree returned from the Parser
Returns:
the root node of a tree describing a query
Throws:
java.text.ParseException

transformTree

public QueryElement transformTree(SimpleNode root,
                                  int defaultOperator)
                           throws java.text.ParseException
Transforms an abstract syntax tree provided by JJTree+JavaCC into a tree of QueryElements that can be used by the query evaluator.

Specified by:
transformTree in class Transformer
Parameters:
root - the root node of the tree returned from the Parser
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
Returns:
the root node of a tree describing a query
Throws:
java.text.ParseException

isAnd

public static boolean isAnd(java.lang.String mods)

isNot

public static boolean isNot(java.lang.String mods)

isOr

public static boolean isOr(java.lang.String mods)

getMods

public static java.lang.String getMods(java.lang.String term)