@Test public void testGetWord() throws JWNLException { final Optional<IndexWord> missing = wnr.getWord(POS.VERB, "employs"); Assert.assertFalse(missing.isPresent()); final IndexWord employ = wnr.getWord(POS.VERB, "employ").get(); Assert.assertNotNull(employ); Assert.assertEquals("employ", employ.getLemma()); }
@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()); } }