@staticmethod
def _helper_gstyle_categorymatch(cat_pats, note):
    """Match categories using a Google-style search string"""
    if not cat_pats:
        return 2
    note_category = note.get('category')
    if not note_category:
        return 0
    cat_pats_matched = 0
    for cat_pat in cat_pats:
        cat_pat = cat_pat.lower()
        for pat in note_category:
            if cat_pat in pat.lower():
                cat_pats_matched += 1
                break
    if cat_pats_matched == len(cat_pats):
        return 1
    return 0
