uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Santucci <dav.santu...@gmail.com>
Subject Re: Adding features on a Concept Mapper dictionary
Date Tue, 21 Dec 2010 16:06:13 GMT
The mistake I've done is to set in a wrong way the configuration parameters.
There are three required step (go to "Parameter Settings" in our analysis
engine xml):
1) set ResultingAnnotationName with your annotation type (in my cas
"myUima.MyDictTerm")
2) set AttributeList with the list of attributes (canonical, text,
attribute1, attribute2)
    NB: attribute1 and attribute2 are the feature defined in the
dictionary!
3) set FeatureList with the list of corresponding features (DictCanon,
matchedText, attribute1Feature, attribute2Feature)
    NB: attribute1Feature and attribute2Feature are the feature defined in
MyDictTerm!

All elements in AttributeList must correspond to parallel element specified
in FeatureList.


David


2010/12/21 David Santucci <dav.santucci@gmail.com>

> I've done it, but it is the same: the example runs but it doesn't match
> anything ...
> I'm searching for the correct way to extract features from a dictionaries.
> I need to know the feature value of a matched token.
>
>
> 2010/12/21 Michael Tanenblatt <slothrop@park-slope.net>
>
> First question: why do you declare 'dict' as a DictTerm instead of a
>> 'MyDictTerm', e.g.:
>>
>> MyDictTerm dict = new MyDictTerm(jcas);
>>
>>
>> On Dec 21, 2010, at 7:13 AM, David Santucci wrote:
>>
>> > Hi,
>> >
>> > I hope you can help me with a problem with Concept Mapper.
>> > I defined a dictionary with more features:
>> >
>> > <synonim>
>> > <token canonical="aaa" text="bbb" feature1="ccc" feature2="ddd" >
>> > <variant base="aaa" />
>> > .....
>> > How can I access the value of these features?
>> >
>> > I tried defining a new "MyDictTerm.xml", which defines a type extend the
>> > type "MyDictTerm" that extends the standard  "DictTerm".
>> > "MyDictTerm" contains new features (feature1 and feature2), added in the
>> > "Type System Definition" of "MyDictTerm.xml" Component Descriptor
>> Editor.
>> > After creating the java classes with "JCasGen" the following code
>> doesn't
>> > work:
>> >
>> > FSIndex index = jcas.getAnnotationIndex(MyDictTerm.type);
>> > Iterator it = index.iterator();
>> > DictTerm dict = new MyDictTerm(jcas);
>> >
>> > while (it.hasNext()) {
>> > dict = (MyDictTerm) it.next();
>> > System.out.print("feature1" + dict.getFeature1());
>> > }
>> >
>> > The system says it needs a cast ((MyDictTerm) dict).getFeature1() , but
>> the
>> > system doesn't find any annotation.
>> > What's the right way to retrieve features on a dictionary?
>> >
>> >
>> > Best regards,
>> >
>> > David
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message