+ perform_judging() {
+ const word_map = {};
+
+ for (let a of this.answers) {
+ for (let word of a.answers) {
+ const key = this.canonize(word);
+ word_map[key] = word;
+ }
+ }
+
+ this.state.ambiguities = Object.values(word_map);
+
+ this.broadcast_event_object('ambiguities', this.state.ambiguities);
+ }
+
+ receive_judging() {
+ /* And notify players how many players have completed judging. */
+ this.state.players_judged++;
+ this.broadcast_event_object('judged', this.state.players_judged);
+
+ return { valid: true };
+ }
+
+ canonize(word) {
+ return word.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
+ }
+