MorphDictionaryImpl implements Serializable, MorphDictionary { @Override public List<Wordform> getEntries(String str) { WordformTSTSearchResult result = wfByString.getLongestPrefixMatch(str); if (result.isMatchExact()) return Lists.newArrayList(result); else if (wfPredictor != null) { return ImmutableList.copyOf(wfPredictor.predict(str, result)); } else { return ImmutableList.of(); } }  @Override GramModel getGramModel(); void setGramModel(GramModel gramModel); void addListener(MorphDictionaryListener listener); void removeListener(MorphDictionaryListener listener); void setWfPredictor(WordformPredictor wfPredictor); @Override List<Wordform> getEntries(String str); @Override String getVersion(); @Override String getRevision(); @Override synchronized void addLemma(Lemma l); @Override int getLemmaMaxId(); void addLemmaLinkType(LemmaLinkType linkType); void addLemmaLink(int from, int to, short linkTypeId); @Override LemmaLinkType getLemmaLinkType(short id); @Override Lemma getLemma(int lemmaId); @Override boolean containsGramSet(BitSet tag); @Override Map<Integer, LemmaLinkType> getLemmaOutlinks(int lemmaId); @Override Map<Integer, LemmaLinkType> getLemmaInlinks(int lemmaId); void addWordform(String text, Wordform wf);  }
@Test public void testGetEntries() { assertEquals(1, dict.getEntries("гаджимуратович").size()); assertEquals(3, dict.getEntries("село").size()); assertEquals(3, dict.getEntries("а").size()); assertEquals(4, dict.getEntries("мыркающий").size()); int prtfGramIdx = gm.getGrammemNumId("PRTF"); int verbGramIdx = gm.getGrammemNumId("VERB"); assertTrue(Wordform.getAllGramBits(dict.getEntries("мыркающий").get(0), dict).get(prtfGramIdx)); assertFalse(Wordform.getAllGramBits( dict.getEntries("мыркающий").get(0), dict).get(verbGramIdx)); int mascGramIdx = gm.getGrammemNumId("masc"); int singGramIdx = gm.getGrammemNumId("sing"); int femnGramIdx = gm.getGrammemNumId("femn"); int plurGramIdx = gm.getGrammemNumId("plur"); assertTrue(dict.getEntries("мыркающий").get(0).getGrammems() .get(mascGramIdx)); assertTrue(dict.getEntries("мыркающий").get(0).getGrammems() .get(singGramIdx)); assertFalse(dict.getEntries("мыркающий").get(0).getGrammems() .get(femnGramIdx)); assertFalse(dict.getEntries("мыркающий").get(0).getGrammems() .get(plurGramIdx)); }