我正在尝试将 UIMA 框架与 Eclipse 一起使用,但未能自己完成第一个教程中的一个......
(我首先尝试用文字等做自己的注释器,然后得到完全相同的错误:未找到注释器类“*”。所以我回到教程来检查我错过了什么,但仍然会出现这种错误:/)
这是我的文件/目录结构
uima0
--- src
------- (default package)
---------- RoomNumber.java
---------- RoomNumber_Type.java
---------- RoomNumberAnnotator.java
--- JRE system Library [JavaSE-1.7]
--- Referenced Libraries
------ uima-core.jar
--- descriptors
------ RoomNumberAnnotator.xml
------ typeSystemDescriptor.xml
--- lib
------- uima-core.jar
RoomNumber.java 和 RoomNumber_Type.java 是通过 typeSystemDescriptor.xml / Open With / Component Descriptor Editor => JCasGen 自动生成的
我认为对于 RoomNumberAnnotator.xml 和 typeSystemDescriptor.xml(见下文),我确实有它们内部需要的东西
RoomNumerAnnotator.java 是教程之一的复制粘贴(http://uima.apache.org/d/uimaj-2.3.1/tutorials_and_users_guides.html#d4e236)
我认为我已经设置了正确的环境变量 UIMA_HOME。
我将示例目录项目与包含的 DocumentAnalyzer 一起使用,以检查我自己的 RoomNumerAnnotator
我总是得到一个:
* org.apache.uima.resource.ResourceInitializationException:未找到注释器类“RoomNumberAnnotator”。(描述符:file:/D:/eclipseWorkspace/uima0/descriptors/RoomNumberAnnotator.xml)在 org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:207) 在 org.apache.uima.analysis_engine.impl .PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:156) [...]*
我忘记或错过了什么?
(看起来它可能会错过我的 RoomNumberAnnotator.java 所在的位置与 uimaj-examples 提供的内置 DocumentAnalyzer 之间的一些链接?顺便说一句,我不知道如何用 Eclipse 和/或 UIMA 配置文件说/更正)
---8<--- RoomNumberAnnotator.xml:
<?xml version="1.0" encoding="UTF-8"?>
<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
<frameworkImplementation>org.apache.uima.java</frameworkImplementation>
<primitive>true</primitive>
<annotatorImplementationName>RoomNumberAnnotator</annotatorImplementationName>
<analysisEngineMetaData>
<name>RoomNumberAnnotator</name>
<description/>
<version>1.0</version>
<vendor/>
<configurationParameters/>
<configurationParameterSettings/>
<typeSystemDescription>
<imports>
<import location="typeSystemDescriptor.xml"/> <!-- here putting full path as : import location="file:/D:/eclipseWorkspace/uima0/descriptors/typeSystemDescriptor.xml" did not help -->
</imports>
</typeSystemDescription>
<typePriorities/>
<fsIndexCollection/>
<capabilities>
<capability>
<inputs/>
<outputs>
<type>RoomNumber</type>
<feature>RoomNumber:building</feature>
</outputs>
<languagesSupported/>
</capability>
</capabilities>
<operationalProperties>
<modifiesCas>true</modifiesCas>
<multipleDeploymentAllowed>true</multipleDeploymentAllowed>
<outputsNewCASes>false</outputsNewCASes>
</operationalProperties>
</analysisEngineMetaData>
<resourceManagerConfiguration/>
</analysisEngineDescription>
---8<--- typeSystemDescriptor
<?xml version="1.0" encoding="UTF-8"?>
<typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
<name>typeSystemDescriptor</name>
<description/>
<version>1.0</version>
<vendor/>
<types>
<typeDescription>
<name>RoomNumber</name>
<description/>
<supertypeName>uima.tcas.Annotation</supertypeName>
<features>
<featureDescription>
<name>building</name>
<description/>
<rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
</features>
</typeDescription>
</types>
</typeSystemDescription>