uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomas By" <...@cmu.edu>
Subject Annotation/Feature creation, changing types
Date Tue, 06 Dec 2011 19:47:47 GMT
Hi all,

I am wondering if it is possible to (for example) first create an annotation
or a feature that has no type, and then set the type in a second step.

>From looking at the docs, it seems there is no obvious way to do this.

I want this for two reasons: (1) I have a lexicon lookup module that reads
annotation and attribute (ie feature) types as part of the data, and (2)
I want to not have to recompile this module every time the UIMA type system
changes. Put another way, I want the lexicon lookup module to be totally
independent of the type system. If the user provides lexicon data that is
not compatible with the type system, then that should (I suppose) trigger
an error at module initialization.

So suppose my data looks like this:


Then for every occurrence of "word" in the text, the module adds an
annotation of the type ANNOTATIONTYPE with the given attributes.

At the moment, I have a long conditional that looks like this:

| if (atp.equals(\"MYTYPE\")) {
|   a.setMytype(value);
| }

That is, I have a hard-coded, type-system-specific mapping from strings
that are names of types, to the UIMA Java objects of the same name.

Is there any way to do this in a more general way so that it is independent
of the type system?


View raw message