GermaNetResource extends AbstractResource { public boolean containsEntity(Entity entity) throws LexicalSemanticResourceException { Set<Synset> synset = GermaNetUtils.entityToSynsets(gn, entity); if (synset.size() == 0) { return false; } else { return true; } } GermaNetResource(String path, boolean ignoreCase);  GermaNetResource(String path); boolean containsEntity(Entity entity); boolean containsLexeme(String lexeme); Set<Entity> getEntity(String lexeme); Set<Entity> getEntity(String lexeme, PoS pos); Set<Entity> getEntity(String lexeme, PoS pos, String sense); Set<Entity> getChildren(Entity entity); Iterable<Entity> getEntities(); int getNumberOfEntities(); Set<Entity> getParents(Entity entity); String getResourceName(); String getResourceVersion(); int getShortestPathLength(Entity firstEntity, Entity secondEntity); String getGloss(Entity entity); Set<String> getRelatedLexemes(String lexeme, PoS pos, String sense, LexicalRelation lexicalRelation); Set<Entity> getRelatedEntities(Entity entity, SemanticRelation semanticRelation); @Override Entity getRoot(); @Override Entity getRoot(PoS pos); @Override Entity getMostFrequentEntity(String lexeme); @Override Entity getMostFrequentEntity(String lexeme, PoS pos);  }
@Test public void testContainsEntity() throws LexicalSemanticResourceException{ assertTrue(germaNetCaseInsensitive.containsEntity(new Entity("Auto"))); assertTrue(germaNetCaseInsensitive.containsEntity(new Entity("Auto",PoS.n))); assertFalse(germaNetCaseInsensitive.containsEntity(new Entity("Auto",PoS.v))); assertFalse(germaNetCaseInsensitive.containsEntity(new Entity("Auto",PoS.adj))); assertTrue(germaNetCaseInsensitive.containsEntity(new Entity("fahren",PoS.v))); assertTrue(germaNetCaseInsensitive.containsEntity(new Entity("schnell",PoS.adj))); assertFalse(germaNetCaseInsensitive.containsEntity(new Entity("humbelpfh"))); assertFalse(germaNetCaseInsensitive.containsEntity(new Entity("humbelpfh",PoS.n))); assertFalse(germaNetCaseInsensitive.containsEntity(new Entity("humbelpfh",PoS.n, "1"))); assertTrue(germaNet.containsEntity(new Entity("Auto"))); assertFalse(germaNet.containsEntity(new Entity("auto"))); assertTrue(germaNet.containsEntity(new Entity("Auto",PoS.n))); assertFalse(germaNet.containsEntity(new Entity("AuTo",PoS.n))); assertFalse(germaNet.containsEntity(new Entity("Auto",PoS.v))); assertFalse(germaNet.containsEntity(new Entity("Auto",PoS.adj))); assertTrue(germaNet.containsEntity(new Entity("fahren",PoS.v))); assertFalse(germaNet.containsEntity(new Entity("fAhren",PoS.v))); assertTrue(germaNet.containsEntity(new Entity("schnell",PoS.adj))); assertFalse(germaNet.containsEntity(new Entity("humbelpfh"))); assertFalse(germaNet.containsEntity(new Entity("humbelpfh",PoS.n))); assertFalse(germaNet.containsEntity(new Entity("humbelpfh",PoS.n, "1"))); }