Package org.languagetool.dev.index
Class PatternRuleQueryBuilder
java.lang.Object
org.languagetool.dev.index.PatternRuleQueryBuilder
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
-
Constructor Summary
ConstructorsConstructorDescriptionPatternRuleQueryBuilder(Language language, org.apache.lucene.search.IndexSearcher indexSearcher) PatternRuleQueryBuilder(Language language, org.apache.lucene.search.IndexSearcher indexSearcher, String searchFieldName) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.QueryIterate over all elements, ignore those not supported, add the other ones to a BooleanQuery.
-
Constructor Details
-
PatternRuleQueryBuilder
public PatternRuleQueryBuilder(Language language, org.apache.lucene.search.IndexSearcher indexSearcher) -
PatternRuleQueryBuilder
-
-
Method Details
-
buildRelaxedQuery
public org.apache.lucene.search.Query buildRelaxedQuery(AbstractPatternRule 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
-