From 46af58641935152fbc297f1c5c88dc59e411fb62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 6 Jun 2023 15:01:44 +0200 Subject: [PATCH] checks: Allow duplicate words at sentence boundary This is less likely an error and more likely an intention. Fixes #9351 --- scripts/generate-non-word-chars | 5 +++++ weblate/checks/data.py | 4 ---- weblate/checks/tests/test_duplicate_checks.py | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/generate-non-word-chars b/scripts/generate-non-word-chars index 8ef778c2d9e5..fa190faf2e23 100755 --- a/scripts/generate-non-word-chars +++ b/scripts/generate-non-word-chars @@ -22,6 +22,11 @@ EXCLUDES = { "]", # We intentionally skip following "-", + # Allow same words at sentence boundary + ";", + ":", + ",", + ".", # Used in Catalan ŀ "·", "•", diff --git a/weblate/checks/data.py b/weblate/checks/data.py index 3a6642b19290..2a1b9667d992 100644 --- a/weblate/checks/data.py +++ b/weblate/checks/data.py @@ -1029,11 +1029,7 @@ "'", "(", "*", - ",", - ".", "/", - ":", - ";", "?", "@", "[", diff --git a/weblate/checks/tests/test_duplicate_checks.py b/weblate/checks/tests/test_duplicate_checks.py index 2d8f27043369..24fcd1eca1bb 100644 --- a/weblate/checks/tests/test_duplicate_checks.py +++ b/weblate/checks/tests/test_duplicate_checks.py @@ -115,3 +115,12 @@ def test_duplicated_punctuation(self): MockUnit(source="comments (``#`` characters)"), ) ) + + def test_duplicated_sentence(self): + self.assertFalse( + self.check.check_single( + "", + "Sobald diese Anfrage angenommen wird, wird der Chat als zu löschen markiert", + MockUnit(), + ) + )