Skip to main content
2 of 4
added 8 characters in body
Business Cat
  • 9.2k
  • 1
  • 17
  • 37

CJam, 59 58 bytes

q_{"aeiouy":V&,_T|:T^}#_)W$<@@>(\V&0=+"cbdfkszgvtpg"_W%er_

Try it online!

Explanation

q_                   e# Read the input and copy it.
{                    e# Find the index of the first char for which the following is true:
 "aeiouy":V          e#  Push "aeiouy" and store it in V.
 &,                  e#  Check if the current char is in the vowel string (0 or 1).
 _T|:T               e#  Copy the result and OR with T (T is initially 0), storing back in T.
 ^                   e#  XOR with the original result. This will be 1 for the first 
                     e#  consonant appearing after a vowel.
}#                   e# (end find)
_)W$<@@>             e# Slice the string before (index)+1 and after (index).
(                    e# Pull out the first character from the second half (a consonant).
\V&0=                e# First char of the set intersection of the second half and the vowels.
                     e# (i.e. the first vowel in the second half)
+                    e# Concatenate the consonant and vowel.
"cbdfkszgvtpg"_W%er  e# Transliterate the consonants to voiced/voiceless alternative.
_                    e# Duplicate the result of that.
                     e# Implicit output of stack contents.
Business Cat
  • 9.2k
  • 1
  • 17
  • 37