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

CJam, 59 58 57 bytes

q_{"aeiouy":V&,_T|:T^}#)/()@sV&0=1$\+"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)
)/                   e# Increment the index and split the string into chunks of that size.
(                    e# Pull out the first chunk.
)                    e# Pull out the last character of that string (the consonant).
@s                   e# Bring all the other split chunks to the top and join them together.
V&0=                 e# First char of the set intersection of that and the vowels.
                     e# (i.e. the first vowel in the second half)
1$+                  e# Concatenate the consonant and the vowel.
"cbdfkszgvtpg"_W%er  e# Transliterate the consonant to voiced/voiceless alternative.
_                    e# Duplicate the result of that.
                     e# Implicit output of stack contents.
Business Cat
  • 9.2k
  • 1
  • 17
  • 37