uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dr. Armin Wegner" <arminweg...@googlemail.com>
Subject Re: HashMap as type feature
Date Tue, 22 Oct 2013 15:49:16 GMT
I've done it this way. First, I defined a new type KeyValuePair of
type uima.cas.TOP. It has a feature named key of type uima.cas.String
and a second feature named value of type uima.cas.Integer. Second, I
added a uima.cas.FSArray of KeyValuePair to the annotation type. It
used the Component Description Editor for doing so which was quit
easy. FSArray is better to read in CAS Editor than FSList.

Cheers,
Armin

On 10/21/13, Marshall Schor <msa@schor.com> wrote:
> The CAS doesn't natively support hash maps.  One possible motivation is that
> the
> design was aimed at allowing multiple independent systems to process the
> CAS
> data, including Annotators written in C++.  To support this, it would be
> necessary to implement a common hash map in multiple languages (Java, C++,
> Python, Perl, etc.),  which wasn't done.
>
> Richard's suggestion is a possibility, though.  The other thing that people
> sometimes do is to store map data in external resources, which can be
> shared
> among co-located Annotators (running in the same JVM).
>
> -Marshall
> On 10/16/2013 11:55 AM, Dr. Armin Wegner wrote:
>> Hi,
>>
>> I'd like to have a type feature that is a list of key-value pairs. The
>> number of pairs is unknown. What's best for this? Is it even possible?
>>
>> Thanks,
>> Armin
>>
>
>

Mime
View raw message