Mallet SimpleTagger Classpath

那年仲夏 提交于 2019-12-12 01:57:10

问题


I am going to use Mallet SimpleTagger for sequence tagging. However, I have problem with setting the classpath. As I have seen here: classpath

I must be able to use java -cp to set the classpath. I followed the instructions here (I am sure that I have installed Ant and Mallet correctly). However, I receive this message:

Error: could not find or load main class cc.mallet.fst.SimpleTagger

Here is the real code that I use:

C:\mallet> java -cp "C:\mallet\class:C:\mallet\lib\mallet-deps.jar" cc.mallet.fst.SimpleTagger --model-file G:\test1-model G:\test2-feats.txt

Meanwhile, when I run this command: echo %CLASSPATH%, it returns %CLASSPATH%.

I would be thankful if anybody can help me.


回答1:


Fortunately, thanks to comments and suggested link of @user2339071, I could solve the problem:

If you are using Windows OS, you must replace ":" with ";". So, this code worked for me:

C:\mallet> java -cp "C:\mallet\class;C:\mallet\lib\mallet-deps.jar" cc.mallet.fst.SimpleTagger --model-file G:\test1-model G:\test2-feats.txt

Actually, what is done with this code is that two different paths are determined as the classpath, one is the folder which includes .class files of mallet (C:\mallet\class) and the other one includes all required jar files (C:\mallet\lib\mallet-deps.jar) and you need to separate them with ";".

That's all!



来源:https://stackoverflow.com/questions/19219351/mallet-simpletagger-classpath

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