From c11ddd84abec5f82edfdbc37302e7c8099c7d30e Mon Sep 17 00:00:00 2001 From: Sheldan <5037282+Sheldan@users.noreply.github.com> Date: Sat, 24 Feb 2024 10:41:03 +0100 Subject: [PATCH] =?UTF-8?q?[AB-xxx]=20adding=20character=20replacement=20t?= =?UTF-8?q?o=20amongus=20text=20for=20=C3=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/components/image-gen/python/endpoints/amongus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/components/image-gen/python/endpoints/amongus.py b/python/components/image-gen/python/endpoints/amongus.py index 83667a7f4..03382b2c1 100644 --- a/python/components/image-gen/python/endpoints/amongus.py +++ b/python/components/image-gen/python/endpoints/amongus.py @@ -29,7 +29,7 @@ def generate_amongus_text(): if len(text) > max_chars: return f'too long text, max {max_chars}', 400 text = text.lower() - text = text.replace('ö', 'oe').replace('ä', 'ae').replace('ü', 'ue') # "fixing" umlauts + text = text.replace('ö', 'oe').replace('ä', 'ae').replace('ü', 'ue').replace('ß', 'ss') # "fixing" umlauts and other replaceable characters text = re.sub(r'[^a-z!? ]', "", text) if len(text) == 0: return 'No valid characters found.', 400