In looking at uimaFIT's select, and some of the discussion on the issue
tracking,  I'm wondering if it would better to have the things that support the
use cases:

for (Token t : select(jcas, Token.class) {

return an Iterable, instead of a Collection.

That would drop the methods in Collection except for iterator().  These methods,
for the most part, deal with things that CAS iterators don't have an easy
ability to deal with, or can't implement due to logical differences between the
CAS/Indexes/Iterators and Collections.  These methods are:
  - size (requires iterating and counting all the elements)
  - add, addAll (not supported, instead, add to the CAS, and choose to index or 
not)
  - remove, removeAll, clear (not supported, but remove-from-all-indexes is)
  - contains, containsAll, retainAll (not supported because depends on a
particular index's definition of equal)

The only method of Collection that seems like it could be useful (besides, of
course, iterator) for UIMA iterators is toArray, and the general object methods
toString, equals, and hashCode.
 
-Marshall


On 8/8/2013 10:38 AM, Richard Eckart de Castilho wrote:
> How about setting up versions for UIMA 2.5.0 and 3.0.0 and start collecting 
> some
> stuff for these releases?
>
> The methods are not without questions that imho should be discussed before
> merging into core. E.g.
>
> https://issues.apache.org/jira/browse/UIMA-2830
> https://code.google.com/p/uimafit/issues/detail?id=61
> https://code.google.com/p/uimafit/issues/detail?id=65
> https://code.google.com/p/uimafit/issues/detail?id=113
>
> Cheers,
>
> -- Richard
>
> Am 08.08.2013 um 16:31 schrieb Marshall Schor <[email protected]>:
>
>> On 8/8/2013 9:57 AM, Richard Eckart de Castilho wrote:
>>> uimaFIT provides these in the CASUtil and JCasUtil classes:
>>>
>>> select(…)
>>> selectCovered(…)
>>> selectCovering(…)
>>>
>>> E.g.
>>>
>>> for (Token t : select(jcas, Token.class) {
>>> …
>>> }
>> Nice! (Thinking now about "pulling" these and maybe some other things into 
>> main
>> UIMA ...)
>>
>> -M
>>
>>
>>> Cheers,
>>>
>>> -- Richard
>>>
>>> Am 08.08.2013 um 15:52 schrieb Marshall Schor <[email protected]>:
>>>
>>>> UIMA implements a bunch of CAS iterators of various types, that extend the
>>>> normal Java Iterator class.  Are there corresponding iterables that allow 
>>>> their
>>>> use in things like for (Token token : xxxxx) { } kinds of statements?  
>>>> (where
>>>> Token is the JCas cover class for UIMA Type "Token").
>>>>
>>>> If not, is there a reason for this, or just a bit of missing convenience?  
>>>> Does
>>>> UIMAFit supply these?
>>>>
>>>> -Marshall
>

Reply via email to