Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

跑测试程序失败 #58

Open
BenXu86 opened this issue Dec 14, 2017 · 2 comments
Open

跑测试程序失败 #58

BenXu86 opened this issue Dec 14, 2017 · 2 comments

Comments

@BenXu86
Copy link

BenXu86 commented Dec 14, 2017

当运行如下代码时,发生错误:

	CNFactory factory = CNFactory.getInstance("models");
	HashMap<String, String> result = factory.ner("詹姆斯·默多克和丽贝卡·布鲁克斯 鲁珀特·默多克旗下的美国小报《纽约邮报》的职员被公司律师告知,保存任何也许与电话窃听及贿赂有关的文件。");

	 	// 显示标注结果
	System.out.println(result);

报如下错误:

Exception in thread "main" java.lang.NoClassDefFoundError: gnu/trove/map/hash/TCharCharHashMap
	at org.fnlp.nlp.cn.ChineseTrans.ensureST(ChineseTrans.java:54)
	at org.fnlp.nlp.cn.ChineseTrans.<init>(ChineseTrans.java:48)
	at org.fnlp.nlp.cn.CNFactory.<clinit>(CNFactory.java:54)
	at Test.main(Test.java:9)
Caused by: java.lang.ClassNotFoundException: gnu.trove.map.hash.TCharCharHashMap
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 4 more

我在您给的链接上下载的trove,但并没有TCharCharHashMap这个类。
请问,这个问题怎么解决?

@BenXu86
Copy link
Author

BenXu86 commented Dec 14, 2017

解决了,导入的jar包应该是trove-3.0.3.jar而不是trove-3.0.3-src.jar

@ps360pa
Copy link

ps360pa commented Mar 5, 2018

您好,models文件夹下没有seg.m 以及pos.m这两个文件,请问该如何解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants