code: protected static String[] getPrefixes(final String lex) {
      final String[] prefs = new String[PREFIX_LENGTH];
      for (int li = 0, ll = PREFIX_LENGTH; li < ll; li++) {
        prefs[li] = lex.substring(0, Math.min(li + 1, lex.length()));
      }
      return prefs;
    }
docs: Obtain prefixes for each token.
  
  @param lex
  the current word
  @return the prefixes