sudeep87 / uimafit

Automatically exported from code.google.com/p/uimafit
0 stars 0 forks source link

Ability to specify container in terms of begin and end offset #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Moved here from multi-issue 58 - Reported by project member steven.bethard:

I also keep wanting variants of the methods that take a begin index and an end 
index instead of an Annotation (particularly useful when reading standoff 
annotations in some non-UIMA format), e.g.:

    iterate(JCas, Class<T>, int, int)
    selectCovered(JCas, Class<T>, int, int)
    selectCovering(JCas, Class<T>, int, int)

Original issue reported on code.google.com by richard.eckart on 16 Mar 2011 at 8:22

GoogleCodeExporter commented 8 years ago
selectCovered(JCas, Class<T>, int, int) is just the same as iterate(JCas, 
Class<T>, int, int), will only implement select.

 selectCovering(JCas, Class<T>, int, int) this is tricky. The ContainmentIndex approach won't work here.

Original comment by richard.eckart on 16 Mar 2011 at 10:23

GoogleCodeExporter commented 8 years ago
I think selectCovered(JCas, Class<T>, int, int) is all I really need most of 
the time, so if selectCovering is tricky, skip that one and we can open another 
issue if we ever really need it again.

Original comment by steven.b...@gmail.com on 16 Mar 2011 at 10:53

GoogleCodeExporter commented 8 years ago
I have implemented selectCovered(JCas, Class<T>, int, int) - this is slower 
than when searching within an actual annotation instance - I do not recommend 
using it. There is a warning in the JavaDoc.

I have also implemented selectCovering(JCas, Class<T>, int, int). This is 
really slow, because it requires a full CAS scan. It's there because you 
requested it, but I cannot recommend anybody to use that. I can't imagine how 
to implement this with a better performance. I strongly recommend to use the 
ContainmentIndex or its successor once that is implemented.

Original comment by richard.eckart on 16 Mar 2011 at 10:55

GoogleCodeExporter commented 8 years ago

Original comment by richard.eckart on 16 Mar 2011 at 10:55

GoogleCodeExporter commented 8 years ago
For selectCovered(JCas, Class<T>, int, int), if it's currently slower than 
searching with an actual annotation instance, wouldn't it just be better to 
have it call:

    selectCovered(jCas, cls, new Annotation(jCas, int, int))

?

Original comment by steven.b...@gmail.com on 17 Mar 2011 at 6:54

GoogleCodeExporter commented 8 years ago
I am not sure calling new Annotation(jcas) already takes up memory in the CAS, 
that is why I didn't implement it like that. I am also not sure if the 
Annotation would need to be added to the indexes for that to work. 

Original comment by richard.eckart on 17 Mar 2011 at 1:26

GoogleCodeExporter commented 8 years ago
I don't know about the memory, but you don't need to add it to the indexes - it 
works fine without it in our AnnotationRetrieval code.

Original comment by steven.b...@gmail.com on 18 Mar 2011 at 9:16

GoogleCodeExporter commented 8 years ago

Original comment by richard.eckart on 7 Apr 2011 at 12:12