def LF_ocr_text_match(c):
    args = c.get_contexts()
    if (len(args) != 2):
        raise NotImplementedError('Only handles binary candidates currently')
    (product, img) = args
    ocr_wordlist = img.text.lower().split('\n')
    ocr_wordlist = [w for w in ocr_wordlist if (not (w == ''))]
    for w in ocr_wordlist:
        if (fuzz.partial_ratio(product.text, w) >= 90):
            return 1
    return 0
def LF_ocr_text_match(c):
    args = c.get_contexts()
    if (len(args) != 2):
        raise NotImplementedError('Only handles binary candidates currently')
    (product, img) = args
    ocr_wordlist = img.text.lower().split('\n')
    ocr_wordlist = [w for w in ocr_wordlist if (not (w == ))]
    for w in ocr_wordlist:
        if (fuzz.partial_ratio(product.text, w) >= 90):
            return 1
    return 0