Vowels rhyme: Apples and Bananas
There is a traditional children's song that repeats the same text over and over, only each time every vowel is replaced with a random vowel, but constant across the current stanza.
Challenge
The objective is to propose the shortest code that performs such a transformation on an input text.
Rules
- You must print the rhyme as many times as there are distinct vowels in it.
- Each print must be separated with a line break (platform-specific combo of
\n
and\r
is accepted). - For iteration
i
, replace each vowel with thei
th distinct vowel in the original text. - The input text is a sequence of printable ASCII characters (range
[32, 126]
. - Input will not contain embedded line breaks.
- Only vowels characters must be affected, other must be output exactly as input.
- Only vowels characters count: nasal vowels, although sounding like vowels (like in French "Tintin"), must not be handled as a single vowel.
- Case matters for the output, but is positional (replacing an uppercase vowel is done with the uppercase replacement vowel)
- Uppercase vowels are not distinct from their lowercase counterpart (ie
a
<=>A
) - Consecutive vowels are always considered separately (ie.
Boat
yields bothBoot
andBaat
) - Since the letter
y
represents either a vowel or consonant soun (as we're speaking English), handling it as a vowel or a consonant is allowed, however answers must explicitly state whether they handley
as a vowel or not.
Examples:
Hello world
Hello world!
gives:
Helle werld!
Hollo world!
Excerpt from the original French text (translated), with y
handled as a vowel:
An elephant that was rambling all gently in the woods...
gives:
An alaphant that was ramblang all gantla an tha waads...
En elephent thet wes rembleng ell gentle en the weeds...
In iliphint thit wis rimbling ill gintli in thi wiids...
Yn ylyphynt thyt wys rymblyng yll gyntly yn thy wyyds...
On olophont thot wos romblong oll gontlo on tho woods...
Note the behaviour on leading uppercase vowel: case is kept at its index (rules 8 and 9).
Vowelless example
Input that does not contain any vowel, like:
lgn@hst:~$ rm -rf ./* ~ /
must produce no output, or a single line break.
Single-vowel input
Input containing a single vowel is output as is.
Dad sat at a car and saw a fat bat.
gives:
Dad sat at a car and saw a fat bat.
This is code-golf, so fewest bytecount code wins (nothing but eternal PPCG glory)!