Frédéric Meunier wrote:
I’m using uimaj-2.2.1-incubating and sandbox-2.2.2-10.
Don't know what you're using from the sandbox, but it
may need UIMA 2.2.2.
Let’s have a look to the following code extract from an annotator’s process
method:
AnnotationIndex entryIndex =
cas.getAnnotationIndex(DictionaryEntry.type);
CountryEntry entry = new CountryEntry(cas);
entry.setBegin(token.getBegin());
entry.setEnd(token.getEnd());
for (FSIterator it2 = entryIndex.iterator(); it2.isValid();) {
int result = entryIndex.compare(it2.get(), entry);
result = entryIndex.compare(entry, it2.get());
it2.moveToNext();
}
FeatureStructure foo =entryIndex.find(entry);
boolean found = entryIndex.contains(entry) ;
token is a TokenAnnotation object (cf. Sandbox WhitespaceTokenizer).
CountryEntry extends DictionaryEntry (cf.Sandbox DictionaryAnnotator).
It happens for a value of it2 that result is equals to 0, i.e. my entry
object is in the index.
But foo is always null and found always false.
That should not be, if I understand your sample correctly.
Please open a Jira issue and provide a working test case.
Thanks,
Thilo