public class TextSliceExtractor<T extends Annotation> extends Object implements NamedFeatureExtractor1<T>
| Constructor and Description |
|---|
TextSliceExtractor(int start)
Create an extractor for a slice of text from a single offset to the end of the string.
|
TextSliceExtractor(int start,
int stop)
Create an extractor for a given slice of the text.
|
| Modifier and Type | Method and Description |
|---|---|
List<Feature> |
extract(JCas view,
T focusAnnotation)
Some feature extractors will require some specific number of annotations that is greater than
one.
|
String |
getFeatureName()
Gets the name that will be used for all features created by this feature extractor.
|
public TextSliceExtractor(int start)
new TextSliceExtractor(-2) would extract a suffix of length 2 from the text.start - The first character offset of the slice. If negative, it is assumed to count backwards
from the end of the string. If the offset falls before the start of the string, the
start of the string will be used instead.public TextSliceExtractor(int start, int stop)
new TextSliceExtractor(1, -1) would extract all of the text but its first and last
characters.start - The first character offset of the slice. If negative, it is assumed to count backwards
from the end of the string. If the offset falls before the start of the string, the
start of the string will be used instead.stop - The last character offset of the slice. If negative, it is assumed to count backwards
from the end of the string. If the offset falls after the end of the string, the end
of the string will be used instead.public List<Feature> extract(JCas view, T focusAnnotation)
FeatureExtractor1extract in interface FeatureExtractor1<T extends Annotation>view - the current view of the document.focusAnnotation - the annotation for which to collect features.public String getFeatureName()
NamedFeatureExtractor1getFeatureName in interface NamedFeatureExtractor1<T extends Annotation>Copyright © 2014. All rights reserved.