Java 类org.apache.lucene.search.spell.SuggestWordFrequencyComparator 实例源码

项目:search    文件:IndexBasedSpellCheckerTest.java   
@Test
public void testComparator() throws Exception {
  SpellCheckComponent component = (SpellCheckComponent) h.getCore().getSearchComponent("spellcheck");
  assertNotNull(component);
  AbstractLuceneSpellChecker spellChecker;
  Comparator<SuggestWord> comp;
  spellChecker = (AbstractLuceneSpellChecker) component.getSpellChecker("freq");
  assertNotNull(spellChecker);
  comp = spellChecker.getSpellChecker().getComparator();
  assertNotNull(comp);
  assertTrue(comp instanceof SuggestWordFrequencyComparator);

  spellChecker = (AbstractLuceneSpellChecker) component.getSpellChecker("fqcn");
  assertNotNull(spellChecker);
  comp = spellChecker.getSpellChecker().getComparator();
  assertNotNull(comp);
  assertTrue(comp instanceof SampleComparator);


}
项目:NYBC    文件:IndexBasedSpellCheckerTest.java   
@Test
public void testComparator() throws Exception {
  SpellCheckComponent component = (SpellCheckComponent) h.getCore().getSearchComponent("spellcheck");
  assertNotNull(component);
  AbstractLuceneSpellChecker spellChecker;
  Comparator<SuggestWord> comp;
  spellChecker = (AbstractLuceneSpellChecker) component.getSpellChecker("freq");
  assertNotNull(spellChecker);
  comp = spellChecker.getSpellChecker().getComparator();
  assertNotNull(comp);
  assertTrue(comp instanceof SuggestWordFrequencyComparator);

  spellChecker = (AbstractLuceneSpellChecker) component.getSpellChecker("fqcn");
  assertNotNull(spellChecker);
  comp = spellChecker.getSpellChecker().getComparator();
  assertNotNull(comp);
  assertTrue(comp instanceof SampleComparator);


}
项目:search-core    文件:IndexBasedSpellCheckerTest.java   
@Test
public void testComparator() throws Exception {
  SpellCheckComponent component = (SpellCheckComponent) h.getCore().getSearchComponent("spellcheck");
  assertNotNull(component);
  AbstractLuceneSpellChecker spellChecker;
  Comparator<SuggestWord> comp;
  spellChecker = (AbstractLuceneSpellChecker) component.getSpellChecker("freq");
  assertNotNull(spellChecker);
  comp = spellChecker.getSpellChecker().getComparator();
  assertNotNull(comp);
  assertTrue(comp instanceof SuggestWordFrequencyComparator);

  spellChecker = (AbstractLuceneSpellChecker) component.getSpellChecker("fqcn");
  assertNotNull(spellChecker);
  comp = spellChecker.getSpellChecker().getComparator();
  assertNotNull(comp);
  assertTrue(comp instanceof SampleComparator);


}