From 51a9db3b40297c016a55c495fb9b4a7d3abecc24 Mon Sep 17 00:00:00 2001 From: insolor <2442833+insolor@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:58:32 +0300 Subject: [PATCH] Ignore "Crash" strings, ignore -betaN strings --- df_translation_toolkit/utils/df_ignore_string_rules.py | 3 ++- tests/test_df_ignore_string_rules.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/df_translation_toolkit/utils/df_ignore_string_rules.py b/df_translation_toolkit/utils/df_ignore_string_rules.py index 82bdc12..27742e6 100644 --- a/df_translation_toolkit/utils/df_ignore_string_rules.py +++ b/df_translation_toolkit/utils/df_ignore_string_rules.py @@ -99,7 +99,7 @@ def ignore_underline_separated_words(string: str) -> bool: @rules.register def ignore_dash_prepended_strings(string: str) -> bool: - return re.fullmatch(r"-[a-z_]+-?", string) is not None + return re.fullmatch(r"-[a-z0-9_]+-?", string) is not None @rules.register @@ -113,6 +113,7 @@ def ignore_word_with_number(string: str) -> bool: forbidden_starts = { + "Crash", "String:", "Adventure:", "Hotkey:", diff --git a/tests/test_df_ignore_string_rules.py b/tests/test_df_ignore_string_rules.py index fd36936..8d5f30c 100644 --- a/tests/test_df_ignore_string_rules.py +++ b/tests/test_df_ignore_string_rules.py @@ -66,6 +66,7 @@ (rules.ignore_underline_separated_words, "init_sound returned false!", True), (rules.ignore_dash_prepended_strings, "-world_sites_and_pops", True), (rules.ignore_dash_prepended_strings, "-site_map-", True), + (rules.ignore_dash_prepended_strings, "-beta23", True), ( rules.ignore_by_blacklisted_words, "*** Error(s) finalizing the creature ",