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
e
depends on the capitalization of the surrounding letters after replacement. You should write it ase
unless 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 – 2017-11-29T00:44:59.393
1
I feel like this is highly related. Seems to be kinda sorta the opposite challenge.
– Carcigenicate – 2017-11-29T02:41:05.7831Related – Shaggy – 2017-11-29T11:13:05.753
That one reminded me of https://geekandpoke.typepad.com/geekandpoke/2011/08/coders-love-unicode.html ;-)
– Marco13 – 2019-07-20T22:38:22.643I 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 – 2019-07-21T14:53:53.150