public static class CleartkExtractor.Count extends Object implements CleartkExtractor.Context
CleartkExtractor.Context that aggregates the features of other contexts into a bag of counts where
only the count of occurrence of each feature value is maintained. The span (offsets) of the bag
of counts is encoded as part of the feature name.| Constructor and Description |
|---|
CleartkExtractor.Count(CleartkExtractor.Context... contexts)
Constructs a
CleartkExtractor.Context which converts the features extracted by the argument contexts
into a bag of count features. |
| Modifier and Type | Method and Description |
|---|---|
<SEARCH_T extends Annotation> |
extract(JCas jCas,
Annotation focusAnnotation,
CleartkExtractor.Bounds bounds,
Class<SEARCH_T> annotationClass,
FeatureExtractor1<SEARCH_T> extractor)
This method got a bit gnarly in order to support nested Count contexts.
|
String |
getName()
Gets the base feature name that will be used in
Features generated by this context. |
public CleartkExtractor.Count(CleartkExtractor.Context... contexts)
CleartkExtractor.Context which converts the features extracted by the argument contexts
into a bag of count features.contexts - The contexts which should be combined into a bag.public <SEARCH_T extends Annotation> List<Feature> extract(JCas jCas, Annotation focusAnnotation, CleartkExtractor.Bounds bounds, Class<SEARCH_T> annotationClass, FeatureExtractor1<SEARCH_T> extractor) throws CleartkExtractorException
extract in interface CleartkExtractor.ContextjCas - The JCas containing the focus annotation.focusAnnotation - The annotation whose context is to be searched.annotationClass - The type of annotation to be found in the context.extractor - The feature extractor that should be applied to each annotation found in the
context.CleartkExtractorExceptionpublic String getName()
CleartkExtractor.ContextFeatures generated by this context.
The actual feature names may include additional information (e.g. relative position), but
this base name should be used in all aggregating contexts like CleartkExtractor.Bag or CleartkExtractor.Ngram.getName in interface CleartkExtractor.ContextCopyright © 2014. All rights reserved.