A Translator that converts English to Pig Latin built with Python
- If the word begins with a consonant, all letters before the first vowel are placed at the end of the word and "ay" is added
- "pig" = "igpay"
- "happy" = "appyhay"
- "smile" = "ilesmay"
- "trash" = "ashtray"
- If the word begins with a vowel, "way" is added
- "eat" = "eatway"
- "egg" = "eggway"
- If the letter "y" comes at the end of a consonant cluster, it should be treated like a vowel
- "rhythm" = "ythmrhay"
- Reference
- Y is considered to be a vowel if
- There is no other vowel (ex. gym, my)
- The letter is at the end of a word or syllable (ex. candy, deny, bicycle, acrylic)
- The letter is in the middle of a syllable (ex. system, borborygmus)
- Python 2.7
# Clone this repository
$ git clone https://github.com/danakim21/pig-latin-translator.git
# Go into the repository
$ cd pig-latin-translator
# Open Python
$ python
# Import to_pig_latin function
>>> from main import to_pig_latin
# Use the translator
>>> to_pig_latin("pig")
'igpay'
>>> to_pig_latin("pig happy smile")
'igpay appyhay ilesmay'
List of features ready
- Converts any word or sentences to Pig Latin
To Do
- Converting back to English from Pig Latin
- Build GUI for better usage
Project is: temporarily finished, will be updated for further development.
Created by @danakim21 - feel free to contact me!