Package org.languagetool.dev.index
Class Searcher
java.lang.Object
org.languagetool.dev.index.Searcher
A class with a main() method that takes a rule id and the location of the
index that runs the query on that index and prints all matches.
Will transparently handle rules that are not supported, i.e. run on the candidate matches
up to a limit.
See
Indexer for how to create the index.- Author:
- Tao Lin, Daniel Naber
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindRuleMatchesOnIndex(PatternRule rule, Language language) findRuleMatchesOnIndex(PatternRule rule, Language language, String fieldName) intintintintstatic voidvoidsetMaxHits(int maxHits) voidsetMaxSearchTimeMillis(int maxSearchTimeMillis) voidsetSkipHits(int skipHits)
-
Constructor Details
-
Searcher
public Searcher(org.apache.lucene.store.Directory directory) -
Searcher
-
-
Method Details
-
getDocCount
- Throws:
IOException
-
getMaxHits
public int getMaxHits() -
setMaxHits
public void setMaxHits(int maxHits) -
getSkipHits
public int getSkipHits() -
setSkipHits
public void setSkipHits(int skipHits) -
getMaxSearchTimeMillis
public int getMaxSearchTimeMillis() -
setMaxSearchTimeMillis
public void setMaxSearchTimeMillis(int maxSearchTimeMillis) -
findRuleMatchesOnIndex
public SearcherResult findRuleMatchesOnIndex(PatternRule rule, Language language) throws IOException, UnsupportedPatternRuleException -
findRuleMatchesOnIndex
public SearcherResult findRuleMatchesOnIndex(PatternRule rule, Language language, String fieldName) throws IOException, UnsupportedPatternRuleException - Throws:
IOExceptionUnsupportedPatternRuleException- Since:
- 4.8
-
main
- Throws:
Exception
-