Numerically encodes the strings in the matrix with an encoding dictionary.
original matrix before encoding.
dictionary against which to do the encoding.
encoded matrix.
Numerically encodes the strings in the matrix with an encoding dictionary.