text: public int preceding(int pos) {if (pos < text.getBeginIndex() || pos > text.getEndIndex()) {throw new IllegalArgumentException("offset out of bounds");} else if (0 == sentenceStarts.length) {text.setIndex(text.getBeginIndex());currentSentence = 0;return DONE;} else if (pos < sentenceStarts[0]) {text.setIndex(text.getBeginIndex());currentSentence = 0;return DONE;} else {currentSentence = sentenceStarts.length / 2; moveToSentenceAt(pos, 0, sentenceStarts.length - 1);if (0 == currentSentence) {text.setIndex(text.getBeginIndex());return DONE;} else {text.setIndex(sentenceStarts[--currentSentence]);return current();}}}