Example usage for opennlp.tools.util Span crosses

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

Introduction

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

Prototype

public boolean crosses(Span s) 

Source Link

Document

Returns true is the specified span crosses this span.

Usage

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

/**
     * Test for {@link Span#crosses(Span)}.
     *///from  w w w .j a  v a  2 s .  co m
    public void testCrosses() {
        Span a = new Span(10, 50);
        Span b = new Span(40, 100);

        Assert.assertTrue(a.crosses(b));
        Assert.assertTrue(b.crosses(a));

        Span c = new Span(10, 20);
        Span d = new Span(40, 50);

        Assert.assertFalse(c.crosses(d));
        Assert.assertFalse(d.crosses(c));

        Assert.assertFalse(b.crosses(d));
    }