void findWordBoundary(StringView text, int position, int* start, int* end)
{
    TextBreakIterator* it = wordBreakIterator(text);
    *end = textBreakFollowing(it, position);
    if (*end < 0)
        *end = textBreakLast(it);
    *start = textBreakPrevious(it);
}
void findWordBoundary(const UChar* chars, int len, int position, int* start, int* end)
{
    TextBreakIterator* it = wordBreakIterator(chars, len);
    *end = textBreakFollowing(it, position);
    if (*end < 0)
        *end = textBreakLast(it);
    *start = textBreakPrevious(it);
}
Beispiel #3
0
int textBreakPreceding(TextBreakIterator* iterator, int offset)
{
    if (offset > iterator->m_charIterator.getUTF16Length())
        return TextBreakDone;
    if (offset < 0)
        return 0;
    iterator->m_charIterator.setUTF16Index(offset);
    return textBreakPrevious(iterator);
}
int textBreakPreceding(TextBreakIterator* bi, int pos)
{
    bi->m_index = pos;
    return textBreakPrevious(bi);
}