Fix a bug in EndOfSentenceDetector.getEndPosition