diff options
| author | yum <yum.food.vr@gmail.com> | 2023-01-04 09:52:02 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-01-04 10:03:39 -0800 |
| commit | 66d311b3267620995e5c35b16f3fba18ed0c48f3 (patch) | |
| tree | 88411e37c442d66cc34e3f6f22683ce2976a5743 /Scripts/string_matcher.py | |
| parent | 6bed3a15edf134fa176ca4866b4346017bc97ada (diff) | |
Bugfix: user-provided paths may now contain spaces
Previously, paths containing spaces would be interpreted by python's argument
parser as multiple separate arguments, causing it to fail. Now we escape paths
inside PythonWrapper using std::quoted().
* Improve PII filtering. Python output would contain multiple path separators
(like C:\\Users\\foo\\), defeating the PII regex.
* Silence compiler warning in PII filter.
* Document usability improvements.
* Transcription layer exponential backoff goes to ~infinity when paused.
This is a hack, since we really don't need to transcribe at all when paused,
but it lets us keep the code simple. Good enough until the next rewrite.
* Shader only samples background when necessary.
* Limit matchStrings() print()s to DEBUG mode
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__": |
