This is a simple problem in translation (or cryptography, depending on your point of view).|
For those of you who aren't familiar with Pig Latin, it's a cute little way to rearrange words
so that others don't know what you are saying (unless they know the rearranging "trick").
The algorithm for rearranging the word is simple. If the first letter is a vowel (i.e. a letter from the set [aeiouy], (y,
for simplicity's sake, is treated like a vowel)), then you stick the letters "way" on the end of the word - that's it.
Otherwise, if the first letter of the word is a consonant, then it's a little more complicated. First you append a hyphen
to the word. Then you remove the longest initial sequence of non-vowel letters from the front of the word and stick them on
the end (after the hyphen). Then you stick the letters "ay" on the end (after the consonants).
For example: "Pig" becomes "ig-Pay" and "Latin" becomes "atin-Lay". The sentence "Do you speak Pig Latin?" becomes "o-Day
youway eak-spay ig-Pay atin-Lay?". The sentence "I am the very model of a modern Major General" becomes "Iway amway e-thay
ery-vay odel-may ofway away odern-may ajor-May eneral-Gay" (now aren't you glad that Gilbert and Sullivan did not write
operas in Pig Latin?)
Note that this algorithm always produces a (translated Pig Latin) word that starts with a vowel.
a static null terminated string (consisting of a single English word) located at address WORD.
WORD: .db "pig",0
A null terminated string located at address TEMP.
TEMP = TEXT_MEM ; should be "ig-pay",0
You may assume that any words passed to your functions will be null-terminated and consist of any characters A-Z and a-z.
The string stored at TEMP should be exactly the size necessary to hold the normal or translated word (as appropriate) and
its null terminator. In other words the string stored at TEMP will be larger than the string stored at WORD. Also note that
modification of the original string is allowed.|
Note that the letter "Y" will be considered a vowel. So...
RHYTHM => YTHM-RHAY