DefaultTextSpan - apache/ctakes GitHub Wiki

@Immutable public final class DefaultTextSpan implements TextSpan

Holder for begin and end text span offsets within a containing sentence

public DefaultTextSpan( final AnnotationFS annotation, final int sentenceOffset )

  • Parameters:
    • annotation -
    • sentenceOffset begin span offset of the containing sentence

public DefaultTextSpan( final int begin, final int end )

  • Parameters:
    • begin begin offset within the containing sentence
    • end end offset within the containing sentence

@Override public int getBegin()

{@inheritDoc}

@Override public int getEnd()

{@inheritDoc}

@Override public int getWidth()

{@inheritDoc}

@Override public boolean overlaps( final TextSpan textSpan )

NOTE: TextSpans are begin inclusive end exclusive. So, 1 is subtracted from the end when comparing to another begin

  • Parameters:
    • textSpan another textspan
  • Returns: true if there is overlap between the two text spans

@Override public boolean contains( TextSpan textSpan )

{@inheritDoc}

@Override public String toString()

  • Returns: a representation of the text span offsets as: begin,end

@Override public boolean equals( final Object other )

{@inheritDoc}

@Override public int hashCode()

{@inheritDoc}

⚠️ **GitHub.com Fallback** ⚠️