fix: don't include duplicate lemmas in match activity token set (#4498)
This commit is contained in:
parent
ccf5cb798d
commit
7d5e84b7be
1 changed files with 6 additions and 1 deletions
|
|
@ -162,8 +162,11 @@ class PracticeSelection {
|
|||
|
||||
//remove duplicates
|
||||
final seenTexts = <String>{};
|
||||
final seemLemmas = <String>{};
|
||||
tokens.retainWhere(
|
||||
(token) => seenTexts.add(token.text.content.toLowerCase()),
|
||||
(token) =>
|
||||
seenTexts.add(token.text.content.toLowerCase()) &&
|
||||
seemLemmas.add(token.lemma.text.toLowerCase()),
|
||||
);
|
||||
|
||||
if (tokens.length > 8) {
|
||||
|
|
@ -184,6 +187,8 @@ class PracticeSelection {
|
|||
activityTokens.add(t);
|
||||
}
|
||||
|
||||
debugPrint("TOKENS: ${activityTokens.map((e) => e.text.content).toList()}");
|
||||
|
||||
return [
|
||||
PracticeTarget(
|
||||
activityType: activityType,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue