Concordia
Interval Class Reference

#include <interval.hpp>

Inheritance diagram for Interval:

Public Member Functions

 Interval (const SUFFIX_MARKER_TYPE start, const SUFFIX_MARKER_TYPE end)
 
virtual ~Interval ()
 
bool intersects (Interval &interval)
 
bool contains (Interval &interval)
 
SUFFIX_MARKER_TYPE getLength ()
 
SUFFIX_MARKER_TYPE getStart () const
 
SUFFIX_MARKER_TYPE getEnd () const
 

Detailed Description

Class representing interval of a sentence, i.e. a sequence of words or chars coming from that sentence. An interval only has its start and end indexes, where the start index is inclusive and end index is exclusive. For example, an interval [2,5] of words of the sentence "This is just for testing purposes" is: "just for testing".

Constructor & Destructor Documentation

Interval::Interval ( const SUFFIX_MARKER_TYPE  start,
const SUFFIX_MARKER_TYPE  end 
)
explicit

Constructor.

Parameters
startstart index of the interval (0-based)
endend index of the interval (0-based)
Interval::~Interval ( )
virtual

Destructor.

Member Function Documentation

bool Interval::contains ( Interval interval)

Checks if this interval contains another.

Parameters
intervalanother interval
Returns
true if this interval contains the other

Here is the call graph for this function:

SUFFIX_MARKER_TYPE Interval::getEnd ( ) const
inline

Getter for interval end.

Returns
end

Here is the caller graph for this function:

SUFFIX_MARKER_TYPE Interval::getLength ( )

Getter for interval length.

Returns
end - start

Here is the caller graph for this function:

SUFFIX_MARKER_TYPE Interval::getStart ( ) const
inline

Getter for interval start.

Returns
start

Here is the caller graph for this function:

bool Interval::intersects ( Interval interval)

Checks if this interval intersects another.

Parameters
intervalanother interval
Returns
true if the two intervals intersect

Here is the call graph for this function:


The documentation for this class was generated from the following files: