Also please donât prepare pull requests to the problem-specifications repo until we have a consensus among track maintainers participating in this thread that a PR is warranted. You wonât be expected to sync any problem-specifications changes to the 80+ Exercism tracks because thatâs the responsibility of the track maintainers, and they can choose when and how they want to implement any upstream changes.
That is right, canonical data have inputs starting with vowels, but only as separate words. This is why Examplar.fs manages to handle them while being incorrect.
Iâm against the first test in its current form, and Iâm unconvinced that we need to complicate this exercise with whitespace formatting.
For the first test, the existing test "quick fast run" already proves that a studentâs solution can translate a phrase, not just a single word. Therefore, itâs earned its place even though the individual words are covered by previous rules. Adding "quick afternoon run" alongside that test needs to supplement that test, but itâs not adding much. Iâd be more favorable of a test that reimplements the existing phase and uses a single word from each rule instead. Currently, the existing phrase test only uses the three of the four rules.
For the second test, Pig Latin is about word translation, not whitespace behavior. Given that this behavior isnât previously defined in the instructions, " extraneous space " could just as equally be " extraneousay acespay " as "extraneousay acespay". Therefore Iâm against this test since it distracts from word translation, the focus of the exercise
BNAndras, I agree that whitespace test do not have much value on its own, but it is important to put hold on students that are trying to remedy the solution that does not process vowels correctly by split + apply wrong solution to each word separately + concat trick
Can we examine that assumption? Is it necessarily correct? Is the opposite just as easily correct? What makes one approach more correct than the other? âŚand how relevant is that to this exercise?
Space-preserving behaviour is what you expect based on the canonical solution.
But that canonical solution, as well as many studentâs solutions, breaks completely on phrases that contain words with vowels:
root@localhost:~# dotnet fsi
F# Interactive version 14.0.111.0 for F# 10.0
> #load "Example.fs";;
[Loading /root/Example.fs]
module FSI_0002.PigLatin
val vowelPattern: string
val consonantPattern: string
val vowelReplacement: string
val consonantReplacement: string
val translate: sentence: string -> string
> let t = PigLatin.translate;;
val t: (string -> string)
> t "quick fast run";;
val it: string = "ickquay astfay unray"
> t "quick afternoon run";;
val it: string = "quick afternoonay run"
> t " extraneous space ";;
val it: string = " extraneousay space "
Example solutions for practice exercises only prove that a test suite as currently written for a language can be solved for continuous integration purposes. I wouldnât read too much into what one particular example solution is doing as a result. Some maintainers do prefer polished and idiomatic example solutions, but thatâs in no way expected across the board as long as the test suite CI passes.
We could even add âquick afternoon runâ as reimplementantation of âquick fast runâ with explaination ââquick fast runâ does not test when words starting with consonants and words starting with vowels are mixed togetherâ
And then let maintainers decide. If they choose not to use reimplementantation, that is perfectly fine, but it is good to have options.
Would you mind explaining why it matters if a multi word solution has a middle word starting with a vowel? Most of the solutions Iâve seen split input into words and process each word. If they can handle the single word cases starting with vowels, the sentence version should behave the same. Iâm not understanding what this change would accomplish.
We could replace the "quick fast run" test case with "my quick afternoon xray scan"
This covers all four rules, including two forms of the first rule. It also includes a starting consonant pattern that is not detected by solutions that may have been written for older versions of the instructions.
Could you explain why that might happen? If words are split and translated, I donât see why middle words would be different than initial words. If middle words are not translated properly, why would words starting with a consonant be different from words starting with a vowel. You are stating they are different but Iâm not hearing a why.