@Override public <SEARCH_T extends Annotation> List<Feature> extract( JCas jCas, Annotation focusAnnotation, Bounds bounds, Class<SEARCH_T> annotationClass, FeatureExtractor1<SEARCH_T> extractor) throws CleartkExtractorException { List<Feature> features = new ArrayList<Feature>(); for (Feature feature : extractor.extract(jCas, annotationClass.cast(focusAnnotation))) { features.add(new ContextFeature(this.getName(), feature)); } return features; }
features.add(new ContextFeature(this.getName(), feature));
@Override public <SEARCH_T extends Annotation> List<Feature> extract( JCas jCas, Annotation focusAnnotation, Bounds bounds, Class<SEARCH_T> annotationClass, FeatureExtractor1<SEARCH_T> extractor) throws CleartkExtractorException { String featureName = extractor instanceof NamedFeatureExtractor1 ? ((NamedFeatureExtractor1<SEARCH_T>) extractor).getFeatureName() : null; List<String> values = new ArrayList<String>(); for (Context context : this.contexts) { for (Feature feature : context.extract( jCas, focusAnnotation, bounds, annotationClass, extractor)) { values.add(String.valueOf(feature.getValue())); } } Feature feature = new Feature(featureName, Joiner.on('_').join(values)); List<Feature> features = new ArrayList<Feature>(); features.add(new ContextFeature(this.getName(), feature)); return features; } }
if (ann != null && bounds.contains(ann)) { for (Feature feature : extractor.extract(jCas, ann)) { features.add(new ContextFeature(this.getName(), pos, feature)); features.add(new ContextFeature(this.getName(), pos, oobPos, featureName)); oobPos += 1;
if (ann != null && bounds.contains(ann)) { for (Feature feature : extractor.extract(jCas, ann)) { features.add(new ContextFeature(this.getName(), pos, feature)); features.add(new ContextFeature(this.getName(), pos, oobPos, featureName)); oobPos -= 1;
@Override public <SEARCH_T extends Annotation> List<Feature> extract( JCas jCas, Annotation focusAnnotation, Bounds bounds, Class<SEARCH_T> annotationClass, FeatureExtractor1<SEARCH_T> extractor) throws CleartkExtractorException { List<Feature> features = new ArrayList<Feature>(); for (Context context : this.contexts) { for (Feature feature : context.extract( jCas, focusAnnotation, bounds, annotationClass, extractor)) { ContextFeature contextFeature = (ContextFeature) feature; Feature f2 = new Feature(contextFeature.feature.getName(), feature.getValue()); features.add(new ContextFeature(this.getName(), f2)); } } return features; } }
@Override public <SEARCH_T extends Annotation> List<Feature> extract( JCas jCas, Annotation focusAnnotation, Bounds bounds, Class<SEARCH_T> annotationClass, FeatureExtractor1<SEARCH_T> extractor) throws CleartkExtractorException { List<Feature> features = new ArrayList<Feature>(); int pos = 0; for (SEARCH_T ann : JCasUtil.selectCovered(jCas, annotationClass, focusAnnotation)) { for (Feature feature : extractor.extract(jCas, ann)) { features.add(new ContextFeature(this.getName(), pos, feature)); } pos += 1; } return features; }