From: Carl Worth Date: Thu, 11 Jun 2020 22:23:32 +0000 (-0700) Subject: Don't throw out punctuation when "canonizing" words X-Git-Url: https://git.cworth.org/git?p=lmno-server;a=commitdiff_plain;h=5263d08448482739a022a81431214d99ce435322 Don't throw out punctuation when "canonizing" words This caused a pretty disastrous failure of the game when the team chose "Programming languages"; people submitted C, C++, and C#; and the word list they were presented for voting had only C# in it. --- diff --git a/empathy.js b/empathy.js index 3a3f80d..cb69148 100644 --- a/empathy.js +++ b/empathy.js @@ -145,7 +145,7 @@ class Empathy extends Game { } canonize(word) { - return word.replace(/[^a-zA-Z0-9]/g, '').toLowerCase(); + return word.toLowerCase(); } compute_scores() {