WordNetManager { public synchronized List<String> getHypernyms(String word, boolean firstOnly) throws JWNLException { return getRelatedWords(word, PointerType.HYPERNYM, firstOnly); } protected  WordNetManager(); synchronized static void loadConfigAsClasspathResource(boolean loadAsResource); static WordNetManager getInstance(); synchronized boolean existsEntry(String word, POS pos); synchronized Synset[] getAllSenses(String word, POS pos); synchronized List<String> getGlosses(String word, boolean firstOnly); synchronized List<String> getGlosses(String word, POS pos, boolean firstOnly); synchronized IndexWord getIndexWord(POS pos, String s); synchronized Synset getSynset(POS pos, long offset); synchronized String getLemma(String word, POS pos); synchronized Set<String> getLemmaAllPOS(String word); synchronized List<String> getLexicographerFileNames(String word, boolean firstOnly); synchronized List<String> getLexicographerFileNames(String word, POS pos,
            boolean firstOnly); synchronized Set<String> getPointers(String word, boolean firstOnly); synchronized Set<String> getPointers(String word, POS pos, boolean firstOnly); synchronized ArrayList<String> getMorphs(POS pos, String lexicalForm); synchronized Set<String> getMorphsAllPOS(String word); synchronized POS[] getPOS(String s); synchronized List<Synset> getRelated(String word, PointerType type, boolean firstOnly); synchronized List<Synset> getRelated(String word, POS pos, PointerType type,
            boolean firstOnly); synchronized List<String> getRelatedWords(String word, PointerType type,
            boolean firstOnly); synchronized List<String> getRelatedWords(String word, POS pos, PointerType type,
            boolean firstOnly); synchronized List<String> getHyponyms(String word, boolean firstOnly); synchronized List<String> getHyponyms(String word, POS pos, boolean firstOnly); synchronized List<String> getHypernyms(String word, boolean firstOnly); synchronized List<String> getHypernyms(String word, POS pos, boolean firstOnly); synchronized List<String> getSynsets(String word, boolean firstOnly); synchronized List<String> getSynsets(String word, POS pos, boolean firstOnly); synchronized List<String> getSynonyms(String word, boolean firstOnly); synchronized List<String> getSynonyms(String word, POS pos, boolean firstOnly); synchronized Set<String> getVerbFrames(String word, boolean firstOnly);  }
@Test public void testGetHypernyms() throws Exception { assertEquals(wordnet.getHypernyms("test", true).toString(), "[experiment, experimentation, evaluate, pass_judgment, judge]"); assertEquals(wordnet.getHypernyms("test", false).toString(), "[experiment, experimentation, mental_measurement, communication, communicating, attempt, effort, endeavor, endeavour, try, attempt, effort, endeavor, endeavour, try, covering, natural_covering, cover, evaluate, pass_judgment, judge, check, examine, be, score, determine, check, find_out, see, ascertain, watch, learn, take, submit]"); assertEquals(wordnet.getHypernyms("test", POS.NOUN, true).toString(), "[experiment, experimentation]"); assertEquals(wordnet.getHypernyms("test", POS.NOUN, false).toString(), "[experiment, experimentation, mental_measurement, communication, communicating, attempt, effort, endeavor, endeavour, try, attempt, effort, endeavor, endeavour, try, covering, natural_covering, cover]"); }