public FilteringExtractor(Class<T> annotationClass, String name, FeatureExtractor1<T> extractor) { this.annotationClass = annotationClass; this.extractor = new NamingExtractor1<T>(name, extractor); }
protected void setSourceExtractors(List<FeatureExtractor1<SOURCE>> extractors) { this.sourceExtractors = new ArrayList<FeatureExtractor1<SOURCE>>(); for (FeatureExtractor1<SOURCE> extractor : extractors) { this.sourceExtractors.add(new NamingExtractor1<SOURCE>("Source", extractor)); } }
protected void setTargetExtractors(List<FeatureExtractor1<TARGET>> extractors) { this.targetExtractors = new ArrayList<FeatureExtractor1<TARGET>>(); for (FeatureExtractor1<TARGET> extractor : extractors) { this.targetExtractors.add(new NamingExtractor1<TARGET>("Target", extractor)); } }
public VerbClauseTemporalAnnotator() { this.eventID = 1; FeatureExtractor1<Token> precedingAuxiliaries = new CleartkExtractor<Token, Token>( Token.class, new TokenTextForSelectedPosExtractor("MD", "TO", "IN", "VB", "RB"), new Preceding(3)); FeatureExtractor1<Token> tokenStemExtractor = new TypePathExtractor<Token>(Token.class, "stem"); FeatureExtractor1<Token> tokenPOSExtractor = new TypePathExtractor<Token>(Token.class, "pos"); this.sourceFeatureExtractors = Lists.newArrayList(); this.sourceFeatureExtractors.add(new NamingExtractor1<Token>("Source", new CoveredTextExtractor<Token>())); this.sourceFeatureExtractors.add(new NamingExtractor1<Token>("Source", tokenPOSExtractor)); this.sourceFeatureExtractors.add(new NamingExtractor1<Token>("Source", tokenStemExtractor)); this.sourceFeatureExtractors.add(new NamingExtractor1<Token>("Source", precedingAuxiliaries)); this.targetFeatureExtractors = Lists.newArrayList(); this.targetFeatureExtractors.add(new NamingExtractor1<Token>("Target", new CoveredTextExtractor<Token>())); this.targetFeatureExtractors.add(new NamingExtractor1<Token>("Target", tokenPOSExtractor)); this.targetFeatureExtractors.add(new NamingExtractor1<Token>("Target", tokenStemExtractor)); this.targetFeatureExtractors.add(new NamingExtractor1<Token>("Target", precedingAuxiliaries)); this.betweenAnchorsFeatureExtractors = new ArrayList<FeatureExtractor1<Annotation>>(); this.betweenAnchorsFeatureExtractors.add(new NamingExtractor1<Annotation>( "WordsBetween", new CleartkExtractor<Annotation, Token>(Token.class, new CoveredTextExtractor<Token>(), new Bag(new Covered())))); this.pathExtractor = new TargetPathExtractor(); }