gate.creole.annic.lucene
Class PatternValidator
java.lang.Object
gate.creole.annic.lucene.PatternValidator
public class PatternValidator
- extends Object
Pattern Validator that given a position of first term, retrieves the
entire pattern from the token stream. If it is not able to retrieve
the entire pattern, the class reports it as an invalid pattern.
- Author:
- niraj
Method Summary |
int |
getPatternLength()
Gets the length of the pattern. |
int |
validate(List<String> queryTokens,
List<Token> annotations,
int from,
QueryParser queryParser)
This method takes two parameters the actual query issued and
annotations in which it checks if the annotations exist that are
validating for the given query |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PatternValidator
public PatternValidator()
getPatternLength
public int getPatternLength()
- Gets the length of the pattern.
validate
public int validate(List<String> queryTokens,
List<Token> annotations,
int from,
QueryParser queryParser)
throws SearchException
- This method takes two parameters the actual query issued and
annotations in which it checks if the annotations exist that are
validating for the given query
- Returns:
- int positive number indicates the offset of the last
annotation of the pattern. -1 indicates invalid pattern.
- Throws:
SearchException