code: public int[] toIntArray(ToIntFunction<? super I> toInt) {
          int len = length();
          int[] result = new int[len];
          int i = 0;
          for (I sym : this) {
              int symIdx = toInt.applyAsInt(sym);
              result[i++] = symIdx;
          }
          return result;
      }
docs: Transforms this word into an array of integers, using the specified function for translating an individual symbol
  to an integer.
  
  @param toInt
  the function for translating symbols to integers
  
  @return an integer-array representation of the word, according to the specified translation function