Problem 519. Pig Latin to English Translator
Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the Wikipedia entry for Pig Latin):
1. In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and "ay" is added, as in the following examples:
* happy → appy-hay * question → estion-quay
2. In words that begin with vowels, the syllable "ay" is simply added to the end of the word.
* another → another-ay * about → about-ay
A hyphen is sometimes used to facilitate translation back into English. Ayspray, for instance, is ambiguous, but ay-spray means "spray" whereas ays-pray means "prays."
Given a string in Pig Latin (may be multiple words), produce the English version.
Solution Stats
Problem Comments
-
1 Comment
The test suite has been rearranged to make it easier to understand what is being asked for.
Solution Comments
Show commentsProblem Recent Solvers154
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
49399 Solvers
-
11242 Solvers
-
Number of 1s in a binary string
9126 Solvers
-
Natural numbers in string form
1433 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
972 Solvers
More from this Author56
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!