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

Anagram test data #413

Closed
fredrb opened this issue Oct 18, 2016 · 4 comments
Closed

Anagram test data #413

fredrb opened this issue Oct 18, 2016 · 4 comments

Comments

@fredrb
Copy link
Contributor

fredrb commented Oct 18, 2016

https://github.com/exercism/x-common/blob/master/exercises/anagram/canonical-data.json#L106

Is this really a valid anagram?

"candidates": ["ΒΓΑ", "ΒΓΔ", "γβα"],
"expected": ["ΒΓΑ", "γβα"]

Is seems to me that "γβα" should not be considered a valid anagram of "ΑΒΓ".
Also, this test failed when ruby generator was implemented exercism/ruby#464.

Thanks!

@petertseng
Copy link
Member

Seems correct, if it should be the case (as in earlier tests) that anagrams are case insensitive. "ΑΒΓ" lowercased is indeed "αβγ", which is a rearrangement of the "γβα"

@rbasso
Copy link
Contributor

rbasso commented Oct 18, 2016

Technically, I think it is an anagram, @fredb; because - surprisingly - it seems that βγα is ΒΓΑ lowercased (edit: as pointed out by @petertseng).

That said, I don't think we should test extreme cases like this one, as it is not an essential part of the problem to deal with obscure case conversions.

@NobbZ
Copy link
Member

NobbZ commented Oct 18, 2016

I do not think, that we should test for anything that is not in ASCII.

  1. Most languages do not cope very well with codepoints beyond ASCII
  2. There are letters beyond ASCII, that would need another step of normalization. Eg the german "es-zett" (ß) which is is only allowed as lowercase (but there is a capital version available which is allowed to be used on titlepages and headlines), on capitalisation it is usually turned into "SS". There has been the long-s, and similar characters in ancient greek (gamma was one of them AFAIK).

So we wozuld need to think about that characters before allowing them blindly.

@Insti
Copy link
Contributor

Insti commented Oct 18, 2016

I do not think, that we should test for anything that is not in ASCII.

I agree with this. Handling non-ASCII casing is a whole other problem.
👍 for removing this particular test case from the canonical-data

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

No branches or pull requests

5 participants