Example usage for opennlp.tools.util Span compareTo

List of usage examples for opennlp.tools.util Span compareTo

Introduction

In this page you can find the example usage for opennlp.tools.util Span compareTo.

Prototype

public int compareTo(Span s) 

Source Link

Document

Compares the specified span to the current span.

Usage

From source file:opennlp.tools.util.Span.java

/**
     * Test for {@link Span#compareTo(Object)}.
     *//*w  w  w  .  j  a v a  2 s .c o  m*/
    public void testCompareToLower() {
        Span a = new Span(100, 1000);
        Span b = new Span(10, 50);

        Assert.assertEquals(true, a.compareTo(b) > 0);
    }

From source file:opennlp.tools.util.Span.java

/**
     * Test for {@link Span#compareTo(Object)}.
     *//*  w w  w.  j  ava2  s  .com*/
    public void testCompareToHigher() {
        Span a = new Span(100, 200);
        Span b = new Span(300, 400);

        Assert.assertEquals(true, a.compareTo(b) < 0);
    }

From source file:opennlp.tools.util.Span.java

/**
     * Test for {@link Span#compareTo(Object)}.
     *//*  w w  w . j a  va2 s  .  co m*/
    public void testCompareToEquals() {
        Span a = new Span(30, 1000);
        Span b = new Span(30, 1000);

        Assert.assertEquals(true, a.compareTo(b) == 0);
    }