edu.utah.bmi.nlp.sectiondectector.SpanComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of section-detector-r Show documentation
Show all versions of section-detector-r Show documentation
SectionDetectorR is a Rule-Based SectionDetector leveraging FastNER for section header detection.
The newest version!
package edu.utah.bmi.nlp.sectiondectector;
import edu.utah.bmi.nlp.core.Span;
import java.util.Comparator;
public class SpanComparator implements Comparator {
public int compare(Span o1, Span o2) {
if (o1.getBegin() > o2.getBegin()) {
return 1;
} else if (o1.getBegin() < o2.getBegin()) {
return -1;
}
return 0;
}
}