/** * Get a list of annotations of the given annotation type constraint by a certain annotation. * Iterates over all annotations to find the covering annotations. * <p> * The method only returns properly covering annotations, that is annotations where the begin/end * offsets are equal to the begin/end of the given annotation or where given 'covered' annotation * is properly contained within the span of the 'covering' annotation. Partially overlapping * annotations are not returned. * * <p> * <b>Note:</b> this is <b>REALLY SLOW!</b> You don't want to use this. Instead, consider using * {@link #indexCovering(CAS, Type, Type)} or a {@link ContainmentIndex}. * * @param cas * a CAS. * @param type * a UIMA type. * @param coveredAnnotation * the covered annotation. * @return a return value. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static List<AnnotationFS> selectCovering(CAS cas, Type type, AnnotationFS coveredAnnotation) { return selectCovering(cas, type, coveredAnnotation.getBegin(), coveredAnnotation.getEnd()); }
/** * Get a list of annotations of the given annotation type constraint by a certain annotation. * Iterates over all annotations to find the covering annotations. * <p> * The method only returns properly covering annotations, that is annotations where the begin/end * offsets are equal to the begin/end of the given annotation or where given 'covered' annotation * is properly contained within the span of the 'covering' annotation. Partially overlapping * annotations are not returned. * * <p> * <b>Note:</b> this is <b>REALLY SLOW!</b> You don't want to use this. Instead, consider using * {@link #indexCovering(CAS, Type, Type)} or a {@link ContainmentIndex}. * @param type * a UIMA type. * @param coveredAnnotation * the covered annotation. * * @return a return value. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static List<AnnotationFS> selectCovering(Type type, AnnotationFS coveredAnnotation) { return selectCovering(coveredAnnotation.getView(), type, coveredAnnotation.getBegin(), coveredAnnotation.getEnd()); }
/** * Get a list of annotations of the given annotation type constraint by a certain annotation. * Iterates over all annotations to find the covering annotations. * <p> * The method only returns properly covering annotations, that is annotations where the begin/end * offsets are equal to the begin/end of the given annotation or where given 'covered' annotation * is properly contained within the span of the 'covering' annotation. Partially overlapping * annotations are not returned. * * <p> * <b>Note:</b> this is <b>REALLY SLOW!</b> You don't want to use this. Instead, consider using * {@link #indexCovering(JCas, Class, Class)} or a {@link ContainmentIndex}. * * @param <T> * the JCas type. * @param jCas * a CAS. * @param type * a UIMA type. * @param coveredAnnotation * the covered annotation. * @return a return value. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static <T extends Annotation> List<T> selectCovering(JCas jCas, Class<T> type, AnnotationFS coveredAnnotation) { return cast(CasUtil.selectCovering(jCas.getCas(), getType(jCas, type), coveredAnnotation)); }
/** * Get a list of annotations of the given annotation type constraint by a certain annotation. * Iterates over all annotations to find the covering annotations. * <p> * The method only returns properly covering annotations, that is annotations where the begin/end * offsets are equal to the begin/end of the given annotation or where given 'covered' annotation * is properly contained within the span of the 'covering' annotation. Partially overlapping * annotations are not returned. * * <p> * <b>Note:</b> this is <b>REALLY SLOW!</b> You don't want to use this. Instead, consider using * {@link #indexCovering(JCas, Class, Class)} or a {@link ContainmentIndex}. * * @param <T> * the JCas type. * @param type * a UIMA type. * @param coveredAnnotation * the covered annotation. * @return a return value. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static <T extends Annotation> List<T> selectCovering(Class<T> type, AnnotationFS coveredAnnotation) { return cast(CasUtil.selectCovering(CasUtil.getType(coveredAnnotation.getCAS(), type), coveredAnnotation)); }
/** * Get a list of annotations of the given annotation type constraint by a certain annotation. * Iterates over all annotations to find the covering annotations. * <p> * The method only returns properly covering annotations, that is annotations where the begin/end * offsets are equal to the given begin/end to or where given span is properly contained within * the span of the 'covering' annotation. Partially overlapping annotations are not returned. * * <p> * <b>Note:</b> this is <b>REALLY SLOW!</b> You don't want to use this. Instead, consider using * {@link #indexCovering(JCas, Class, Class)} or a {@link ContainmentIndex}. * * @param <T> * the JCas type. * @param jCas * a CAS. * @param type * a UIMA type. * @param begin * begin offset. * @param end * end offset. * @return a return value. * @see <a href="package-summary.html#SortOrder">Order of selected feature structures</a> */ public static <T extends Annotation> List<T> selectCovering(JCas jCas, Class<T> type, int begin, int end) { return cast(CasUtil.selectCovering(jCas.getCas(), getType(jCas, type), begin, end)); }