import re

abb_patterns = re.compile(
    r"(?<!\w)(INC|LLC|LLP|LLLP|LP|LTD|CORP|CO|PLC|GMBH|AG|"
    r"SA|BV|SRL|SARL|PTY|ACC|ACCT|ACCTS|INST|INSTN|INSTNS|INSTL|GRP|GRPS|"
    r"INC\.|LTD\.|CO\.|CORP\.|LLP|PLLC|PC|ASSN|NATL|INTL|GR|"
    r"TRU|TR|TRUS|TRS|ADV)(?=\b|\s|$|[.,;:])",
    flags=re.IGNORECASE,
)

end_of_line_patterns = re.compile(r"(LLC|LLP|LTD|\d)(?=\b|\s|$|[.,;:])", flags=re.IGNORECASE)

word_patterns = re.compile(
    r"(GROUP|PARTNERS|ASSOCIATES|HOLDINGS|ENTERPRISES|"
    r"INDUSTRIES|SYSTEMS|SOLUTIONS|INTERNATIONAL|GLOBAL|TECHNOLOGIES|"
    r"TRUST|TRUSTEE|TRUSTEES|AGENCY|MANAGEMENT|STUDIO|WORKS|"
    r"PRODUCTIONS|CORPORATION|BANK|INSURANCE|LOGISTICS|CONSTRUCTION|REALTY|"
    r"PHARMACEUTICALS|CONSULTING|NATIONAL|UNIVERSAL|WORLD|INCORPORATED|"
    r"LIMITED|PARTNERSHIP|PROPERTIES|PROPERTY|UNIVERSITY|COLLEGE|ACADEMY|"
    r"INSTITUTE|INSTITUTION|CENTER|CENTRE|CLINIC|MEDICAL|HEALTH|HEALTHCARE|"
    r"HOSPITAL|SCHOOL|ACADEMY|CHARITY|CHARITABLE|FOUNDATION|ASSOCIATION|CLUB|"
    r"SOCIETY|COOPERATIVE|CO-OP|MORTGAGE|MGMT|CHICAGO|INVESTMENTS|INVESTMENT|INVEST|INVESTORS|"
    r"ASSOC|ASSNS|ASSOCN|ASSOCNS|ASSOCIA|COMPANY|COMPANIES|ACCOUNT|SHOPPING|"
    r"SERVICES|UNION|NETWORK|TRUST|VENTURES|EQUITY|EQUITIES|CAPITAL|COMMUNITY|"
    r"INITIATIVE|INITIATIVES|DEVELOPMENT|DEVELOPMENTS|DEVELOPER|DEVELOPERS|FOODS|CHEVROLE"
    r"REAL ESTATE|ESTATE|LEGAL|ILLINOIS|ADVOCACY|ADVOCATES|ADVOCAT|CTLTC|\d+)",
    flags=re.IGNORECASE,
)

excluded_patterns = re.compile(
    r"INVOLUNTARY|VACANT|VACATED|SOLE OFFICER|(\b)None(\b)|REVOKED|"
    r"DISSOLUTION|UNACCEPTABLE|MERGED|WITHDRAWN|BANKRUPTCY|CONVERSION|"
    r"TAXPAYER|TAX PAYER|SAME AS ABOVE|SAME AS BELOW",
    flags=re.IGNORECASE,
)

valid_states = re.compile(
    r"AE|AP|AA|AL|AK|AZ|AR|CA|CO|CT|DE|FL|GA|HI|ID|IL|IN|IA|KS|"
    r"KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|"
    r"NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|"
    r"WI|WY|DC|PR|GU|AS|VI|MP",
    flags=re.IGNORECASE,
)
