WiktionaryResource extends AbstractResource { public boolean containsLexeme(String lexeme) { boolean contained = false; List<WordEntry> words = wkt.getWordEntries(lexeme); if (words.size() != 0) { contained = true; } return contained; } WiktionaryResource(
    		Language language,
    		String wiktionaryDirectory); @Override void setIsCaseSensitive(boolean isCaseSensitive); @Override boolean getIsCaseSensitive(); boolean containsLexeme(String lexeme); boolean containsEntity(Entity entity); Set<Entity> getEntity(String lexeme); Set<Entity> getEntity(String lexeme, PoS pos); Set<Entity> getEntity(String lexeme, PoS pos, String sense); Set<Entity> getParents(Entity entity); Set<Entity> getChildren(Entity entity); int getNumberOfEntities(); Iterable<Entity> getEntities(); @Override Set<Entity> getNeighbors(Entity entity); String getResourceName(); String getResourceVersion(); int getShortestPathLength(Entity firstEntity, Entity secondEntity); String getGloss(Entity entity); Set<Entity> getRelatedEntities(Entity entity, SemanticRelation semanticRelation); Set<String> getRelatedLexemes(String lexeme, PoS pos, String sense, LexicalRelation lexicalRelation); @Override Entity getRoot(); @Override Entity getRoot(PoS pos); @Override Entity getMostFrequentEntity(String lexeme); @Override Entity getMostFrequentEntity(String lexeme, PoS pos);  }
@Test public void testContainsLexeme() throws Exception { wiktionaryGerman.setIsCaseSensitive(true); assertTrue("Baum", wiktionaryGerman.containsLexeme("Baum")); assertFalse("baum", wiktionaryGerman.containsLexeme("baum")); assertFalse("tree", wiktionaryGerman.containsLexeme("tree")); assertFalse("tree", wiktionaryGerman.containsLexeme("Tree")); assertFalse("grhphafah", wiktionaryGerman.containsLexeme("grhphafah")); wiktionaryGerman.setIsCaseSensitive(false); assertTrue("Baum", wiktionaryGerman.containsLexeme("Baum")); assertTrue("baum", wiktionaryGerman.containsLexeme("baum")); assertFalse("tree", wiktionaryGerman.containsLexeme("tree")); assertFalse("tree", wiktionaryGerman.containsLexeme("Tree")); wiktionaryEnglish.setIsCaseSensitive(true); assertTrue("tree", wiktionaryEnglish.containsLexeme("tree")); assertFalse("Tree", wiktionaryEnglish.containsLexeme("Tree")); assertFalse("grhphafah", wiktionaryEnglish.containsLexeme("grhphafah")); wiktionaryEnglish.setIsCaseSensitive(false); assertTrue("tree", wiktionaryEnglish.containsLexeme("tree")); assertTrue("Tree", wiktionaryEnglish.containsLexeme("Tree")); assertFalse("grhphafah", wiktionaryEnglish.containsLexeme("grhphafah")); }