uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thilo Goetz <twgo...@gmx.de>
Subject Re: Testing Your Annotator error
Date Wed, 15 Aug 2012 18:45:34 GMT
On 15.08.2012 18:08, Adriano Santos wrote:
> Hi all,
>
> I’m using the getting started page (
> http://uima.apache.org/d/uimaj-2.4.0/tutorials_and_users_guides.html#ugr.tug.aae.getting_started)
> for create an example.
>
> I created type file called “Term”, an annotator file called “TermAnnotator”
> and a descriptor file called “analyseTermDescriptor”.
>
> But when I’m testing my annotator, I receive a ClassNotFoundException -
> riso.annotator.TermAnnotator.

Maybe because your class is called TermAnnotation, not TermAnnotator?

>
> Thanks
>
>
>
> P.S: riso is my packet.
>
> - I’m using Eclipse.
>
>
> Paths
>
>                  *Classes*
>
>                                  uimaj-examples / src / riso.annotation
>
>                                                 Term_Type.java
>
>                                                 Term.java
>
>                                                 TermAnnotation.java
>
>
>
>                  *XML*
>
>                                 uimaj-examples / descriptors / riso
>
>                                                 analyseTermDescriptor.xml
>
>                                                 typeTermDescriptor.xml
>
>
>
> Values
>
> *TermAnnotation*
>
>                  *private* Pattern termPattern = Pattern.*compile*(
> "(^[A-Z]\\s)*"); //*Exemplo* *pra* *pegar* *acronomos* e *nome* *de* *
> pessoas*
>
>
>
>         @Override
>
>         *public* *void* process(JCas aJCas)
> *throws*AnalysisEngineProcessException {
>
>               // *TODO* Auto-generated method stub
>
>
>
>               //*Obtem* o *texto* do *documento*
>
>               String docText = aJCas.getDocumentText();
>
>
>
>               //*Obtem* *os* *termos* *marcados*
>
>               Matcher matcher = termPattern.matcher(docText);
>
>
>
>               //*Marca* *os* *termos* *encontrados* no *documento*
>
>               *while* (matcher.find()) {
>
>                      // found one - create annotation
>
>                      RoomNumber annotation = *new* RoomNumber(aJCas);
>
>                      annotation.setBegin(matcher.start());
>
>                      annotation.setEnd(matcher.end());
>
>                      annotation.setBuilding("Term");
>
>                      annotation.addToIndexes();
>
>               }
>
>
>
>         }
>
>
>
> analyseTermDescriptor.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>riso.annotator.TermAnnotator
> </annotatorImplementationName>
>
>    <analysisEngineMetaData>
>
>      <name>analyseTermDescriptor</name>
>
>      <description/>
>
>      <version>1.0</version>
>
>      <vendor>UFCG.RISO</vendor>
>
>      <configurationParameters/>
>
>      <configurationParameterSettings/>
>
>      <typeSystemDescription>
>
>        <imports>
>
>          <import location=
> "file:/C:/apache-uima/examples/descriptors/riso/typeTermDescriptor.xml"/>
>
>        </imports>
>
>      </typeSystemDescription>
>
>      <typePriorities/>
>
>      <fsIndexCollection/>
>
>      <capabilities>
>
>        <capability>
>
>          <inputs/>
>
>          <outputs>
>
>            <type>riso.annotator.Term</type>
>
>            <feature>riso.annotator.Term:value</feature>
>
>          </outputs>
>
>          <languagesSupported/>
>
>        </capability>
>
>      </capabilities>
>
>      <operationalProperties>
>
>        <modifiesCas>true</modifiesCas>
>
>        <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
>
>        <outputsNewCASes>false</outputsNewCASes>
>
>      </operationalProperties>
>
>    </analysisEngineMetaData>
>
>    <resourceManagerConfiguration/>
>
> </analysisEngineDescription>
>
>
>
> *typeTermDescriptor.xml*
>
> <?*xml* version="1.0" encoding="UTF-8"?>
>
> <typeSystemDescription *xmlns*="http://uima.apache.org/resourceSpecifier">
>
>    <name>typeTermDescriptor</name>
>
>    <description>*Tipo*</description>
>
>    <version>1.0</version>
>
>    <vendor>RISO</vendor>
>
>    <types>
>
>      <typeDescription>
>
>        <name>riso.annotator.Term</name>
>
>        <description>Term</description>
>
>        <supertypeName>uima.tcas.Annotation</supertypeName>
>
>        <features>
>
>          <featureDescription>
>
>            <name>value</name>
>
>            <description/>
>
>            <rangeTypeName>uima.cas.String</rangeTypeName>
>
>          </featureDescription>
>
>        </features>
>
>      </typeDescription>
>
>    </types>
>
> </typeSystemDescription>
>
>
>


Mime
View raw message