Browse Source

feat: allow a space between the candidate letter and the grade

master
Dominique Merle 2 years ago
parent
commit
8bff345d16
  1. 7
      addons/majority_judgment/providers/MajorityJudgmentChatCommandJudgmentsProvider.gd

7
addons/majority_judgment/providers/MajorityJudgmentChatCommandJudgmentsProvider.gd

@ -31,11 +31,14 @@ class_name MajorityJudgmentChatCommandJudgmentsProvider
#
# A0 B2 c0 D1
#
# We would like to get word grades, because numbers, although handy,
# create a bias. They don't mean the same thing to everyone.
# See https://git.mieuxvoter.fr/MieuxVoter/majority-judgment-for-streamers/issues/12
#
func process_chat_command(author_identifier:String, chat_command:String):
var regex = RegEx.new()
regex.compile("(?<candidate>[a-zA-Z]{1})(?<grade>[0-9]{1})")
regex.compile("(?<candidate>[a-zA-Z]{2})[ ]*(?<grade>[0-9]{2})")
var results = regex.search_all(chat_command)
if results:

Loading…
Cancel
Save