/** This helper method will return the end of the next word in the buffer. */
 private static int getNextWordEnd(Segment text, int startPos) {
   for (char ch = text.setIndex(startPos); ch != Segment.DONE; ch = text.next()) {
     if (!Character.isLetterOrDigit(ch)) {
       return text.getIndex();
     }
   }
   return text.getEndIndex();
 }
Beispiel #2
0
 /**
  * Returns true if the specified character is a full-text letter or digit.
  *
  * @param ch character to be tested
  * @return result of check
  */
 public static boolean ftChar(final int ch) {
   return ch >= '0' && (ch < 0x80 ? LOD[ch - '0'] : Character.isLetterOrDigit(ch));
 }