/** * Convenience method to iterator over all features structures. * * @param aCas * the CAS hosting the type system. * @return A collection of the selected type. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static Collection<FeatureStructure> selectAllFS(final CAS aCas) { return selectFS(aCas, getType(aCas, CAS.TYPE_NAME_TOP)); }
/** * Convenience method to iterator over all features structures. * * @param jCas * the JCas containing the type system. the type. * @return A collection of the selected type. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static Collection<TOP> selectAll(final JCas jCas) { return select(jCas, TOP.class); }
/** * Convenience method to iterator over all annotations. * * @param aCas * the CAS hosting the type system. * @return A collection of the selected type. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static Collection<AnnotationFS> selectAll(final CAS aCas) { return select(aCas, getType(aCas, CAS.TYPE_NAME_ANNOTATION)); }
public static Collection<Speaker> getSpeakers(Utterance utterance) { try { return JCasUtil.selectCovered(Speaker.class, utterance); } catch (Exception e) { return null; } }
@Override public Type getAnnotationType(CAS cas) { return CasUtil.getType(cas, annotationTypeName); }
private void initializeTypes(JCas jCas) { if (windowClass != null) { windowType = JCasUtil.getType(jCas, windowClass); } typesInitialized = true; }
@Override protected <T extends Annotation> List<T> select( JCas jCas, Annotation focusAnnotation, Class<T> annotationClass, int count) { return JCasUtil.selectFollowing(jCas, annotationClass, focusAnnotation, count); } }
@Override protected <T extends Annotation> List<T> select( JCas jCas, Annotation focusAnnotation, Class<T> annotationClass, int count) { return JCasUtil.selectPreceding(jCas, annotationClass, focusAnnotation, count); } }
public static <T> T getFeature(FeatureStructure aFS, String aFeature, Class<T> aClazz) { Feature feat = getMandatoryFeature(aFS, aFeature); return getFeature(aFS, feat, aClazz); }
/** * Convert an {@link ArrayFS} to a {@link Collection}. * * @param aArray * the array to convert. * @return a new collection containing the same feature structures as the provided array. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static Collection<FeatureStructure> create(ArrayFS aArray) { return create(aArray, (Type) null); }
@Override public Iterator<T> iterator() { return JCasUtil.iterator(container, type, ambiguous, strict); } };
/** * Fetch the text covered by the specified annotations and return it as a list of strings. * * @param <T> * UIMA JCas type. * @param iterable * annotation container. * @return list of covered strings. */ public static <T extends AnnotationFS> List<String> toText(Iterable<T> iterable) { return CasUtil.toText(iterable); }
/** * Notify analysis engines that the collection process is complete. * * @throws AnalysisEngineProcessException * if there was a problem completing the process */ public void collectionProcessComplete() throws AnalysisEngineProcessException { LifeCycleUtil.collectionProcessComplete(analysisEngines); }
/** * Convert an {@link AnnotationIndex} to a {@link Collection}. * * @param <T> * the feature structure type * @param aIndex * the index to convert. * @return the wrapped index. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static <T extends AnnotationFS> Collection<T> create(AnnotationIndex<T> aIndex) { return new AnnotationIndexAdapter<T>(aIndex); }
@Override protected Iterable<BaleenAnnotation> selectAnnotations(JCas jCas) { return JCasUtil.select(jCas, BaleenAnnotation.class); } }
@Override public Type getAnnotationType(CAS cas) { return CasUtil.getType(cas, annotationTypeName); }
private void initializeTypes(JCas jCas) { if (tokenClass != null) { tokenType = JCasUtil.getType(jCas, tokenClass); } typesInitialized = true; }
@Override protected Iterable<TemplateField> selectAnnotations(JCas jCas) { return JCasUtil.select(jCas, TemplateField.class); } }
Collection<IdentifiedAnnotation> collection = JCasUtil.select(jcas, IdentifiedAnnotation.class); Iterator<IdentifiedAnnotation> iterator = collection.iterator(); while (iterator.hasNext()) {