1

我从 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 稳定版(3.6),但后来我迁移到了开发者版(3.7)。所以我认为某处可能有一些旧的 Weka 图书馆,因此我:

  1. 未安装 Weka
  2. 删除的wekafiles目录
  3. weka.jar从我的磁盘中删除了任何文件
  4. 再次安装 Weka

但我仍然不断收到错误。

我一直在寻找解决方案,但一无所获……useDynamic属性 fromGenericPropertiesCreator.props设置为 on true

任何想法都会非常感激.....因为我已经用完了它们。

谢谢!

4

1 回答 1

0

Snowball 词干分析器在以下链接中以 jar 文件的形式提供,以及其用法 http://preciselyconcise.com/apis_and_installations/snowball_stemmer.php。jar 文件可以包含在您的类路径中

于 2014-02-25T15:31:52.677 回答