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

Reply via email to