[minhashing] Correctly build k grams in minhashing, closes #221665 [applied]