|
1 | 1 | # Instructions
|
2 | 2 |
|
3 |
| -Implement a program that translates from English to Pig Latin. |
| 3 | +Your task is to translate text from English to Pig Latin using the following rules: |
4 | 4 |
|
5 |
| -Pig Latin is a made-up children's language that's intended to be confusing. |
6 |
| -It obeys a few simple rules (below), but when it's spoken quickly it's really difficult for non-children (and non-native speakers) to understand. |
7 |
| - |
8 |
| -- **Rule 1**: If a word begins with a vowel sound, add an "ay" sound to the end of the word. |
| 5 | +- **Rule 1**: If a word begins with a vowel sound, add an "ay" sound to the end of the word (e.g. "apple" -> "appleay"). |
9 | 6 | Please note that "xr" and "yt" at the beginning of a word make vowel sounds (e.g. "xray" -> "xrayay", "yttria" -> "yttriaay").
|
10 |
| -- **Rule 2**: If a word begins with a consonant sound, move it to the end of the word and then add an "ay" sound to the end of the word. |
| 7 | +- **Rule 2**: If a word begins with a consonant sound, move it to the end of the word and then add an "ay" sound to the end of the word (e.g. "pig" -> "igpay"). |
11 | 8 | Consonant sounds can be made up of multiple consonants, such as the "ch" in "chair" or "st" in "stand" (e.g. "chair" -> "airchay").
|
12 |
| -- **Rule 3**: If a word starts with a consonant sound followed by "qu", move it to the end of the word, and then add an "ay" sound to the end of the word (e.g. "square" -> "aresquay"). |
| 9 | +- **Rule 3**: If a word starts with a consonant sound followed by "qu", move them to the end of the word, and then add an "ay" sound to the end of the word (e.g. "square" -> "aresquay"). |
13 | 10 | - **Rule 4**: If a word contains a "y" after a consonant cluster or as the second letter in a two letter word it makes a vowel sound (e.g. "rhythm" -> "ythmrhay", "my" -> "ymay").
|
14 |
| - |
15 |
| -There are a few more rules for edge cases, and there are regional variants too. |
16 |
| -Check the tests for all the details. |
17 |
| - |
18 |
| -Read more about [Pig Latin on Wikipedia][pig-latin]. |
19 |
| - |
20 |
| -[pig-latin]: https://en.wikipedia.org/wiki/Pig_latin |
0 commit comments