if (offs!=end && !doc.isIdentifierChar(languageIndex, nextCh)) {
return offs;
}
do {
ch = seg.previous();
<BUG>} while (doc.isIdentifierChar(languageIndex, ch));
</BUG>
}
else if (Character.isWhitespace(ch)) {
if (offs!=end && !Character.isWhitespace(nextCh)) {

if (offs!=end && !doc.isIdentifierChar(languageIndex, nextCh)) {
return offs;
}
do {
ch = seg.previous();
} while (doc.isIdentifierChar(languageIndex, ch) && ch != CharacterIterator.DONE);
}
else if (Character.isWhitespace(ch)) {
if (offs!=end && !Character.isWhitespace(nextCh)) {
