From 168c8857b46ce062f9df6a799cfc338d2d36e887 Mon Sep 17 00:00:00 2001 From: hiteshbedre <32206192+hiteshbedre@users.noreply.github.com> Date: Wed, 3 May 2023 13:45:43 +0530 Subject: [PATCH 1/2] corrected misleading variable name --- rbiparser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rbiparser/__init__.py b/rbiparser/__init__.py index 2199b65..6085dc0 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)) From 6c791156cca04c80c63b107a57ea218020655aaf Mon Sep 17 00:00:00 2001 From: hiteshbedre <32206192+hiteshbedre@users.noreply.github.com> Date: Wed, 3 May 2023 13:52:27 +0530 Subject: [PATCH 2/2] Replaced variable name --- rbiparser/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rbiparser/__init__.py b/rbiparser/__init__.py index 6085dc0..89c42ad 100644 --- a/rbiparser/__init__.py +++ b/rbiparser/__init__.py @@ -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()