Examples of SpellChecker


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

                  lastRefresh = System.currentTimeMillis();
               }
               return null;
            }
         });
         this.spellChecker = new SpellChecker(spellIndexDirectory);
         this.spellChecker.setAccuracy(minDistance);
         this.morePopular = morePopular;
         refreshSpellChecker();
      }
View Full Code Here

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

                  lastRefresh = System.currentTimeMillis();
               }
               return null;
            }
         });
         this.spellChecker = new SpellChecker(spellIndexDirectory);
         this.spellChecker.setAccuracy(minDistance);
         this.morePopular = morePopular;
         refreshSpellChecker();
      }
View Full Code Here

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

         this.spellIndexDirectory = FSDirectory.getDirectory(path, new NativeFSLockFactory(path));
         if (IndexReader.indexExists(spellIndexDirectory))
         {
            this.lastRefresh = System.currentTimeMillis();
         }
         this.spellChecker = new SpellChecker(spellIndexDirectory);
         refreshSpellChecker();
      }
View Full Code Here

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

            dictName.equals(SolrSpellChecker.DEFAULT_DICTIONARY_NAME) == true);
    RefCounted<SolrIndexSearcher> holder = core.getSearcher();
    SolrIndexSearcher searcher = holder.get();
    try {
    checker.build(core, searcher);
    SpellChecker sc = checker.getSpellChecker();
    assertTrue("sc is null and it shouldn't be", sc != null);
    StringDistance sd = sc.getStringDistance();
    assertTrue("sd is null and it shouldn't be", sd != null);
    assertTrue("sd is not an instance of " + JaroWinklerDistance.class.getName(), sd instanceof JaroWinklerDistance);
    } finally {
      holder.decref();
    }
View Full Code Here

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

      this.spellIndexDirectory = FSDirectory.getDirectory(path,
        new NativeFSLockFactory(path));
      if (IndexReader.indexExists(spellIndexDirectory)) {
    this.lastRefresh = System.currentTimeMillis();
      }
      this.spellChecker = new SpellChecker(spellIndexDirectory);
      refreshSpellChecker();
  }
View Full Code Here

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

        File spellFile = FileWrapper.toFile(dir);
        spellDir = FSDirectory.getDirectory(spellFile);
        reader = _getReader(id,false);
        Dictionary dictionary = new LuceneDictionary(reader,"contents");
     
        SpellChecker spellChecker = new SpellChecker(spellDir);
        spellChecker.indexDictionary(dictionary);
     
      }
      catch(IOException ioe) {
        throw new SearchException(ioe);
      }
View Full Code Here

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

                boolean setSuggestionQuery=false;
                while(it.hasNext()) {
                  id=(String) it.next();
                  // add to set to remove duplicate values
                  SuggestionItem si;
                  SpellChecker sc = getSpellChecker(id);
                  for(int i=0;i<strLiterals.length;i++) {
                    String[] arr = sc.suggestSimilar(strLiterals[i], 1000);
                    if(arr.length>0){
                      literals[i].set("<suggestion>"+arr[0]+"</suggestion>");
                      setSuggestionQuery=true;
                     
                      si=(SuggestionItem) suggestions.get(strLiterals[i]);
View Full Code Here

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

       
    }
   
    private SpellChecker getSpellChecker(String id) throws IOException {
      FSDirectory siDir = FSDirectory.getDirectory(FileWrapper.toFile(_getSpellDirectory(id)));
        SpellChecker spellChecker = new SpellChecker(siDir);
        return spellChecker;
    }
View Full Code Here

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

         this.spellIndexDirectory = FSDirectory.getDirectory(path, new NativeFSLockFactory(path));
         if (IndexReader.indexExists(spellIndexDirectory))
         {
            this.lastRefresh = System.currentTimeMillis();
         }
         this.spellChecker = new SpellChecker(spellIndexDirectory);
         this.spellChecker.setAccuracy(0.55f);
         refreshSpellChecker();
      }
View Full Code Here

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

                  lastRefresh = System.currentTimeMillis();
               }
               return null;
            }
         });
         this.spellChecker = new SpellChecker(spellIndexDirectory);
         this.spellChecker.setAccuracy(minDistance);
         this.morePopular = morePopular;
         refreshSpellChecker();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.