only collapse cloze in type answer if single unique phrase

This commit is contained in:
Damien Elmes 2014-03-28 07:25:27 +09:00
parent 9f6b073def
commit 7dc26ed31d

View File

@ -434,17 +434,11 @@ Please run Tools>Empty Cards""")
return txt.split("::")[0]
return txt
matches = [noHint(txt) for txt in matches]
if len(matches) > 1:
arr = []
seen = {}
for m in matches:
if m in seen:
continue
seen[m] = 1
arr.append(m)
txt = ", ".join(arr)
else:
uniqMatches = set(matches)
if len(uniqMatches) == 1:
txt = matches[0]
else:
txt = ", ".join(matches)
return txt
def tokenizeComparison(self, given, correct):