ollehway umanshway! Pig latin is not a good language…
I’m working on a python program that runs pigpy and outputs the result. I’m not sure if I’m the first to make pigpy as a language, but it’s essentially python where each word is translated into pig latin.
The major flaw:
Now, you may think this program is simple enough since I just have to translate pig latin into english then run it through python, but there’s one major flaw.
English to pig latin translation is a many-to-one function: up to two English words can translate to the same pig latin word. E.g. ‘in’ and ‘win’ both translate to ‘inway’.
Because of this, there’s no way to tell if inway should translate back to in or way. Luckily, in most cases where pig latin translates to two possible words, only one of them makes sense, and is an actual word. Thus I can use this to my advantage when narrowing down possbile translations.
What I’ve made:
- Separation function that separates pigpy words from the symbols in the user-written code
- Translation function that translates each separate pigpy word into its possible English versions.
- Statement that checks possible translations against set of English words and python keywords. Invalid words are eliminated
- Error message and quitting if a pigpy word has no valid English translations (i.e. pigpy spelling is wrong)
- Function that calculates how many possible full translation combinations there are based on the remaining valid English translation possibilities
##The screenshot:
The screenshot shows the output of separating and finding translations for a pigpy program before adding the dictionary. After adding the dictionary, the totalPossibilities (for the full translation) reduced by 508 to just 4!
What’s next?
Next is to test each translation combination by running them through python. Hopefully all but one combination are eliminated, and therefore the correct output can be given to the user.
Comments 1
I wrote the first bit wrong oops! It should be ellohay umanshay. Pig latin is so bad that even I can’t write it correctly lol!
Sign in to join the conversation.