java - How to find Derivationally Related Forms of a wordnet synset through MIT JWI? -
when retrieving semantic relations of synset through mit java wordnet interface (jwi) can't derivationally related forms. i'm using isynset class method getrelatedsynsets(ipointer p)
, list returns empty.
as simple test developed class iterates noun synsets of wordnet , tries find synset exposing derivationally related form. surprisingly code can't find single synset relation. here code:
public class derivationallytest { private static idictionary dict = null; public static void main(string[] args) throws ioexception { idictionary dict = dicitionaryfactory(); iterator<isynset> = dict.getsynsetiterator(pos.noun); while(it.hasnext()){ isynset synset = it.next(); if(synset.getrelatedsynsets(pointer.derivationally_related).size() > 0){ system.out.println("found one!!!"); } } } public static idictionary dicitionaryfactory() throws ioexception{ if(dict == null){ system.out.println("instanciando dicionario..."); // construct url wordnet dictionary directory string wnhome = system.getenv("wnhome"); string path = wnhome + file.separator + "dict"; url url = new url("file", null, path); // construct dictionary object , open dict = new dictionary(url); dict.open(); } return dict; } }
am doing wrong or actual bizarre behavior? have developed lot of classes using mit jwi , wouldn't have change api after som work.
i'm using wordnet 3.1 , mit jwi 2.2.3 under ubuntu 12 lts
update: tried wordnet 3.0 , same thing happens.
only semantic pointers attach synsets. lexical pointers attach words. try: iword.getrelatedwords(ipointer ptr)
Comments
Post a Comment