I'm currently scanning a bunch of handwritten documents and converting them to .txt
files. Since I have a terrible handwriting the .jpg
->.txt
converter converts some of my umlauts to the "normal" letter encased by '
Task
Write a program or a function that:
- Is given a string
- you can choose any I/O codepage as long as
- it supports the characters
AEIOUaeiouÄËÏÖÜäëïöü'
.- combining diacriticals are prohibited
- the Input and Output codepages are the same.
- it supports the characters
- the input will (beside spaces) only contain printable characters from your codepage.
- There will only be one solution, thus things like
'a'e'
won't appear
- There will only be one solution, thus things like
- you can choose any I/O codepage as long as
- Converts all characters in the following set
AEIOUaeiou
toÄËÏÖÜäëïöü
- If, and only if, they are surrounded by
'
characters:- Example:
'a''e' -> äë
- Example:
- If the from string is a single letter.
- for example
'AE'
does not change at all, outputting as-is.
- for example
- If the from character is not a character out of
AEIOUaeiou
that character won't change.
- If, and only if, they are surrounded by
Note: The from character / from string is the one between '
.
Testcases
Input
Output
<empty line>
'A'sthetik
Ästhetik
Meinung ist wichtig!
Meinung ist wichtig!
Ich sagte: "Er sagte: 'Ich habe Hunger'"
Ich sagte: "Er sagte: 'Ich habe Hunger'"
Ich sagte: "Er sagte: ''A'sthetik'"
Ich sagte: "Er sagte: 'Ästhetik'"
Hämisch rieb er sich die H'a'nde
Hämisch rieb er sich die Hände
H'a''a'slich isn't a German word
Hääslich isn't a German word
since it's really called h'a'sslich
since it's really called hässlich
'A'
or'a'
... not what I consider good testcases. \$\endgroup\$'w'
(asw
is not one ofAEIOUaeiou
)? \$\endgroup\$'q'e'd'
\$\endgroup\$