Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pig-latin: clarify instructions #2447

Merged
merged 2 commits into from
May 24, 2024
Merged

pig-latin: clarify instructions #2447

merged 2 commits into from
May 24, 2024

Conversation

ErikSchierboom
Copy link
Member

Preparing for this exercise's #48in24 video, I've found that many people misread the instructions and hard-coded the mentioned examples. This is in large part due to the instructions being quite unclear.

@ErikSchierboom ErikSchierboom requested a review from a team as a code owner May 24, 2024 12:29
- vowels: the letters `a`, `e`, `i`, `o`, and `u`
- consonants: the other 21 letters of the English alphabet
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this little bit to help non-native English speakers with the terminology.

Comment on lines 27 to 28
- `"pig"` -> `"igp"` -> `"igpay"` (starts with single consonant)
- `"chair"` -> `"airch"` -> `"airchay"` (starts with multiple consonants)
- `"thrush"` -> -> `"ushthr"` `"ushthray"` (starts with multiple consonants)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the intermediate step for extra clarity.

@@ -1,10 +1,48 @@
# Instructions

Your task is to translate text from English to Pig Latin using the following rules:

- **Rule 1**: If a word begins with a vowel sound, add an "ay" sound to the end of the word (e.g. "apple" -> "appleay").
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gotten rid of the "sound" references, which made it confusing to me.

- **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").
Consonant sounds can be made up of multiple consonants, such as the "ch" in "chair" or "st" in "stand" (e.g. "chair" -> "airchay").
- **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").
- **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").
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gotten rid of the "cluster" mention, which was confusing.

@ErikSchierboom ErikSchierboom force-pushed the pig-latin-clarify branch 2 times, most recently from 59061da to 79337bc Compare May 24, 2024 12:33
Copy link
Contributor

@glennj glennj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good.

@MatthijsBlom
Copy link
Contributor

The new instructions are inconsistent with the old ones.

The old instructions had the same rule apply to both yeet and union, but the new instructions treat them differently.

exercises/pig-latin/instructions.md Outdated Show resolved Hide resolved
Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
@BethanyG
Copy link
Member

The new instructions are inconsistent with the old ones.

The old instructions had the same rule apply to both yeet and union, but the new instructions treat them differently.

Do you mean the old rules treated the y as a vowel? Maybe we should single out y as "special handling". I know that in many pig latin versions, y is ambiguous. Something like:

  • vowels: the letters a, e, i, o, and u
  • consonants: the other 20 letters of the English alphabet, except y
  • the letter y is a bit special, read the rules below for how to handle it

I think this is why we got into the "sounds" mess in the first place: the technical definition of vowel vs consonant is the mouth position when making the sound. pedantic reference.

Typically, y represents a consonant when it starts off a word or syllable, as in yard, lawyer, or beyond. Technically, this sound of \y\ is considered a semivowel or glide, which is a less prominent vowel speech sound that occurs in the articulation of two consecutive vowel sounds unequal in prominence. For example, there's a very brief long e sound when articulating \y\ in yes. Air flow is not impeded in sounding \y\ (if it was y would be a true consonant); however, the mouth is not opened as fully as in articulating the vowel \y\ in early. The result is a vowel-like consonant.

By that definition, the y in yeet is not a vowel, but a semi-vowel, which is considered a type of consonant. So I think we might want to add in yeet, yard, and possibly beyond as a specific examples showing how y is special/not special in that circumstance.

Copy link
Member

@BethanyG BethanyG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a really good re-write, and helps focus on specific patterns and actions in code, rather than the convolutions of English. 😄

@ErikSchierboom ErikSchierboom merged commit b72036c into main May 24, 2024
7 checks passed
@ErikSchierboom ErikSchierboom deleted the pig-latin-clarify branch May 24, 2024 18:17
@MatthijsBlom
Copy link
Contributor

Do you mean the old rules treated the y as a vowel?

No, I did not mean that, and the old rules didn't necessarily do that.

Old rules excerpt:

  • Rule 1: If a word begins with a vowel sound, [...]
  • Rule 2: If a word begins with a consonant sound, [...]

yeet and union start with the same sound.
The old rules were unclear on whether this sound was to be considered a 'vowel sound' or a 'consonant sound'.
In any case however, yeet and union would have the same rule applied to both.

The new rules declare u to be a 'vowel' letter and y a 'consonant' letter, and therefore have different rules apply to yeet and union.

Note that the above observation is independent of whatever 'vowel' and 'consonant' are supposed to mean in any context other than this exercise. You could swap out the terms for 'X' and 'Y' or whatever and it would still work. The opinions of linguists are largely irrelevant.

@BethanyG
Copy link
Member

BethanyG commented May 25, 2024

yeet and union start with the same sound.

....

The opinions of linguists are largely irrelevant.

Hence the problem with defining things by "sound", necessitating the re-write. Much better to clarify based on category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants