gate.creole.annic.lucene
Class SubQueryParser

java.lang.Object
  extended by gate.creole.annic.lucene.SubQueryParser

public class SubQueryParser
extends Object

This class behaves as a helper class to the QueryParser and provides various methods which are called from various methods of QueryParser.

Author:
niraj

Constructor Summary
SubQueryParser()
           
 
Method Summary
static ArrayList<String> findOrTokens(String query)
          This method given a query identifies the OR Tokens for eg.
static void main(String[] args)
           
static ArrayList<String> parseQuery(String q1)
          this method parses the query and returns the different queries converted into the OR normalized form for e.g.
static boolean scanQueryForOrOrBracket(String query)
          This method checks if query has either | or ( in it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubQueryParser

public SubQueryParser()
Method Detail

main

public static void main(String[] args)

parseQuery

public static ArrayList<String> parseQuery(String q1)
                                    throws SearchException
this method parses the query and returns the different queries converted into the OR normalized form for e.g. ({A}|{B}){C} this will be converted into ({A}{C}) | ({B}{C}) and the arrayList consists of 1. {A}{C} 2. {B}{C}

Throws:
SearchException

scanQueryForOrOrBracket

public static boolean scanQueryForOrOrBracket(String query)
This method checks if query has either | or ( in it.


findOrTokens

public static ArrayList<String> findOrTokens(String query)
This method given a query identifies the OR Tokens for eg. {A} | ({B}{C}) then {A} and ({B}{C}) so basically findOrTokens find out all the tokens around | operator