Update contains in Python wrapper to support ngrams