Results 1 to 6 of 6
  1. #1
    ramyaa shri is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Thumbs up net.didion.jwnl exceptions

    hi
    am doing a semantic annalysis using wordnet in eclipse.(ie) it extracts all related synsets for a particular word.

    my code is:


    import java.io.*;
    import net.didion.jwnl.JWNL;
    import net.didion.jwnl.data.*;
    import net.didion.jwnl.dictionary.Dictionary;

    public class synsetcatch {
    private static Dictionary dict = null;

    static
    {
    try
    {
    JWNL.initialize(new FileInputStream("C:\\Users\\255388\\Desktop\\b\\Bh arathi\\jwnl14-rc1\\jwnl14-rc1\\config\\file_properties.xml"));//this is where properties.xml file is located

    System.out.println("WordNet Initialized");
    dict = Dictionary.getInstance();
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    }

    public static void main(String args[])
    {
    int i = 1;

    try
    {
    IndexWord iw = Dictionary.getInstance().lookupIndexWord(POS.NOUN, "balance");
    //System.out.println("Index Word : "+ iw.toString());
    System.out.println(iw.getSenseCount()+"Senses of balance");
    for(Synset s:iw.getSenses())
    {
    System.out.println("Sense : " + i);
    for(Word w:s.getWords())
    {
    System.out.println(w.getLemma()+","); //gives the words of each sense

    } //for
    System.out.println("\\n\\n");
    i++;
    }
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    } //main
    } //class


    and when i debug i get the followin error:


    net.didion.jwnl.JWNLException: Unable to install net.didion.jwnl.dictionary.FileBackedDictionary
    at net.didion.jwnl.util.factory.Element.install(Eleme nt.java:34)
    at net.didion.jwnl.JWNL.initialize(JWNL.java:169)
    at words.synsetcatch.<clinit>(synsetcatch.java:18)
    Caused by: net.didion.jwnl.JWNLException: The properties file must specify a dictionary path
    at net.didion.jwnl.util.factory.AbstractValueParam.cr eate(AbstractValueParam.java:34)
    at net.didion.jwnl.dictionary.FileBackedDictionary.in stall(FileBackedDictionary.java:111)
    at net.didion.jwnl.util.factory.Element.install(Eleme nt.java:32)
    ... 2 more
    Caused by: net.didion.jwnl.JWNLException: Could not create a file manager of type class net.didion.jwnl.princeton.file.PrincetonRandomAcce ssDictionaryFile
    at net.didion.jwnl.dictionary.file_manager.FileManage rImpl.create(FileManagerImpl.java:98)
    at net.didion.jwnl.util.factory.AbstractValueParam.cr eate(AbstractValueParam.java:32)
    ... 4 more
    Caused by: java.io.FileNotFoundException: C:\Program Files\WordNet\2.1\dict\adv.idx (The system cannot find the file specified)
    at java.io.RandomAccessFile.open(Native Method)
    at java.io.RandomAccessFile.<init>(Unknown Source)
    at net.didion.jwnl.princeton.file.PrincetonRandomAcce ssDictionaryFile.openFile(PrincetonRandomAccessDic tionaryFile.java:76)
    at net.didion.jwnl.dictionary.file.AbstractDictionary File.open(AbstractDictionaryFile.java:58)
    at net.didion.jwnl.dictionary.file.DictionaryCatalog. open(DictionaryCatalog.java:45)
    at net.didion.jwnl.dictionary.file.DictionaryCatalogS et.open(DictionaryCatalogSet.java:34)
    at net.didion.jwnl.dictionary.file_manager.FileManage rImpl.<init>(FileManagerImpl.java:71)
    at net.didion.jwnl.dictionary.file_manager.FileManage rImpl.create(FileManagerImpl.java:96)
    ... 5 more
    java.lang.NullPointerException
    at words.synsetcatch.main(synsetcatch.java:34)



    please tell me a way to correct this error!!!!!!!!!!!

  2. #2
    sampada is offline Member
    Join Date
    Apr 2011
    Posts
    1
    Rep Power
    0

    Default

    Hi,

    Check in our file_properties.xml file and set your dictionary path correctly as well as your version of wordnet. It should work then. :)

  3. #3
    ramyaa shri is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default

    hey thanks!!!!

    but my error got solved only when i changed the name of the files in the dict folder (eg index.adv to adv.idx, index.sense to sense.idx). these files are located in the dict folder where ever your wordnet is installed.

  4. #4
    ramyaa shri is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default

    I have another doubt . Is it possible to develop a domain specific dictionary (for example say a dictionary related to finance ,accounts) in wordnet. Is some thing available or can it be developed in wordnet.

    please clarify.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,229
    Rep Power
    19

    Default

    Don't double post the same question.
    wordnet domain specific dictionary

    db

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Jwnl
    By h.ghorashi in forum Web Frameworks
    Replies: 0
    Last Post: 02-16-2011, 03:18 PM
  2. help me in JWNL
    By vissu007 in forum New To Java
    Replies: 2
    Last Post: 03-30-2009, 02:04 PM
  3. Connection to WordNet with JWNL
    By marlborino in forum New To Java
    Replies: 2
    Last Post: 06-10-2008, 02:04 PM
  4. How to use JWNL in java program
    By ak.bhartiya in forum Advanced Java
    Replies: 2
    Last Post: 05-12-2008, 08:24 AM
  5. Replies: 1
    Last Post: 02-16-2008, 03:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •