org.languagetool.dev.index
Class PatternRuleQueryBuilder
java.lang.Object
org.languagetool.dev.index.PatternRuleQueryBuilder
public class PatternRuleQueryBuilder
- extends Object
A factory class for building a Lucene Query from a PatternRule. The query
requires an index where each document contains only one sentence. It returns
potential matches, i.e. LanguageTool still needs to run over the matches
to make sure there is indeed an error.
- Author:
- Tao Lin, Daniel Naber
|
Method Summary |
org.apache.lucene.search.Query |
buildRelaxedQuery(PatternRule rule)
Iterate over all elements, ignore those not supported, add the other ones to a BooleanQuery. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FIELD_NAME
public static final String FIELD_NAME
- See Also:
- Constant Field Values
FIELD_NAME_LOWERCASE
public static final String FIELD_NAME_LOWERCASE
- See Also:
- Constant Field Values
PatternRuleQueryBuilder
public PatternRuleQueryBuilder(Language language)
buildRelaxedQuery
public org.apache.lucene.search.Query buildRelaxedQuery(PatternRule rule)
throws UnsupportedPatternRuleException
- Iterate over all elements, ignore those not supported, add the other ones to a BooleanQuery.
- Throws:
UnsupportedPatternRuleException - if no query could be created for the rule
Copyright © 2013. All Rights Reserved.