In this challenge, you must take a string matching the regex
^[a-zA-Z]+$ or whatever is reasonable (you don't have to consider uppercase or lowercase letters if you want) (you may assume the string is long enough, and has the right structure for all the operations), and output another string, produced similarly to word at the end of a recent dadaist tweet by the POTUS (
"Despite the constant negative press covfefe").
How to covfefify a string:
First, get the first sound group (made up terminology).
How do you do this? Well:
Find the first vowel (
yis also a vowel)
Find the first consonant after that
Remove the rest of the string
That is your first sound group.
Get the last consonant of the sound group
and replace it with the voiced or voiceless version. To do this, find the letter in this table. Replace with the letter given (which may be the same letter)
b: p c: g d: t f: v g: k h: h j: j k: g l: l m: m n: n p: b q: q r: r s: z t: d v: f w: w x: x z: s
so, we get
Then, take the next vowel after that consonant. You can assume that this consonant is not at the end of the string. Join these two together, then repeat it twice:
Concatenate this to the first sound group:
You're done: the string is covfefified, and you can now output it.
coverage: covfefe example: exxaxa programming: progkaka (the a is the first vowel after the g, even though it is not immediately after) code: codtete president: preszizi
This is code-golf, so please make your program as short as possible!