0
1
Introduction
As you all know, German has umlauts. They're these things: ¨
However, most keyboards don't have an umlaut key. That's fine, though, because you can write ö, ä, and ü as oe, ae, and ue.
Challenge
- Your job is to to replace
ö,ä, andüwithoe,ae, andue(and likewise for their capital versions). - You have to deal with both the combining diacritical mark and single characters. (Thank you @ETHProductions for pointing this out.)
- Capitalization of the base letter stays intact.
- Capitalization of the
edepends on the capitalization of the surrounding letters after replacement. You should write it aseunless it's adjacent to a capital letter on both sides, in which case write it asE. (End of line and space are not capital letters.) - Standard loopholes and I/O rules apply.
- This is code-golf, so shortest code in UTF-8 bytes wins!
Example Input and Output
Test cases using precomposed characters
ü = ue
üb = ueb
üB = ueB
Ü = Ue
Üb = Ueb
ÜB = UEB
Test cases using combining diacritics
ö = oe
öb = oeb
öB = oeB
Ö = Oe
Öb = Oeb
ÖB = OEB
1Inverse. – Adám – 8 years ago
1
I feel like this is highly related. Seems to be kinda sorta the opposite challenge.
– Carcigenicate – 8 years ago1Related – Shaggy – 8 years ago
That one reminded me of https://geekandpoke.typepad.com/geekandpoke/2011/08/coders-love-unicode.html ;-)
– Marco13 – 6 years agoI don't understand if the challenge is about replacing a single word or entire text blocks, ie whether to deal with word separation. – Ingo Bürk – 6 years ago