Code for ngram generator; It still uses input_matrixgenertor.py for input