@Override public JFSIndexRepository getJFSIndexRepository() { testLiveness(); return delegate.getJFSIndexRepository(); }
public static TOP getFS(JCas jcas, int typeID) { Iterator<TOP> it = jcas.getJFSIndexRepository().getAllIndexedFS(typeID); TOP fs = null; if (it.hasNext()) { fs = it.next(); } return fs; }
/** * {@inheritDoc} */ @Override public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException { final JFSIndexRepository indexes = jcas.getJFSIndexRepository(); return indexes.getAnnotationIndex( Sentence.type ).iterator(); }
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(); }
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; }
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 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); } }
/** * @param jcas ye olde jay-cas * @return the Metadata for the given jcas or null if one is not found */ static private Metadata getMetadata( final JCas jcas ) { // TODO I really dislike this index-everything-to-java1 paradigm final FSIterator<TOP> itr = jcas.getJFSIndexRepository().getAllIndexedFS( Metadata.type ); if ( itr == null || !itr.hasNext() ) { return null; } return (Metadata)itr.next(); }
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(); } }
/** * @param aCas the <code>JCas</code> object * * @return return the pairID of the T-H pair */ private String getPairID(JCas aCas) { FSIterator<TOP> pairIter = aCas.getJFSIndexRepository().getAllIndexedFS(Pair.type); Pair p = (Pair) pairIter.next(); return p.getPairID(); }
/** * @param aCas * the <code>JCas</code> object * @return return the pairID of the T-H pair */ protected final String getPairID(JCas aCas) { FSIterator<TOP> pairIter = aCas.getJFSIndexRepository() .getAllIndexedFS(Pair.type); Pair p = (Pair) pairIter.next(); return p.getPairID(); }
@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"; }