mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-01-01 15:28:35 +00:00
[AB-xxx] adding character replacement to amongus text for ß
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user