@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()); }
public Optional<IndexWord> getWord(final POS pos, final String lemma) { try { return Optional.ofNullable(dictionary.getIndexWord(pos, lemma)); } catch (final JWNLException e) { getMonitor().warn("Get word failed", e); return Optional.empty(); } }
SharedWordNetResource extends BaleenResource { public Optional<IndexWord> getWord(final POS pos, final String lemma) { try { return Optional.ofNullable(dictionary.getIndexWord(pos, lemma)); } catch (final JWNLException e) { getMonitor().warn("Get word failed", e); return Optional.empty(); } } }
SharedWordNetResource extends BaleenResource { public Optional<IndexWord> getWord(final POS pos, final String lemma) { try { return Optional.ofNullable(dictionary.getIndexWord(pos, lemma)); } catch (final JWNLException e) { getMonitor().warn("Get word failed", e); return Optional.empty(); } }  }
SharedWordNetResource extends BaleenResource { public Optional<IndexWord> getWord(final POS pos, final String lemma) { try { return Optional.ofNullable(dictionary.getIndexWord(pos, lemma)); } catch (final JWNLException e) { getMonitor().warn("Get word failed", e); return Optional.empty(); } }  Dictionary getDictionary(); Optional<IndexWord> lookupWord(final POS pos, final String word); Optional<IndexWord> getWord(final POS pos, final String lemma); Stream<String> getSuperSenses(POS pos, String word); Optional<String> getBestSuperSense(POS pos, String word); }
SharedWordNetResource extends BaleenResource { public Optional<IndexWord> getWord(final POS pos, final String lemma) { try { return Optional.ofNullable(dictionary.getIndexWord(pos, lemma)); } catch (final JWNLException e) { getMonitor().warn("Get word failed", e); return Optional.empty(); } }  Dictionary getDictionary(); Optional<IndexWord> lookupWord(final POS pos, final String word); Optional<IndexWord> getWord(final POS pos, final String lemma); Stream<String> getSuperSenses(POS pos, String word); Optional<String> getBestSuperSense(POS pos, String word);  }