public class MatchedExpression extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MatchedExpression.SingleAnnotationExtractor
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.
|
Constructor and Description |
---|
MatchedExpression(Interval<Integer> charOffsets,
Interval<Integer> tokenOffsets,
MatchedExpression.SingleAnnotationExtractor extractFunc,
double priority,
double weight) |
MatchedExpression(MatchedExpression me) |
protected String text
protected Interval<Integer> charOffsets
protected Interval<Integer> tokenOffsets
protected Interval<Integer> chunkOffsets
protected CoreMap annotation
protected MatchedExpression.SingleAnnotationExtractor extractFunc
public Value value
public static final java.util.function.Function<CoreMap,Interval<Integer>> COREMAP_TO_TOKEN_OFFSETS_INTERVAL_FUNC
public static final java.util.function.Function<CoreMap,Interval<Integer>> COREMAP_TO_CHAR_OFFSETS_INTERVAL_FUNC
public static final java.util.function.Function<MatchedExpression,Interval<Integer>> EXPR_TO_TOKEN_OFFSETS_INTERVAL_FUNC
public static final Comparator<MatchedExpression> EXPR_PRIORITY_COMPARATOR
public static final Comparator<MatchedExpression> EXPR_ORDER_COMPARATOR
public static final Comparator<MatchedExpression> EXPR_LENGTH_COMPARATOR
public static final Comparator<MatchedExpression> EXPR_TOKEN_OFFSET_COMPARATOR
public static final Comparator<MatchedExpression> EXPR_TOKEN_OFFSETS_NESTED_FIRST_COMPARATOR
public static final Comparator<MatchedExpression> EXPR_PRIORITY_LENGTH_COMPARATOR
public static final Comparator<MatchedExpression> EXPR_LENGTH_PRIORITY_COMPARATOR
public static final java.util.function.Function<MatchedExpression,Double> EXPR_WEIGHT_SCORER
public MatchedExpression(MatchedExpression me)
public MatchedExpression(Interval<Integer> charOffsets, Interval<Integer> tokenOffsets, MatchedExpression.SingleAnnotationExtractor extractFunc, double priority, double weight)
protected boolean extractAnnotation(List<? extends CoreMap> source, Map<Class,CoreMapAttributeAggregator> chunkAggregators)
public double getPriority()
public int getOrder()
public boolean isIncludeNested()
public void setIncludeNested(boolean includeNested)
public String getText()
public CoreMap getAnnotation()
public Value getValue()
public static List<? extends CoreMap> replaceMerged(List<? extends CoreMap> list, List<? extends MatchedExpression> matchedExprs)
public static List<? extends CoreMap> replaceMergedUsingTokenOffsets(List<? extends CoreMap> list, List<? extends MatchedExpression> matchedExprs)
public static <T extends MatchedExpression> List<T> removeNullValues(List<T> chunks)
public static <T extends MatchedExpression> List<T> removeNested(List<T> chunks)
public static <T extends MatchedExpression> List<T> removeOverlapping(List<T> chunks)