NoSuchMethodError: de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordSegmenter.isWriteToken()Z

NoSuchMethodError: de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordSegmenter.isWriteToken()Z

脚本

//------------------------------------------------------------------------
//      DKPRO - Imports
//------------------------------------------------------------------------
IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos FROM  GeneratedDKProCoreTypes AS pos;
IMPORT de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma FROM GeneratedDKProCoreTypes;

UIMAFIT de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordSegmenter;
UIMAFIT de.tudarmstadt.ukp.dkpro.core.treetagger.TreeTaggerPosLemmaTT4J;//TreeTaggerPosTagger
//------------------------------------------------------------------------


//------------------------------------------------------------------------
//      DKPRO - Execution
//-------------------------------------------------- ----------------------

Document{-CONTAINS(pos.POS)} -> {
Document{-> SETFEATURE("language", "en")}; //"de"
Document{-> EXEC(StanfordSegmenter)};
Document{-> EXEC(TreeTaggerPosLemmaTT4J, {pos.POS})};//(TreeTaggerPosTagger, {pos.POS})};
};
//------------------------------------------------------------------------


//------------------------------------------------------------------------
//      DKPRO - Test
//------------------------------------------------------------------------
DECLARE DZC_DkProTest;
pos.NP{-> MARK(DZC_DkProTest)};
//------------------------------------------------------------------------

简而言之错误

org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator processing failed.    

Caused by: java.lang.NoSuchMethodError: de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordSegmenter.isWriteToken()Z

未找到属于 StanfordSegmenter 一部分的方法 isWriteToken(),这会导致错误。它要么不存在,要么你拼错了。

如果没有更多信息,我真的不知道还能告诉你什么。

我将 Maven 中的 DKPro Core 版本从 1.5.0 更改为 1.7.0,然后问题得到解决。我可以在 de.tudarmstadt.ukp.dkpro.core.api.segmentation.SegmenterBase class.

中找到 isWriteToken() 方法