| author | Alan Dipert
<alan@dipert.org> 2025-12-04 04:14:49 UTC |
| committer | Alan Dipert
<alan@dipert.org> 2025-12-04 04:14:49 UTC |
| parent | 1d1636eb800ee7bc39e5ccd5024d23bceb44a233 |
| test_generator.py | +5 | -0 |
diff --git a/test_generator.py b/test_generator.py index 1e94f3c..9e19dbc 100644 --- a/test_generator.py +++ b/test_generator.py @@ -99,15 +99,20 @@ def question_valid(q: Question, spec: LanguageSpec) -> bool: if sum(opt.is_correct for opt in q.options) != 1: return False meanings = [] + glosses = [] correct_meaning = None for opt in q.options: m = to_meaning(opt.features) + g = english_gloss(opt.features) if opt.is_correct: correct_meaning = m for existing in meanings: if meanings_equal(m, existing): return False + if g in glosses: + return False meanings.append(m) + glosses.append(g) if not is_grammatical(asdict(opt), spec): return False if correct_meaning is None: