ctakes-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Kincaid <kincaid.d...@gmail.com>
Subject Feature not defined for type exception - need some help
Date Fri, 19 Apr 2013 14:56:54 GMT
I'm new to both cTakes and UIMA, so please excuse if this is a simple
question. Can someone help me understand why the following code produces
the listed exception? The bolded line seems to hold the key, but I don't
understand what it's telling me.

public class MedicalNoteProcessor {

    private static final String AE_DESCRIPTOR =
"/home/davek/src/medical-notes/AE/SimpleSegmentAnnotator.xml";

    private static final String TEST_TEXT = "Abnormal Remarks: rostral-most
right nasal fold and adjacent skin are swollen to about 1.5cm in width,
spherical, with ulcerated surface near nostril opening. No draining or
appreciable pain associated. Mild mucoid to purulent discharge in the
nostril. Left side normalMouth/Teeth/Gum";

    public static void main(String[] args) throws IOException,
InvalidXMLException, ResourceInitializationException,
AnalysisEngineProcessException {
        XMLInputSource xmlInputSource = new XMLInputSource(AE_DESCRIPTOR);

        ResourceSpecifier specifier =
UIMAFramework.getXMLParser().parseResourceSpecifier(xmlInputSource);
        AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);

        JCas jcas = ae.newJCas();

        //analyze a document
        jcas.setDocumentText(TEST_TEXT);
        ae.process(jcas);
        UIMAFramework.getLogger().log(Level.INFO, jcas.toString());

        jcas.reset();

        //done
        ae.destroy();
    }
}

Exception in thread "main"
org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator
processing failed.
 at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:391)
 at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:296)
 at
org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
at
org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:280)
 at
medical_notes.nlp.MedicalNoteProcessor.main(MedicalNoteProcessor.java:42)
*Caused by: org.apache.uima.cas.CASRuntimeException: Feature "id" is not
defined for type "org.apache.ctakes.typesystem.type.textspan.Segment".*
 at org.apache.uima.jcas.impl.JCasImpl.throwFeatMissing(JCasImpl.java:1018)
at org.apache.ctakes.typesystem.type.textspan.Segment.setId(Segment.java:80)
 at
org.apache.ctakes.core.ae.SimpleSegmentAnnotator.process(SimpleSegmentAnnotator.java:63)
at
org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
 at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:375)

Mime
View raw message