@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))); }
public Stream<String> getSuperSenses(POS pos, String word) { final Optional<IndexWord> indexWord = lookupWord(pos, word); if (!indexWord.isPresent()) { return Stream.empty(); } else { final List<Synset> senses = indexWord.get().getSenses(); final Set<String> set = new HashSet<>(); for (final Synset s : senses) { set.add(stripPOSFromSupersense(s.getLexFileName())); } return set.stream(); } }
SharedWordNetResource extends BaleenResource { public Stream<String> getSuperSenses(POS pos, String word) { final Optional<IndexWord> indexWord = lookupWord(pos, word); if (!indexWord.isPresent()) { return Stream.empty(); } else { final List<Synset> senses = indexWord.get().getSenses(); final Set<String> set = new HashSet<>(); for (final Synset s : senses) { set.add(stripPOSFromSupersense(s.getLexFileName())); } return set.stream(); } } }
SharedWordNetResource extends BaleenResource { public Stream<String> getSuperSenses(POS pos, String word) { final Optional<IndexWord> indexWord = lookupWord(pos, word); if (!indexWord.isPresent()) { return Stream.empty(); } else { final List<Synset> senses = indexWord.get().getSenses(); final Set<String> set = new HashSet<>(); for (final Synset s : senses) { set.add(stripPOSFromSupersense(s.getLexFileName())); } return set.stream(); } }  }
SharedWordNetResource extends BaleenResource { public Stream<String> getSuperSenses(POS pos, String word) { final Optional<IndexWord> indexWord = lookupWord(pos, word); if (!indexWord.isPresent()) { return Stream.empty(); } else { final List<Synset> senses = indexWord.get().getSenses(); final Set<String> set = new HashSet<>(); for (final Synset s : senses) { set.add(stripPOSFromSupersense(s.getLexFileName())); } return set.stream(); } }  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 Stream<String> getSuperSenses(POS pos, String word) { final Optional<IndexWord> indexWord = lookupWord(pos, word); if (!indexWord.isPresent()) { return Stream.empty(); } else { final List<Synset> senses = indexWord.get().getSenses(); final Set<String> set = new HashSet<>(); for (final Synset s : senses) { set.add(stripPOSFromSupersense(s.getLexFileName())); } return set.stream(); } }  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);  }