code: public String[] tokenize(String s) {
      Span[] spans = tokenizePos(s);
      String[] toks = new String[spans.length];
      for (int ti = 0, tl = toks.length; ti < tl; ti++) {
        toks[ti] = s.substring(spans[ti].getStart(), spans[ti].getEnd());
      }
      return toks;
    }
docs: Tokenize a String.
  
  @param s  The string to be tokenized.
  @return   A string array containing individual tokens as elements.