Module talk:palindromes/testcases

I think I'm setting up these tests wrong... what's going on here? DTLHS (talk) 01:56, 26 August 2016 (UTC)
 * I don't know what's going on with the error, but everything else works now. I'm not sure if we actually need a separate module for just this one function though. It could just be put into Module:headword. —CodeCat 02:13, 26 August 2016 (UTC)
 * It makes it easier to test if it's here (we could use more testcases from other languages) DTLHS (talk) 02:16, 26 August 2016 (UTC)

Hebrew, Greek, and other considerations
There are several alphabetical characteristics that should be ignored per language: Is there a good way to account for this? We can write per language palindrome conversion functions, but we'd have to put them somewhere. — JohnC5 02:40, 26 August 2016 (UTC)
 * 1) Hebrew final characters are considered the same as their initial and medial variants.
 * 2) Ancient Greek final sigma and diacritics are not considered.
 * I don't see what's wrong with putting them with the rest of the code. We will have to have a language parameter though. DTLHS (talk) 02:43, 26 August 2016 (UTC)
 * Or, make a data subpage with a conversion table for each language that needs special consideration. DTLHS (talk) 02:46, 26 August 2016 (UTC)
 * Do you mean to put them with the rest of the palindrome code, in the, in separate modules , or some other layout? — JohnC5 02:49, 26 August 2016 (UTC)
 * How about a specialized local function for each language or script that can do whatever it pleases to the text (in case a conversion table may not be sufficient)? —suzukaze (t・c) 02:54, 26 August 2016 (UTC)
 * Similar to the  field in the languages module? I'm just trying to zero in on the exact implementation. — JohnC5 03:00, 26 August 2016 (UTC)
 * It depends whether the rules can be described with a simple table like the entry_name parameter in the languages module. DTLHS (talk) 03:01, 26 August 2016 (UTC)
 * A table should work for Ancient Greek and Hebrew, as far as I can tell (indeed the  and   tables in Module:grc-accent would be correct if we added sigma logic). I can't speak to other languages though. — JohnC5 03:08, 26 August 2016 (UTC)
 * I made a data table in the module- if it gets too big we can move it to a separate data subpage. If you add the rules I will try to figure out how to make use of them. DTLHS (talk) 03:18, 26 August 2016 (UTC)
 * I've added some logic for Ancient Greek and Hebrew, though someone who knows more about Hebrew than I should test it. — JohnC5 04:46, 26 August 2016 (UTC)

English edge cases
Should these be considered palindromes: 4-6-6-4, 404, 4x4, B2B, d00d, R&R ? DTLHS (talk) 14:03, 27 August 2016 (UTC)


 * According to our definition of palindrome, yes. I'm not personally sure how worthwhile the ones with non-alphanumerics are, e.g. R&R. I also think it would be silly to include single characters (a, 1, etc.), because these are trivial and quite meaningless &mdash; akin to how (in some sense) any string is an anagram of itself. Equinox ◑ 14:06, 27 August 2016 (UTC)


 * I think I'm fine with these. I don't know what to say about R&R, since if we remove the ampersand, which might be considered punctuation, this would be considered a repeated letter. — JohnC5 16:28, 27 August 2016 (UTC)


 * The only strings containing ampersands that I can find referred to as palindromes in literature are ones that contain the ampersand in the same place when reading from either direction: "Lewd did I live & evil I did dwel", "Snug & raw was I ere I saw war & guns". This matches what I would expect: I wouldn't expect e.g. "foobar rab & oof" to be a palindrome. So, AFAICT ampersands are not punctuation (in this context) but letters like ψ. - -sche (discuss) 16:44, 27 August 2016 (UTC)