if (Character.isLetter(text.charAt(i)))
cp = text.codePointAt(i);       if (Character.isLetter(cp) || !Character.isWhitespace(cp))
  public static final int getPreviousWord(JTextComponent c, int offs)      throws BadLocationException  {    String text = c.getText();        if (offs <= 0 || offs > text.length())      throw new BadLocationException("invalid offset specified", offs);        BreakIterator wb = BreakIterator.getWordInstance();    wb.setText(text);    int last = wb.preceding(offs);    int current = wb.previous();    int cp;    while (current != BreakIterator.DONE)      {        for (int i = last; i < offs; i++)          {            // FIXME: Should use isLetter(int) and text.codePointAt(int)            // instead, but isLetter(int) isn't implemented yet            if (Character.isLetter(text.charAt(i)))              return last;          }        last = current;        current = wb.previous();      }        return 0;  }