- return text.replace('\mathcal', '').replace('{', '').replace('}', '').replace('\\', '').replace('~', ' ').replace('--', '–')
+
+ # Replace text
+ subst = {
+ '\\"a': 'ä',
+ '\\"o': 'ö',
+ '\\"u': 'u',
+ '\mathcal': '',
+ '{': '',
+ '}': '',
+ '\\': '',
+ '~': ' ',
+ '---': '–',
+ '--': '–',
+ }
+
+ for a, b in subst.items():
+ text = text.replace(a, b)
+
+ return text