public Iterator getAnnotationIterator(JCas jcas) throws AnnotatorProcessException { // TODO Auto-generated method stub JFSIndexRepository indexes = jcas.getJFSIndexRepository(); return indexes.getAnnotationIndex(iAnnotationType).iterator(); }
/** * {@inheritDoc} */ @Override public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException { final JFSIndexRepository indexes = jcas.getJFSIndexRepository(); return indexes.getAnnotationIndex( Sentence.type ).iterator(); }
/** * {@inheritDoc} */ @Override public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException { final JFSIndexRepository indexes = jcas.getJFSIndexRepository(); return indexes.getAnnotationIndex( Sentence.type ).iterator(); }
private FSIterator<Annotation> getAllAnnotations(JCas jcas, int type) { JFSIndexRepository indexes = jcas.getJFSIndexRepository(); FSIterator<Annotation> annotationsIter = indexes.getAnnotationIndex(type).iterator(); // while (segmentItr.hasNext()) { // } return annotationsIter; }
public Iterator getAnnotationIterator(JCas jcas) throws AnnotatorProcessException { // TODO Auto-generated method stub JFSIndexRepository indexes = jcas.getJFSIndexRepository(); return indexes.getAnnotationIndex(iAnnotationType).iterator(); }
public static ArrayList<Sentence> selectSentence (JCas jcas) { ArrayList<Sentence> ret = new ArrayList<Sentence>(); FSIterator<Annotation> iter = jcas.getJFSIndexRepository().getAnnotationIndex(Sentence.type).iterator(); while (iter.hasNext()) ret.add((Sentence)iter.next()); java.util.Collections.sort(ret, new AnnotOffsetComparator()); return ret; }
public static ArrayList<BaseToken> selectBaseToken (JCas jcas) { ArrayList<BaseToken> ret = new ArrayList<BaseToken>(); FSIterator<?> iter = jcas.getJFSIndexRepository().getAnnotationIndex(BaseToken.type).iterator(); while (iter.hasNext()) ret.add((BaseToken)iter.next()); java.util.Collections.sort(ret, new AnnotOffsetComparator()); return ret; }
private Segment getSegmentContainingOffsets(JCas jcas, int start, int end) { JFSIndexRepository indexes = jcas.getJFSIndexRepository(); Iterator segmentItr = indexes.getAnnotationIndex(Segment.type).iterator(); while (segmentItr.hasNext()) { Segment seg = (Segment) segmentItr.next(); if (seg.getBegin() <= start && seg.getEnd() >= end) return seg; } return null; // did not find a segment - cannot happen - we always have // segments }
public static ArrayList<BaseToken> selectBaseToken (JCas jcas) { ArrayList<BaseToken> ret = new ArrayList<BaseToken>(); FSIterator<?> iter = jcas.getJFSIndexRepository().getAnnotationIndex(BaseToken.type).iterator(); while (iter.hasNext()) ret.add((BaseToken)iter.next()); java.util.Collections.sort(ret, new AnnotOffsetComparator()); return ret; }
public AttributeCalculator (JCas jcas) { this.jcas = jcas; // index the base tokens and NEs by their offsets hbs = new Hashtable<Integer, BaseToken>(); hbe = new Hashtable<Integer, BaseToken>(); FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(BaseToken.type).iterator(); while (iter.hasNext()) { BaseToken t = (BaseToken) iter.next(); hbs.put(t.getBegin(), t); hbe.put(t.getEnd(), t); } }
public static ArrayList<Sentence> selectSentence (JCas jcas) { ArrayList<Sentence> ret = new ArrayList<Sentence>(); FSIterator<Annotation> iter = jcas.getJFSIndexRepository().getAnnotationIndex(Sentence.type).iterator(); while (iter.hasNext()) ret.add((Sentence)iter.next()); java.util.Collections.sort(ret, new AnnotOffsetComparator()); return ret; }
public AttributeCalculator (JCas jcas) { this.jcas = jcas; // index the base tokens and NEs by their offsets hbs = new Hashtable<Integer, BaseToken>(); hbe = new Hashtable<Integer, BaseToken>(); FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(BaseToken.type).iterator(); while (iter.hasNext()) { BaseToken t = (BaseToken) iter.next(); hbs.put(t.getBegin(), t); hbe.put(t.getEnd(), t); } }
private void removeAnnotations(JCas jcas, int type) { FSIterator<Annotation> itr = jcas.getJFSIndexRepository().getAnnotationIndex(type).iterator(); List<Annotation> toRemove = new ArrayList<Annotation>(); while (itr.hasNext()) { Annotation annotation = itr.next(); toRemove.add(annotation); } for (Annotation anno : toRemove) { anno.removeFromIndexes(); } }
private void removeAnnotations(JCas jcas, int type) { FSIterator<Annotation> itr = jcas.getJFSIndexRepository().getAnnotationIndex(type).iterator(); List<Annotation> toRemove = new ArrayList<Annotation>(); while (itr.hasNext()) { Annotation annotation = itr.next(); toRemove.add(annotation); } for (Annotation anno : toRemove) { anno.removeFromIndexes(); } }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { // removeDoctors(aJCas); removeHistoryOf(aJCas); FSIterator<Annotation> iter = aJCas.getJFSIndexRepository().getAnnotationIndex(Markable.type).iterator(); expandToNP(aJCas, FSIteratorToList.convert(iter)); mergeNP(aJCas); elevateAdjectives(aJCas); iter = aJCas.getJFSIndexRepository().getAnnotationIndex(Markable.type).iterator(); rmDup(FSIteratorToList.convert(iter)); }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { // removeDoctors(aJCas); removeHistoryOf(aJCas); FSIterator<Annotation> iter = aJCas.getJFSIndexRepository().getAnnotationIndex(Markable.type).iterator(); expandToNP(aJCas, FSIteratorToList.convert(iter)); mergeNP(aJCas); elevateAdjectives(aJCas); iter = aJCas.getJFSIndexRepository().getAnnotationIndex(Markable.type).iterator(); rmDup(FSIteratorToList.convert(iter)); }
public String calcmNPHead () { Annotation a = m.getContent(); FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(LookupWindowAnnotation.type).iterator(); while (iter.hasNext()) { LookupWindowAnnotation lwa = (LookupWindowAnnotation) iter.next(); if (lwa.getBegin()<=a.getBegin() && lwa.getEnd()==a.getEnd()) return "yes"; } return "no"; }
public boolean calcNPHead () { Annotation a = m1.getContent(); // return (a.getEnd()==m1.getEnd() && a.getBegin()>m1.getBegin()) ? "yes" : "no"; FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(LookupWindowAnnotation.type).iterator(); while (iter.hasNext()) { LookupWindowAnnotation lwa = (LookupWindowAnnotation) iter.next(); if (lwa.getBegin()<=a.getBegin() && lwa.getEnd()==a.getEnd()) return true; } return false; }
public String calcmNPHead () { Annotation a = m.getContent(); FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(LookupWindowAnnotation.type).iterator(); while (iter.hasNext()) { LookupWindowAnnotation lwa = (LookupWindowAnnotation) iter.next(); if (lwa.getBegin()<=a.getBegin() && lwa.getEnd()==a.getEnd()) return "yes"; } return "no"; }
public boolean calcNPHead () { Annotation a = m1.getContent(); // return (a.getEnd()==m1.getEnd() && a.getBegin()>m1.getBegin()) ? "yes" : "no"; FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(LookupWindowAnnotation.type).iterator(); while (iter.hasNext()) { LookupWindowAnnotation lwa = (LookupWindowAnnotation) iter.next(); if (lwa.getBegin()<=a.getBegin() && lwa.getEnd()==a.getEnd()) return true; } return false; }