@Override public MatchedExpression apply(SequenceMatchResult<CoreMap> matched) { MatchedExpression te = extractor.createMatchedExpression(null, Interval.toInterval(matched.start(group), matched.end(group), Interval.INTERVAL_OPEN_END)); if (Double.isNaN(te.priority)) { te.priority = matched.priority(); } if (Double.isNaN(te.weight)) { te.weight = matched.score(); } if (this.group != 0) { // Save context so value evaluation can happen te.context = matched.toBasicSequenceMatchResult(); } return te; } }
public int compare(MatchResult e1, MatchResult e2) { double s1 = 0; if (e1 instanceof SequenceMatchResult) { s1 = ((SequenceMatchResult) e1).score(); }; double s2 = 0; if (e2 instanceof SequenceMatchResult) { s2 = ((SequenceMatchResult) e2).score(); }; if (s1 == s2) { return 0; } else { return (s1 > s2)? -1:1; } } };
public int compare(MatchResult e1, MatchResult e2) { double s1 = 0; if (e1 instanceof SequenceMatchResult) { s1 = ((SequenceMatchResult) e1).score(); }; double s2 = 0; if (e2 instanceof SequenceMatchResult) { s2 = ((SequenceMatchResult) e2).score(); }; if (s1 == s2) { return 0; } else { return (s1 > s2)? -1:1; } } };
@Override public MatchedExpression apply(SequenceMatchResult<CoreMap> matched) { MatchedExpression te = extractor.createMatchedExpression(null, Interval.toInterval(matched.start(group), matched.end(group), Interval.INTERVAL_OPEN_END)); if (Double.isNaN(te.priority)) { te.priority = matched.priority(); } if (Double.isNaN(te.weight)) { te.weight = matched.score(); } if (this.group != 0) { // Save context so value evaluation can happen te.context = matched.toBasicSequenceMatchResult(); } return te; } }
@Override public MatchedExpression apply(SequenceMatchResult<CoreMap> matched) { MatchedExpression te = extractor.createMatchedExpression(null, Interval.toInterval(matched.start(group), matched.end(group), Interval.INTERVAL_OPEN_END)); if (Double.isNaN(te.priority)) { te.priority = matched.priority(); } if (Double.isNaN(te.weight)) { te.weight = matched.score(); } if (this.group != 0) { // Save context so value evaluation can happen te.context = matched.toBasicSequenceMatchResult(); } return te; } }