uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thilo Goetz <twgo...@gmx.de>
Subject Re: [jira] Closed: (UIMA-1352) java.lang.ClassCastException using find() with a SET index
Date Mon, 27 Jul 2009 06:17:09 GMT
See the Jira issue for the cause of the problem.  More
comments below.

Marshall Schor wrote:
> So, there may be 2 things to look at here - the actual error, described
> above, and the more philosophical question on the behavior of moveTo -
> this seems to require a sorting order if the item "moved to" is not
> present in the index.  Perhaps this needs to be documented better.  And

I'm not sure I understand your point about moveTo().  It requires the
index to be sorted to make any sense (and the BagIndex moveTo() is broken,
but that's a different issue).  moveTo(fs) will position the iterator such
that any element "to the left" is smaller than fs, and all elements at the
moved-to position and "to the right" of it are greater than or equal to
fs.  It doesn't matter if the item "moved to" is in the index or not.
Remember that equality here is defined with respect to the sort order of
the index, it is not feature structure identity.  All this is documented,
but maybe not as clearly as it could be.

> what if no sorting order was defined for the set index?

Every set index has a sort order.  If that sort order is empty, it means
that all FSs are equal for that index.  That in turn means that this
index will contain at most 1 FS at any time.  It also means that moveTo()
will always position the iterator at that one element, if it exists.

Did that help at all?


View raw message