Results 1 to 6 of 6
Thread: net.didion.jwnl exceptions
- 04-19-2011, 10:11 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 4
- Rep Power
- 0
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!!!!!!!!!!!
- 04-29-2011, 02:56 PM #2
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
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. :)
- 05-02-2011, 07:01 AM #3
Member
- Join Date
- Apr 2011
- Posts
- 4
- Rep Power
- 0
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.
- 05-02-2011, 07:05 AM #4
Member
- Join Date
- Apr 2011
- Posts
- 4
- Rep Power
- 0
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.
- 05-02-2011, 08:20 AM #5
Don't double post the same question.
wordnet domain specific dictionary
db
-
Similar Threads
-
Jwnl
By h.ghorashi in forum Web FrameworksReplies: 0Last Post: 02-16-2011, 03:18 PM -
help me in JWNL
By vissu007 in forum New To JavaReplies: 2Last Post: 03-30-2009, 02:04 PM -
Connection to WordNet with JWNL
By marlborino in forum New To JavaReplies: 2Last Post: 06-10-2008, 02:04 PM -
How to use JWNL in java program
By ak.bhartiya in forum Advanced JavaReplies: 2Last Post: 05-12-2008, 08:24 AM -
how to use jwnl.. i run a sample program it will ask properties file.. what can i do
By sathishk in forum New To JavaReplies: 1Last Post: 02-16-2008, 03:33 AM


LinkBack URL
About LinkBacks

Bookmarks