WordNetResource extends AbstractResource { @Override public Iterable<Entity> getEntities() { return new WordNetEntityIterable(dict); } 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 @Ignore("There seems to be a bug in the WordNet API causing containsEntity() return false " + "on some entities- See Bug 161") public void testGetEntities() throws LexicalSemanticResourceException { wordnet.setIsCaseSensitive(false); int i = 0; for (Entity entity : wordnet.getEntities()) { Set<String> testLexemes = entity.getLexemes(); StringBuilder sb = new StringBuilder(); for (String t : testLexemes) { sb.append(t + " " + entity.getSense(t) + " "); } sb.append(entity.getPos()); assertTrue(entity.toString(), wordnet.containsEntity(entity)); i++; } assertEquals(117659, i); wordnet.setIsCaseSensitive(true); i = 0; for (Entity entity : wordnet.getEntities()) { Set<String> testLexemes = entity.getLexemes(); StringBuilder sb = new StringBuilder(); for (String t : testLexemes) { sb.append(t + " " + entity.getSense(t) + " "); } sb.append(entity.getPos()); ++i; assertTrue(entity.toString(), wordnet.containsEntity(entity)); } assertEquals(117659, i); }