code debugged (case of max_ngrams < 1), added tests for seq2ngrams