Find synonyms using JAWS in netbeans

∥☆過路亽.° 提交于 2020-01-03 04:29:06

问题


import edu.smu.tspell.wordnet.NounSynset;
import edu.smu.tspell.wordnet.Synset;
import edu.smu.tspell.wordnet.SynsetType;
import edu.smu.tspell.wordnet.WordNetDatabase;
import javax.swing.JApplet;  
import javax.swing.JFrame;
public class JavaApplication4 
{
String a[]=new String[2];
public static void main(String a[])
{
String ar[]={"faith"};
int j=0;
while(j<2)
{
System.setProperty("wordnet.database.dir", "C:\\ProgramFiles(x86)\\WordNet\\2.1\\dict");
NounSynset nounSynset;
NounSynset[] hyponyms;
WordNetDatabase database = WordNetDatabase.getFileInstance();
Synset[] synsets = database.getSynsets(ar[j], SynsetType.NOUN);
System.out.println("*********************************************");
for (int i = 0; i < synsets.length; i++)
{
nounSynset = (NounSynset)(synsets[i]);
hyponyms = nounSynset.getHyponyms();
System.err.println(nounSynset.getWordForms()[0] +": " +      nounSynset.getDefinition() + ") has " + hyponyms.length + " hyponyms")           
}
j++;
}
System.out.println("*********************************************");
}
}

I get the error as Error opening index file:C:\ProgramFiles\WordNet\2.1\dict\index.sense . Does this JAWS work for windows? wats wrong with index.sense file


回答1:


I also faced the same problem in windows.

I changed the path of the dict to "C:\Program Files (x86)\WordNet\dict\", and did the same in System.setProperty as follows:

System.setProperty("wordnet.database.dir", "C:\Program Files (x86)\WordNet\dict\");

And it worked.



来源:https://stackoverflow.com/questions/28735706/find-synonyms-using-jaws-in-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!