int size = text.getEndIndex(); for (int i=startPos;i<size;i++) { if (Character.isLetterOrDigit(text.next())) { return i;
if (startPos <= text.getEndIndex()) for (char ch = text.setIndex(startPos);ch != Segment.DONE;ch = text.next()) { if (Character.isLetterOrDigit(ch)) { return text.getIndex(); }
  private static int getNextWordStart(Segment text, int startPos) {    int size = text.getEndIndex();    for (int i=startPos;i<size;i++) {      if (Character.isLetterOrDigit(text.next())) {        return i;      }    }    return -1;  }