org.apache.ctakes.core.sentence
Class SentenceSpan

java.lang.Object
  extended by org.apache.ctakes.core.sentence.SentenceSpan

public class SentenceSpan
extends java.lang.Object

A span of text and its offsets within some larger text


Field Summary
static java.lang.String CR
           
static java.lang.String CRLF
           
static java.lang.String LF
           
 
Constructor Summary
SentenceSpan(int s, int e, java.lang.String t)
           
 
Method Summary
 int getEnd()
           
 int getStart()
           
 java.lang.String getText()
           
 void setEnd(int in)
          Set offset of end of this span within the larger text
 void setStart(int in)
          Set offset of start of this span within the larger text
 void setText(java.lang.String in)
           
 java.util.List<SentenceSpan> splitAtLineBreaksAndTrim(java.lang.String separatorPattern)
          Trim any leading or trailing whitespace.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LF

public static java.lang.String LF

CR

public static java.lang.String CR

CRLF

public static java.lang.String CRLF
Constructor Detail

SentenceSpan

public SentenceSpan(int s,
                    int e,
                    java.lang.String t)
Method Detail

setStart

public void setStart(int in)
Set offset of start of this span within the larger text


setEnd

public void setEnd(int in)
Set offset of end of this span within the larger text


setText

public void setText(java.lang.String in)

getStart

public int getStart()

getEnd

public int getEnd()

getText

public java.lang.String getText()

splitAtLineBreaksAndTrim

public java.util.List<SentenceSpan> splitAtLineBreaksAndTrim(java.lang.String separatorPattern)
Trim any leading or trailing whitespace. If there are any end-of-line characters in what's left, split into multiple smaller sentences, and trim each. If is entirely whitespace, return an empty list

Parameters:
separatorPattern - CR LF or CRLF

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object