org.languagetool.dev.index
Class PatternRuleQueryBuilder

java.lang.Object
  extended by 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

Field Summary
static String FIELD_NAME
           
static String FIELD_NAME_LOWERCASE
           
 
Constructor Summary
PatternRuleQueryBuilder(Language language)
           
 
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 Detail

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
Constructor Detail

PatternRuleQueryBuilder

public PatternRuleQueryBuilder(Language language)
Method Detail

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.