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 14:36:18 GMT
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