Function tryNgram updated
Encode words in steps