code: private String[] getPrefixes(final String lex) {
      final Integer start = Integer.parseInt(this.attributes.get("prefBegin"));
      final Integer end = Integer.parseInt(this.attributes.get("prefEnd"));
      final String[] prefs = new String[end];
      for (int li = start, ll = end; 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