def rare_grams(card, thresh = 2, grams = 2):
    if not grams in gramdicts:
        return None
    rares = 0
    gramdict = gramdicts[grams]
    for line in card.text_lines_words:
        for i in range(0, len(line) - (grams - 1)):
            ngram = ' '.join([line[i + j] for j in range(0, grams)])
            if ngram in gramdict:
                if thresh < gramdict[ngram]:
                    rares += 1
            else:
                rares += 1
    return rares
dataset/ETHPy150Open billzorn/mtgencode/scripts/mtg_validate.py/rare_grams/swapped operands of `<`