WordNetResource extends AbstractResource { @Override public String getGloss(Entity entity) throws LexicalSemanticResourceException { StringBuilder sb = new StringBuilder(); Set<Synset> synsets = WordNetUtils.entityToSynsets(dict, entity, isCaseSensitive); for (Synset synset : synsets) { sb.append(synset.getGloss()); sb.append(" "); } return sb.toString().trim(); } WordNetResource();  WordNetResource(String wordNetPropertiesFile); @Override boolean containsLexeme(String lexeme); @Override boolean containsEntity(Entity entity); @Override Set<Entity> getEntity(String lexeme); @Override Set<Entity> getEntity(String lexeme, PoS pos); @Override Set<Entity> getEntity(String lexeme, PoS pos, String sense); Set<Entity> getEntity(String lexeme, PoS pos, int sense); @Override Set<Entity> getParents(Entity entity); @Override int getNumberOfEntities(); @Override Iterable<Entity> getEntities(); @Override Set<Entity> getChildren(Entity entity); @Override String getResourceName(); @Override String getResourceVersion(); @Override int getShortestPathLength(Entity firstEntity, Entity secondEntity); @Override String getGloss(Entity entity); @Override Set<String> getRelatedLexemes(String lexeme, PoS pos, String sense, LexicalRelation lexicalRelation); @Override Set<Entity> getRelatedEntities(Entity entity, SemanticRelation semanticRelation); Set<Entity> getRelatedEntitiesByName(Entity entity, String semanticRelation); @Override Entity getRoot(); @Override Entity getRoot(PoS pos); @Override Entity getMostFrequentEntity(String lexeme); @Override Entity getMostFrequentEntity(String lexeme, PoS pos); Dictionary getDict();  }
@Test public void testGetGloss() throws LexicalSemanticResourceException { wordnet.setIsCaseSensitive(false); Entity e = new Entity("knocked-out", PoS.adj, "680634"); String gloss = "damaged; \"the gym has some of the most knocked-out equipment since Vic Tanny\""; assertEquals(gloss, wordnet.getGloss(e)); Entity e2 = new Entity("laugh", PoS.n, "6778102"); String gloss2 = "a humorous anecdote or remark intended to provoke laughter; \"he told a very funny joke\"; " + "\"he knows a million gags\"; \"thanks for the laugh\"; \"he laughed unpleasantly at his own jest\"; " + "\"even a schoolboy's jape is supposed to have some ascertainable point\""; assertEquals(gloss2, wordnet.getGloss(e2)); wordnet.setIsCaseSensitive(true); e = new Entity("knocked-out", PoS.adj, "680634"); gloss = "damaged; \"the gym has some of the most knocked-out equipment since Vic Tanny\""; assertEquals(gloss, wordnet.getGloss(e)); e = new Entity("Knocked-out", PoS.adj, "680634"); assertEquals("", wordnet.getGloss(e)); e2 = new Entity("laugh", PoS.n, "6778102"); gloss2 = "a humorous anecdote or remark intended to provoke laughter; \"he told a very funny joke\"; " + "\"he knows a million gags\"; \"thanks for the laugh\"; \"he laughed unpleasantly at his own jest\"; " + "\"even a schoolboy's jape is supposed to have some ascertainable point\""; assertEquals(gloss2, wordnet.getGloss(e2)); e2 = new Entity("Laugh", PoS.n, "6778102"); assertEquals("", wordnet.getGloss(e2)); }