You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Marshall Schor <ms...@schor.com> on 2010/09/09 21:01:19 UTC

getting output from ex3/TutorialDateTime.xml (was Re: Questions about CPM)

 I don't see enough information to narrow down the cause.  But here's one guess.

The ex3/TutorialDateTime annotator has this bit of code in its process() method,
that gets run for every CAS:

    // Create Annotations
    ResultSpecification resultSpec = getResultSpecification();
    boolean timeWanted =
resultSpec.containsType("org.apache.uima.tutorial.TimeAnnot",
aJCas.getDocumentLanguage());
    boolean dateWanted =
resultSpec.containsType("org.apache.uima.tutorial.DateAnnot",
aJCas.getDocumentLanguage());

    if (timeWanted)
      makeAnnotations(timeAnnotationMaker, hoursMinutesPattern, dfTimeShort);
   
    if (dateWanted) {
      ... similar

So, one can see by reading this that if the Result Specification doesn't specify
the type for the particular language in the CAS, then no output will be created.

The language in the CAS has to be "en" or a subtype of it, because the XML
descriptor for ex3.TutorialDateTime specifies that it only outputs things for
that language.

Does the collection reader you're using set the document language to "en"?

-Marshall

On 9/9/2010 5:14 AM, William Song wrote:
> Hi,
>
> I'm new to UIMA and I encountered some difficulty when trying to implement
> my application.
>
> So I'm trying to build a CPE that takes descriptors as its arguments to
> analyze a set of documents and eventually print out the result. Based on the
> SimpleCPM class provided in the sample code, I'm able to get most of things
> working. However, it won't be able to properly handle a analysis engine that
> has multiple types in there. For instance, if I put in the descriptor
> ex3/TutorialDateTime.xml, nothing will be printed by the AnnotationPrinter.
> Could someone please explain why this won't work and how this can be fixed?
>
> Best Regards,
>
> William
>