On Thu, Jun 22, 2017 at 9:04 AM Finan, Sean <
[email protected]> wrote:
> There is some suboptimal looping in AssertioncCleartkAnalysisEngine. For
> instance:
> Collection<IdentifiedAnnotation> entities =
> JCasUtil.select(identifiedAnnotationView, IdentifiedAnnotation.class);
> for (IdentifiedAnnotation identifiedAnnotation : entities) {
> ...
> List<Sentence> sents = new
> ArrayList<>(JCasUtil.selectCovering(jCas, Sentence.class,
> entityOrEventMention.getBegin(), entityOrEventMention.getEnd()));
This should definitely never be done. According to the UimaFIT
documentation for selectCovering:
Note: this is REALLY SLOW! You don't want to use this. Instead, consider
using indexCovering(JCas, Class, Class) or a ContainmentIndex.
https://uima.apache.org/d/uimafit-current/api/org/apache/uima/fit/util/JCasUtil.html#selectCovering-java.lang.Class-org.apache.uima.cas.text.AnnotationFS-
Steve