mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-01-10 11:19:25 +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:
|
if len(text) > max_chars:
|
||||||
return f'too long text, max {max_chars}', 400
|
return f'too long text, max {max_chars}', 400
|
||||||
text = text.lower()
|
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)
|
text = re.sub(r'[^a-z!? ]', "", text)
|
||||||
if len(text) == 0:
|
if len(text) == 0:
|
||||||
return 'No valid characters found.', 400
|
return 'No valid characters found.', 400
|
||||||
|
|||||||
Reference in New Issue
Block a user