def makeNgramModel(tokenlist, n, fp={}):
   """This function generates an N-gram model as a dictionary data-structure.
   """
   for start in range( len(tokenlist) - (n - 1) ):
      tokenslice = tokenlist[start : start + n]
      #print("Token-slice:", tokenslice)

      stringngram = " ".join(tokenslice)
      #print("String N-gram:", stringngram)
   
      #print(" ".join(tokens[start : start + n]))
      fp[stringngram] = fp.get(stringngram, 0) + 1
   return fp