diff --git a/rbiparser/__init__.py b/rbiparser/__init__.py index 2199b65..89c42ad 100644 --- a/rbiparser/__init__.py +++ b/rbiparser/__init__.py @@ -48,7 +48,7 @@ filters_filename = "filters.json" # Regex -alphanumeric = re.compile(r"[^a-z0-9]", re.IGNORECASE) +non_alphanumeric = re.compile(r"[^a-z0-9]", re.IGNORECASE) spaces = re.compile(r"(\s+)") brackets = re.compile(r"([^\s])(\()(.+?)(\))([a-z0-9])?") punctuations = re.compile(r"([{}\s])\1+".format(string.punctuation)) @@ -311,7 +311,7 @@ def clean_row(row, filters=False): row[6] = clean_line(row[6], True) row[7] = clean_line(row[7], True) - if len(alphanumeric.sub("", row[7])) < 4: + if len(non_alphanumeric.sub("", row[7])) < 4: row[7] = row[6] row[8] = clean_line(row[8]) @@ -340,7 +340,7 @@ def clean_line(line, complicated=False): # Uppercase potential abbreviations. chunks = line.split(" ") for n, c in enumerate(chunks): - if len(alphanumeric.sub("", c)) >= 3 and c not in exclude_words: + if len(non_alphanumeric.sub("", c)) >= 3 and c not in exclude_words: chunks[n] = c.title() else: chunks[n] = c.upper()