Package org.apache.lucene.search.spell

Examples of org.apache.lucene.search.spell.SuggestMode


    IndexReader reader = determineReader(options.reader);
    Term term = field != null ? new Term(field, "") : null;
    float theAccuracy = (options.accuracy == Float.MIN_VALUE) ? spellChecker.getAccuracy() : options.accuracy;
   
    int count = Math.max(options.count, AbstractLuceneSpellChecker.DEFAULT_SUGGESTION_COUNT);
    SuggestMode mode = options.onlyMorePopular ? SuggestMode.SUGGEST_MORE_POPULAR : SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX;
    for (Token token : options.tokens) {
      String tokenText = new String(token.buffer(), 0, token.length());
      String[] suggestions = spellChecker.suggestSimilar(tokenText,
              count,
            field != null ? reader : null, //workaround LUCENE-1295
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.spell.SuggestMode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.