function add_ngrams_mongo.py, to calculate and insert the n-grams in the database