Re: HashMap as type feature

2013-10-22 Thread Dr. Armin Wegner
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

Re: HashMap as type feature

2013-10-21 Thread Marshall Schor
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

AW: HashMap as type feature

2013-10-17 Thread Armin.Wegner
An: user@uima.apache.org Betreff: Re: HashMap as type feature Hi, you could define a feature structure e.g. StringStringMapEntry { String key String value } and store these in an FSList. Then, write additional convenience code around that which transforms this to/from a MapString, String

Re: HashMap as type feature

2013-10-17 Thread Richard Eckart de Castilho
TOP or FeatureStructure? Is it possible to store an arbitray object into a CAS? Cheers, Armin -Ursprüngliche Nachricht- Von: Richard Eckart de Castilho [mailto:r...@apache.org] Gesendet: Mittwoch, 16. Oktober 2013 18:02 An: user@uima.apache.org Betreff: Re: HashMap as type

AW: HashMap as type feature

2013-10-17 Thread Armin.Wegner
. Oktober 2013 18:53 An: user@uima.apache.org Betreff: Re: HashMap as type feature Armin, Our team does this with an annotation type designed to store feature vectors for Machine Learning applications. In this case we use a StringArray feature for the keys and a StringArray feature

Re: HashMap as type feature

2013-10-17 Thread Thomas Ginter
[mailto:thomas.gin...@utah.edu] Gesendet: Mittwoch, 16. Oktober 2013 18:53 An: user@uima.apache.org Betreff: Re: HashMap as type feature Armin, Our team does this with an annotation type designed to store feature vectors for Machine Learning applications. In this case we use a StringArray feature

Re: HashMap as type feature

2013-10-17 Thread Richard Eckart de Castilho
You could also use the entrySet which gives you all the key/value pairs. -- Richard On 17.10.2013, at 16:43, armin.weg...@bka.bund.de wrote: Hi Thomas, thanks for your answer. Using HashMap, does the n-th element of keySet() always corresponds to the n-th element of values()? Is this a

Re: HashMap as type feature

2013-10-17 Thread Dr. Armin Wegner
Looks good, I will try it. Thank you, Armin On 10/17/13, Richard Eckart de Castilho r...@apache.org wrote: You could also use the entrySet which gives you all the key/value pairs. -- Richard On 17.10.2013, at 16:43, armin.weg...@bka.bund.de wrote: Hi Thomas, thanks for your answer.

HashMap as type feature

2013-10-16 Thread Dr. Armin Wegner
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

Re: HashMap as type feature

2013-10-16 Thread Richard Eckart de Castilho
Hi, you could define a feature structure e.g. StringStringMapEntry { String key String value } and store these in an FSList. Then, write additional convenience code around that which transforms this to/from a MapString, String. -- Richard On 16.10.2013, at 17:55, Dr. Armin Wegner

Re: HashMap as type feature

2013-10-16 Thread Dr. Armin Wegner
Hi Richard, thanks for the quick reply. But the answer is a little too short for me. Can you point me to an example or a documentation, please? I couldn't find it in the UIMA Tutorial and Developers' Guides. Did I miss it? Best, Armin On 10/16/13, Richard Eckart de Castilho r...@apache.org

Re: HashMap as type feature

2013-10-16 Thread Thomas Ginter
Armin, Our team does this with an annotation type designed to store feature vectors for Machine Learning applications. In this case we use a StringArray feature for the keys and a StringArray feature for the values. The StringArrays are pulled from a HashMapString, String vector variable and