想测试一下jwordnet怎样使用,摸索着写了一些代码,但好像行不通,请教各位高手。我是这样做的:首先在fileproperties.xml中配置了wordnet词典的位置,然后找到jwordnet提供的测试类ExamplesTest.java,向其中添加main方法,引用testMorphological()。代码如下: public void testMorphological() {
try {
JWNL.initialize(TestDefaults.getInputStream());
IndexWord iw = Dictionary.getInstance().lookupIndexWord(POS.VERB, "running-away");
System.out.println("Index word : " + iw.toString());
} catch (JWNLException e) {
e.printStackTrace();
}
}
public static void main(String[] args){
ExamplesTest test=new ExamplesTest();
test.testMorphological();
}
但在执行的时候出现了一个错误:Exception in thread "main" java.lang.NumberFormatException: For input string: "NUMBER_OF_VERB_FRAMES"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at net.didion.jwnl.data.VerbFrame.initialize(VerbFrame.java:22)
at net.didion.jwnl.JWNL.initialize(JWNL.java:145)
at net.didion.jwnl.test.generic.ExamplesTest.testMorphological(ExamplesTest.java:14)
at net.didion.jwnl.test.generic.ExamplesTest.main(ExamplesTest.java:28) 请问有没有人遇到过类似的问题?怎样解决呢?
try {
JWNL.initialize(TestDefaults.getInputStream());
IndexWord iw = Dictionary.getInstance().lookupIndexWord(POS.VERB, "running-away");
System.out.println("Index word : " + iw.toString());
} catch (JWNLException e) {
e.printStackTrace();
}
}
public static void main(String[] args){
ExamplesTest test=new ExamplesTest();
test.testMorphological();
}
但在执行的时候出现了一个错误:Exception in thread "main" java.lang.NumberFormatException: For input string: "NUMBER_OF_VERB_FRAMES"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at net.didion.jwnl.data.VerbFrame.initialize(VerbFrame.java:22)
at net.didion.jwnl.JWNL.initialize(JWNL.java:145)
at net.didion.jwnl.test.generic.ExamplesTest.testMorphological(ExamplesTest.java:14)
at net.didion.jwnl.test.generic.ExamplesTest.main(ExamplesTest.java:28) 请问有没有人遇到过类似的问题?怎样解决呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货