diff options
Diffstat (limited to 'Scripts/string_matcher.py')
| -rw-r--r-- | Scripts/string_matcher.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Scripts/string_matcher.py b/Scripts/string_matcher.py index 686056c..26241f2 100644 --- a/Scripts/string_matcher.py +++ b/Scripts/string_matcher.py @@ -52,7 +52,8 @@ def matchSpaceDelimitedStrings(old_text: str, new_text: str, window_size = 4) -> def matchStrings(old_text: str, new_text: str, window_size = 3) -> str: if old_text == new_text: - print("STRING MATCH exception path 1") + if DEBUG: + print("STRING MATCH exception path 1") return old_text elif len(old_text) >= window_size and len(new_text) >= window_size: # Find the window where the cumulative string distance @@ -105,9 +106,10 @@ def matchStrings(old_text: str, new_text: str, window_size = 3) -> str: new_text[best_match_j:])) return old_prefix + new_text[best_match_j:] else: - print("STRING MATCH exception path 2") - print(" OLD: {}".format(old_text)) - print(" NEW: {}".format(new_text)) + if DEBUG: + print("STRING MATCH exception path 2") + print(" OLD: {}".format(old_text)) + print(" NEW: {}".format(new_text)) return new_text if __name__ == "__main__": |
