From 3f15a53ae581ac2ce0dfbe84fc7994a329ab532b Mon Sep 17 00:00:00 2001 From: Aarav Navani <38411399+oofmeister27@users.noreply.github.com> Date: Mon, 5 Aug 2024 23:57:14 -0700 Subject: [PATCH] remove duplicate error spans function --- validator/main.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/validator/main.py b/validator/main.py index ee8e88f..ba88caa 100644 --- a/validator/main.py +++ b/validator/main.py @@ -195,21 +195,6 @@ def find_all(a_str, sub): reason=f"Competitor found: {value[start:start+len(entity)]}", ) ) - def find_all(a_str, sub): - start = 0 - while True: - start = a_str.find(sub, start) - if start == -1: - return - yield start - start += len(sub) # use start += 1 to find overlapping matches - - error_spans = [] - for entity in found_entities: - starts = list(find_all(value, entity)) - for start in starts: - error_spans.append(ErrorSpan(start=start, end=start+len(entity), reason=f'Competitor found: {value[start:start+len(entity)]}')) - if len(flagged_sentences): return FailResult(