public class SentenceSpan extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CR |
static String |
CRLF |
static String |
LF |
Constructor and Description |
---|
SentenceSpan(int s,
int e,
String t) |
Modifier and Type | Method and Description |
---|---|
int |
getEnd() |
int |
getStart() |
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(String in) |
List<SentenceSpan> |
splitAtLineBreaksAndTrim(String separatorPattern)
Trim any leading or trailing whitespace.
|
List<SentenceSpan> |
splitAtPeriodAndTrim(Pattern acronymPattern,
Pattern periodPattern,
Pattern splitPattern)
vng added
|
List<SentenceSpan> |
splitSubspans(List<SentenceSpan> subspans,
Pattern splitPattern)
vng added
|
String |
toString() |
public SentenceSpan(int s, int e, String t)
public void setStart(int in)
public void setEnd(int in)
public void setText(String in)
public int getStart()
public int getEnd()
public String getText()
public List<SentenceSpan> splitAtLineBreaksAndTrim(String separatorPattern)
separatorPattern
- CR LF or CRLFpublic List<SentenceSpan> splitAtPeriodAndTrim(Pattern acronymPattern, Pattern periodPattern, Pattern splitPattern)
public List<SentenceSpan> splitSubspans(List<SentenceSpan> subspans, Pattern splitPattern)
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.