@Test public void testBestSuperSense() throws JWNLException { final Optional<String> word = wnr.getBestSuperSense(POS.VERB, "know"); Assert.assertEquals("cognition", word.get()); }
wordnet.getBestSuperSense(interaction.getWord().getPos(), lemma).orElse(lemma);
wordnet.getBestSuperSense(interaction.getWord().getPos(), lemma).orElse(lemma);
@Test public void testMissingLookupWord() throws JWNLException { final Optional<IndexWord> word1 = wnr.lookupWord(POS.VERB, "ascasdcscz"); Assert.assertFalse(word1.isPresent()); final Optional<IndexWord> word2 = wnr.getWord(POS.VERB, "ascasdcscz"); Assert.assertFalse(word2.isPresent()); final long count = wnr.getSuperSenses(POS.VERB, "ascasdcscz").count(); Assert.assertEquals(0, count); final Optional<String> word = wnr.getBestSuperSense(POS.VERB, "ascasdcscz"); Assert.assertFalse(word.isPresent()); } }