]> git.cworth.org Git - lmno-server/commitdiff
Don't throw out punctuation when "canonizing" words
authorCarl Worth <cworth@cworth.org>
Thu, 11 Jun 2020 22:23:32 +0000 (15:23 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 11 Jun 2020 22:23:32 +0000 (15:23 -0700)
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.

empathy.js

index 3a3f80de007e6eab8a0b855a8a4f908d6b834d45..cb691485c0e928ccef8ae4cf9ac0e478877a74ce 100644 (file)
@@ -145,7 +145,7 @@ class Empathy extends Game {
   }
 
   canonize(word) {
-    return word.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
+    return word.toLowerCase();
   }
 
   compute_scores() {