uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Fox <David....@humedica.com>
Subject Re: newbie questions about UIMA Types
Date Thu, 01 Dec 2016 15:33:28 GMT
Thanks for the detailed reply and examples.

I¹ve got some tangentially related questions about types in UIMA C++,
which I hope that either you or someone else can answer:

If you need to use a custom Type in an annotator written with the UIMA C++

1) do you need to define a corresponding custom C++ class (analogous to
the one generated by JCasGen)?
2) if so, is there a comparable CppCasGen, or do you need to write it

Thanks in advance,

On 11/30/16, 8:23 PM, "Richard Eckart de Castilho" <rec@apache.org> wrote:

>It is possible to customize the generated JCas classes, yes. You can e.g.
>add own methods or even own fields. However, own fields would not be
>saved/loaded when you persist a CAS e.g. to XMI.
>As a case for a custom method, consider e.g. the DKPro Core Token
>"setText(string)" method [1].
>If the "string" passed to the method differs from the covered text of the
>Token, then a new
>"Form" annotation with the value "string" is created, linked to the Token.
>Another case would be the "links()" method on the DKPro Core CorefChain
>type. It returns all
>elements in the respective coreference chain as a List thus saving the
>user to manually iterate
>over the whole chain to reach all elements.
>FSList and friends are built-in types of UIMA Core - you can't modify
>these. But uimaFIT provides
>several methods to make working with these things much more convenient.
>- org.apache.uima.fit.util.FSCollectionFactory and its methods to create
>FSList etc from Java collections
>- org.apache.uima.fit.util.JCasUtil has select methods to retrieve
>elements from FSList etc
>- org.apache.uima.fit.util.FSUtil has methods to conveniently get/set
>feature values including multi-valued features.
>-- Richard
>> On 30.11.2016, at 20:25, David Fox <David.Fox@humedica.com> wrote:
>> Does the UIMA Java framework support modifying or extend the java class
>>generated by JCasGen corresponding to a custom Type?   If so, are there
>>any common circumstances where this is necessary?
>> I didn¹t see anything in the examples or documentation about modifying
>>the generated classes, but I also didn¹t see anything saying you
>>couldn¹t.  I suspect that this is not supported (and that otherwise you
>>wouldn¹t be able to pass a CAS between distributed UIMA AS components,
>>or between a Java annotator and a C++ one).  But it would be nice to
>>know for certain.
>> The reason I ask is that the set of data structures supported by UIMA
>>types (individual FS references,  FSList linked lists, and FSArray
>>arrays) is fairly limited compared to modern programming languages,
>>which often directly support associative arrays, trees, and graphs.  I¹m
>>trying to understand whether this is a restriction on the implementation
>>of custom types (which it would be if modifying/extending the generated
>>class was not supported), or just on the public interface accessible via
>>the UIMA API.
>> David

View raw message