Implemented getParagraphSpans and getSentenceSpans with binary search.