Example usage for opennlp.tools.util Span intersects

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

Introduction

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

Prototype

public boolean intersects(Span s) 

Source Link

Document

Returns true if the specified span intersects with this span.

Usage

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

/**
     * Test for {@link Span#intersects(Span)}.
     *///w w w .  jav  a 2s .  com
    public void testIntersects() {
        Span a = new Span(10, 50);
        Span b = new Span(40, 100);

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

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

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

        Assert.assertTrue(b.intersects(d));
    }