Pig Latin Instructions - Rule 3 vs 'Liquid'

The input word ‘liquid’ seems to expect output processed by rule 2. when we weigh the word against rule 2 and rule 3, it leans more with rule 3 than rule 2., because rule 3 is narrower.

if rule 3 read zero or one consonant instead of zero or more consonants, then the word liquid shall follow rule 2.

but, with the current instruction wording., ‘tranquil’ will fall under rule 3 too but the test cases will expect rule 2 processed output.

When in doubt, trust the tests to reveal the correct/actual requirements :slightly_smiling_face:

Do the instructions say that rules have a certain order of precedence to them? If not, trust the tests to guide your implementation. Exercism relies heavily on test driven development (TDD). With TDD the tests embody the requirements.

Rule 3
If a word starts with zero or more consonants followed by "qu"

In both ‘liquid’ and ‘tranquil’, a vowel appears earlier than "qu", so rule 3 isn’t applicable.

  • vowels: the letters a, e, i, o, and u
  • consonants: the other 21 letters of the English alphabet

It is true that vowels appear before “qu” in both words, but rule 1 only applies if the word begins with a vowel which is false with these words.

I think what keiraville is saying is that rule 2 applies because in the word “liquid”:

  1. The first letter is “l”, a consonant
  2. The second letter is “i”, a vowel

Only rule 2 can apply here because there is a consonant (“l”) and then a vowel (“i”).

Rule 3 doesn’t apply here because there is a vowel (“i”) between the first letter (“l”) and the “qu” (i.e. it doesn’t meet the starts with zero or more consonsants followed by “qu” part of the rule).

Since this is a discussion about the rules of Pig Latin and not about the Python implementation of this exercise, I am moving this out of the Python category, and into the Problem Specs category.

1 Like