splitSentencesIndex method
Implementation
List<SentenceIndex> splitSentencesIndex(
String text, bool useHeuristic, bool useQuotesBracketsProcessing, int maxRecoverStep, int maxRecoverLength) {
List<String> sentences = splitSentences(text, useHeuristic, useQuotesBracketsProcessing, maxRecoverStep, maxRecoverLength, 0, true);
List<SentenceIndex> sentenceIndexes = [];
int offset = 0;
for (String sentence in sentences) {
sentenceIndexes.add(new SentenceIndex(start: offset + text.indexOf(sentence), end: offset + text.indexOf(sentence) + sentence.length));
offset += text.indexOf(sentence) + sentence.length;
text = text.substring(text.indexOf(sentence) + sentence.length);
}
return sentenceIndexes;
}