Currently when we call expandToNearestWordBoundaryPointUsingSegments
on text in Japanese (or any non-space-separated language) we often
include too much text. This is because, if the range already ends on
a word boundary, we jump to the end of the segment where it ends
(i.e., we add another word).
The fix for this is simple; we just early-return whenever the range
points to the beginning/end of a segment, regardless of whether or
not that segment is whitespace.
Currently when we call expandToNearestWordBoundaryPointUsingSegments on text in Japanese (or any non-space-separated language) we often include too much text. This is because, if the range already ends on a word boundary, we jump to the end of the segment where it ends (i.e., we add another word).
The fix for this is simple; we just early-return whenever the range points to the beginning/end of a segment, regardless of whether or not that segment is whitespace.