public class AnnotationUtil extends Object
| Constructor and Description |
|---|
AnnotationUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends org.apache.uima.jcas.tcas.Annotation> |
trim(Collection<T> annotations)
trims an entire collection of annotations.
|
static <T extends org.apache.uima.jcas.tcas.Annotation> |
trim(T annotation)
This method first checks whether the string contains whitespace at all.
|
static <T extends org.apache.uima.jcas.tcas.Annotation> |
trim(T annotation,
char... ws)
trims the annotated text.
|
static <T extends org.apache.uima.jcas.tcas.Annotation> |
trimBegin(T annotation,
char... ws)
Moves the begin-index as long as a character contain in the array is at
the beginning.
|
static <T extends org.apache.uima.jcas.tcas.Annotation> |
trimEnd(T annotation,
char... ws)
Moves the end-index as long a character that is contained in the array is
at the end.
|
static <T extends org.apache.uima.jcas.tcas.Annotation> |
trimFront(T annotation,
char... ws)
Deprecated.
|
public static <T extends org.apache.uima.jcas.tcas.Annotation> T trim(T annotation,
char... ws)
String.trim(), this method
moves the begin and end indexes towards the middle as long as there is
whitespace.
The method throws a ArrayIndexOutOfBoundsException if the entire
annotation consists of whitespace.T - The annotation typeannotation - The annotation to trimws - An array of chars that are to be considered whitespacepublic static <T extends org.apache.uima.jcas.tcas.Annotation> T trim(T annotation)
trim(Annotation, char...)T - the annotation typeannotation - The annotation to trimpublic static <T extends org.apache.uima.jcas.tcas.Annotation> void trim(Collection<T> annotations)
JCasUtil.select(org.apache.uima.jcas.JCas, Class)
throws a ConcurrentModificationException.T - the annotation typeannotations - The annotations you want to trim@Deprecated public static <T extends org.apache.uima.jcas.tcas.Annotation> T trimFront(T annotation, char... ws)
T - the annotation typeannotation - the annotation to be trimmedws - an array of chars to be trimmedpublic static <T extends org.apache.uima.jcas.tcas.Annotation> T trimBegin(T annotation,
char... ws)
T - the annotation typeannotation - the annotation to be trimmedws - an array of chars to be trimmedpublic static <T extends org.apache.uima.jcas.tcas.Annotation> T trimEnd(T annotation,
char... ws)
annotation - The annotation to be trimmed.ws - An array of characters which are considered whitespaceCopyright © 2016. All rights reserved.