Skip to content

DefaultTextSpan

Sean Finan edited this page Feb 9, 2026 · 1 revision

@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}

Apache cTAKES

ctakes-core API

Python API

ctakes-core

patient
    AbstractPatientConsumer
    AbstractPatientFileWriter
    PatientNoteCollector
    PatientNoteStore
    PatientViewUtil
pipeline
    PipeBitLocator
    PipelineBuilder
    PiperFileReader
    PiperFileRunner
resource
    FileLocator
util
    CalendarUtil
    MutableUimaContext
    NumberedSuffixComparator
    Pair
    RelationArgumentUtil
    StringUtil
     annotation
         ConceptBuilder
         EssentialAnnotationUtil
         IdentifiedAnnotationBuilder
         IdentifiedAnnotationUtil
         OntologyConceptUtil
         SemanticGroup
         SemanticTui
     doc
         DocIdUtil
         JCasBuilder
         TextBySectionBuilder
         TextBySentenceBuilder
     log
         DotLogger
         FinishedLogger
     regex
         RegexSpanFinder
         TimeoutMatcher
     textspan
         DefaultAspanComparator
         DefaultTextSpanComparator
         DefaultTextSpan
         TextSpan



General

Clone this wiki locally