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