edu.stanford.nlp.ling.tokensregex
Class MatchedExpression.SingleAnnotationExtractor

java.lang.Object
  extended by edu.stanford.nlp.ling.tokensregex.MatchedExpression.SingleAnnotationExtractor
All Implemented Interfaces:
Function<CoreMap,Value>
Enclosing class:
MatchedExpression

public static class MatchedExpression.SingleAnnotationExtractor
extends java.lang.Object
implements Function<CoreMap,Value>

Function that takes a CoreMap, applies a extraction function to it, to get a value Also contains information on how to construct a final annotation.


Field Summary
 boolean includeNested
           
 java.lang.String name
           
 double priority
           
 Function<MatchedExpression,?> resultAnnotationExtractor
           
 java.util.List<java.lang.Class> resultAnnotationField
           
 java.lang.Class resultNestedAnnotationField
           
 java.util.Map<java.lang.Class,CoreMapAttributeAggregator> tokensAggregators
           
 java.lang.Class tokensAnnotationField
           
 java.util.List<java.lang.Class> tokensResultAnnotationField
           
 Function<CoreMap,Value> valueExtractor
           
 double weight
           
 
Constructor Summary
MatchedExpression.SingleAnnotationExtractor()
           
 
Method Summary
 void annotate(MatchedExpression matchedExpression)
           
 void annotate(MatchedExpression matchedExpression, java.util.List<? extends CoreMap> nested)
           
 Value apply(CoreMap in)
          Converts a T1 to a different T2.
 MatchedExpression createMatchedExpression(Interval<java.lang.Integer> charOffsets, Interval<java.lang.Integer> tokenOffsets)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name

priority

public double priority

weight

public double weight

tokensAnnotationField

public java.lang.Class tokensAnnotationField

tokensResultAnnotationField

public java.util.List<java.lang.Class> tokensResultAnnotationField

resultAnnotationField

public java.util.List<java.lang.Class> resultAnnotationField

resultNestedAnnotationField

public java.lang.Class resultNestedAnnotationField

includeNested

public boolean includeNested

valueExtractor

public Function<CoreMap,Value> valueExtractor

resultAnnotationExtractor

public Function<MatchedExpression,?> resultAnnotationExtractor

tokensAggregators

public java.util.Map<java.lang.Class,CoreMapAttributeAggregator> tokensAggregators
Constructor Detail

MatchedExpression.SingleAnnotationExtractor

public MatchedExpression.SingleAnnotationExtractor()
Method Detail

apply

public Value apply(CoreMap in)
Description copied from interface: Function
Converts a T1 to a different T2. For example, a Parser will convert a Sentence to a Tree. A Tagger will convert a Sentence to a TaggedSentence.

Specified by:
apply in interface Function<CoreMap,Value>
Parameters:
in - The function's argument
Returns:
The function's evaluated value

annotate

public void annotate(MatchedExpression matchedExpression,
                     java.util.List<? extends CoreMap> nested)

annotate

public void annotate(MatchedExpression matchedExpression)

createMatchedExpression

public MatchedExpression createMatchedExpression(Interval<java.lang.Integer> charOffsets,
                                                 Interval<java.lang.Integer> tokenOffsets)


Stanford NLP Group