帮助执行此 Java 应用程序
我收到了这个源代码:http://www.sbbic.org/split.zip Apache 2.0 许可证:http://www.apache.org/licenses/LICENSE-2.0
它是作者在没有文档或支持的情况下给我的(作者现在没有时间,他正在写一本书)。我对Java的了解非常有限。
有人可以告诉我如何运行应用程序以拆分源中包含的 columns.txt 文件中的单词吗?
我在 TextSegmenter.java 中四处查看,试图找到如何在命令行上调用它,但没有成功。
如果我调用: java com\whitemagicsoftware\dictionary\TextSegmenter lexicon.csv columns.txt 我收到此错误:
线程“main”中出现异常 java.lang.NoClassDefFoundError: com\whitemagicsoftwar e\dictionary\TextSegmenter (错误 姓名: com/whitemagicsoftware/dictionary/TextSe 格门特尔) 在 java.lang.ClassLoader.defineClass1(Native 方法) 在 java.lang.ClassLoader.defineClass(ClassLoader.java:620) 在 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12 4) 在 java.net.URLClassLoader.defineClass(URLClassLoader.java:260) 在 java.net.URLClassLoader.access$000(URLClassLoader.java:56) 在 java.net.URLClassLoader$1.run(URLClassLoader.java:195) 在java.security.AccessController.doPrivileged(本机 方法) 在 java.net.URLClassLoader.findClass(URLClassLoader.java:188) 在 java.lang.ClassLoader.loadClass(ClassLoader.java:306) 在 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) 在 java.lang.ClassLoader.loadClass(ClassLoader.java:251) 在 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
我尝试将其放入 .jar 中(再次由于经验有限,我只压缩了包含手动创建的清单文件的文件),但它无法加载。
我是新手 - 抱歉,如果这是一个愚蠢的问题,但我将感谢您的帮助!
该脚本的目的是将连接的单词(例如“addresstype”)分解为单独的单词(例如“address”和“type”)。希望使用此脚本来破译高棉语的单词,该语言在单词之间不使用空格。
谢谢你!
I received this source code: http://www.sbbic.org/split.zip under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
It came to me from the author without documentation or support (the author doesn't have the time right now, he is writing a book). My knowledge of Java is very limited.
Can someone tell me how to run the application in order to split the words in columns.txt file that is included in the source?
I've looked around in TextSegmenter.java trying to find how it should be called on the command line, but I have not been successful.
If I call: java com\whitemagicsoftware\dictionary\TextSegmenter lexicon.csv columns.txt
I get this error:
Exception in thread "main"
java.lang.NoClassDefFoundError:
com\whitemagicsoftwar
e\dictionary\TextSegmenter (wrong
name:
com/whitemagicsoftware/dictionary/TextSe
gmenter)
at java.lang.ClassLoader.defineClass1(Native
Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native
Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
I tried putting it into a .jar (again with limited experience, I only zipped the files with manually created manifest files included), but it is unable to load.
I am a newbee - sorry if this is a dumb question, but I would appreciate your help!
The purpose of the script is to break words that are joined (ex. "addresstype") into separate words (ex. "address" and "type"). The hope is to use this script in breaking words for the Khmer language which uses no spaces between words.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在 CLASSPATH 上缺少外部库。您必须设置 CLASSPATH 环境变量,或者通过 -cp 选项将类路径传递给 java 命令,例如
You are missing external libraries on the CLASSPATH. You have to set the CLASSPATH environment variable, or pass a classpath to the java command via the -cp option, like