@Test public void testSuperSense() throws JWNLException { final List<String> word = wnr.getSuperSenses(POS.VERB, "employs").collect(Collectors.toList()); Assert.assertTrue("consumption".equals(word.get(0)) || "consumption".equals(word.get(1))); Assert.assertTrue("social".equals(word.get(0)) || "social".equals(word.get(1))); }
@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()); } }