Same token can be matched multiple times in stringMatchesReference
(for evaluating answers)
#132
Labels
bug
Something isn't working
website/server/scorer.js
Lines 428 to 450 in 12f2e68
When comparing
stringTokens
againstreferenceTokens
in Room.stringMatchesReference, we never remove the reference token that matches the string token. This means that the same reference token can match different string tokens. This will lead to inocrrect matches. For example, there will be a match when the reference string "Major Tom" is compared against the string "Major Major Major", even though they are different.There are a few ways to do this. One way to do it is to keep track of the last reference token we should use, and when we find a matching reference token, we swap it with the token at the last position and decrease the number of reference tokens we check against.
The text was updated successfully, but these errors were encountered: