private List < String > sentenceSplit ( String str ) { BreakIterator iterator = BreakIterator . getSentenceInstance ( Locale . US ) ; iterator . setText ( str ) ; int start = iterator . first ( ) ; List < String > sentences = new ArrayList < String > ( ) ; for ( int end = iterator . next ( ) ; end != BreakIterator . DONE ; start = end , end = iterator . next ( ) ) { sentences . add ( str . substring ( start , end ) . trim ( ) ) ; } return sentences ; }
Splits a String into sentences using the BreakIterator with US locale