I heva this wierd text where vewols seem to be ratetod :
I'm a badly written text. Some lunatic guy played with the order of vowels. Please fix me !
So I'd need a pragrom which can rateto the vewols (and the 'y' letter as it seems) back so that the text is raadeble agian.
Ouy can choeso the lungaega of ouyr chieco privedod ouy meka a cempleto pragrom (so not just a finctoun). The yntre can be an unpit feild, a text feli, or the cammond leni. The uutpot mya olsa vyra as ouy leki.
Of cuerso I'll anvilid yna pragrom uutpitong bad texts. There's no vulea in a pragrom which mekas texts ouy can't endarstund. But ouy can wreti ouyr cemmonts and qeistouns in ratetod texts if ouy want.
Clarifications
- Your program is only required to handle ASCII text.
- For the purposes of this question, the following characters are vowels:
aeiouy
- The positions of the vowels within each word should be rotated. There is some flexibility in deciding what qualifies as a word: the minimum requirement is that two characters separated by a space are in different words, and that two alphabetic characters (
a-zA-Z
) separated only by alphabetic characters are in the same word. - The desired direction of rotation should be inferred from the test cases below.
Test cases
Input: I'm a badly written text. Some lunatic guy played with the order of vowels. Please fix me !
Output: I'm a bydla wrettin text. Semo lanituc gyu plyead with the erdor of vewols. Plaese fix me !
Input: AeiOuy
Output: EioUya
Input: Hyphenated-word
Output: Hephanetyd-word
or Hephanetod-wyrd
aeiouAEIOU
in ASCII / Basic Latin; those code-points plus any others in Basic Latin and Latin-1 Supplement which have those basic characters combined with a diacritic), the question should be explicit. \$\endgroup\$