我在3天内陷入了这个问题,我找不到任何解决方案。我正在使用Weka开发人员版(3.7.10)使用NetBeans 7.3开发DM应用程序。我正在尝试使用Snowball词干分析器,当我在创建词干分析器时运行我的应用程序时,我一直得到相同的异常:
SnowballStemmer stemmer = new SnowballStemmer();
我得到的例外是:
Refreshing GOE props...
---Registering Weka Editors---
Exception in thread "AWT-EventQueue-0"
java.lang.IncompatibleClassChangeError: class weka.classifiers.JythonClassifier has interface weka.classifiers.Classifier as super class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at weka.core.ClassDiscovery.find(ClassDiscovery.java:343)
at weka.gui.GenericPropertiesCreator.generateOutputProperties(GenericPropertiesCreator.java:514)
at weka.gui.GenericPropertiesCreator.execute(GenericPropertiesCreator.java:606)
at weka.gui.GenericPropertiesCreator.execute(GenericPropertiesCreator.java:582)
at weka.core.converters.ConverterUtils.initialize(ConverterUtils.java:730)
at weka.core.converters.ConverterUtils.<clinit>(ConverterUtils.java:711)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at weka.core.ClassDiscovery.find(ClassDiscovery.java:343)
at weka.gui.GenericPropertiesCreator.generateOutputProperties(GenericPropertiesCreator.java:514)
at weka.gui.GenericPropertiesCreator.execute(GenericPropertiesCreator.java:606)
at weka.gui.GenericPropertiesCreator.<clinit>(GenericPropertiesCreator.java:149)
at weka.core.WekaPackageManager.refreshGOEProperties(WekaPackageManager.java:880)
at weka.core.WekaPackageManager.loadPackages(WekaPackageManager.java:874)
at weka.core.WekaPackageManager.loadPackages(WekaPackageManager.java:813)
at weka.gui.GenericObjectEditor.determineClasses(GenericObjectEditor.java:174)
at weka.gui.GenericObjectEditor.<clinit>(GenericObjectEditor.java:248)
at weka.core.stemmers.SnowballStemmer.initStemmers(SnowballStemmer.java:256)
at weka.core.stemmers.SnowballStemmer.setStemmer(SnowballStemmer.java:343)
at weka.core.stemmers.SnowballStemmer.<init>(SnowballStemmer.java:116)
at weka.core.stemmers.SnowballStemmer.<init>(SnowballStemmer.java:104)
at preproceso.TokenizadorNgram.<init>(TokenizadorNgram.java:54)
at preproceso.Preprocesamiento.tokenizar(Preprocesamiento.java:217)
at preproceso.PreprocesoPanel.btnAplicarTareasYTokenizarActionPerformed(PreprocesoPanel.java:562)
at preproceso.PreprocesoPanel.access$500(PreprocesoPanel.java:41)
at preproceso.PreprocesoPanel$6.actionPerformed(PreprocesoPanel.java:188)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
我想说的第一件事是包含snowball.jar
我的java项目中的文件。第一个奇怪的是我从不使用weka.classifiers.JythonClassifier
。接下来是我正在使用Weka-7.3.10,在这个版本中,JythonClassifier
从AbstractClassifier
延伸。似乎找到的JythonClassifier
是旧版本。
当我开始使用这个项目时,我开始使用Weka Stable Edition(3.6),但之后我迁移到了开发人员版(3.7)。所以我觉得某处可能有一些旧的Weka库,因此我:
wekafiles
目录weka.jar
文件但我仍然不断收到错误。
我正在寻找一个解决方案,但一无所获...... useDynamic
的{{1}}属性设置在GenericPropertiesCreator.props
上。
对任何想法都会非常感激.....因为我已经没有了。
谢谢!
答案 0 :(得分:0)
Snowball stemmer在以下链接中可用作jar文件及其用法 http://preciselyconcise.com/apis_and_installations/snowball_stemmer.php。 jar文件可以包含在类路径中