A Pig Latin translator coded in Python
Pig Latin alters English words by adding a suffix according to the beginning character/characters of the word.
For words starting with a vowel, add 'yay' to the end of the word. For eg. the word and becomes andyay.
For words starting with a consonant or a consonant cluster, the consosnant or consonant cluster is moved to the end of the word and 'ay' is added. For eg. the word simple becomes implesay and the word crows becomes owscray.
Y is considered as a vowel if it's part of a consonant cluster. For eg. the word rhythm becomes ythmrhay but the word yellow is ellowyay
- Retains the punctuation of the word.
- Capitalises the beginning of sentence.
- Can handle upper case and lower case words.
- Retains capitalisation of fully capital words (eg. CAPITAL becomes APITALCAY) or words starting with a capital vowel (eg. And becomes Andyay).