fix(lemma_meaning_activity_generator): filter out empty strings as eligible distractors (#2004)

* filter out empty strings as elible distractors

* generated

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Wilson 2025-02-28 13:18:36 -05:00 committed by GitHub
parent 5b99c935a8
commit 90faab6068
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,6 @@
import 'package:fluffychat/pangea/bot/utils/bot_name.dart';
import 'package:flutter/material.dart';
import 'package:fluffychat/pangea/bot/utils/bot_name.dart';
import 'package:fluffychat/pangea/user/models/profile_model.dart';
import 'package:fluffychat/widgets/matrix.dart';
@ -39,7 +39,7 @@ class LevelDisplayNameState extends State<LevelDisplayName> {
@override
Widget build(BuildContext context) {
if(widget.userId == BotName.byEnvironment){
if (widget.userId == BotName.byEnvironment) {
return const SizedBox();
}

View file

@ -70,8 +70,11 @@ class LemmaMeaningActivityGenerator {
.constructList(type: ConstructTypeEnum.vocab)
.where(
(c) =>
c.lemma.toLowerCase() != lemma.toLowerCase() &&
c.category.toLowerCase() == pos.toLowerCase(),
c.lemma.isNotEmpty && // must not be empty strings
c.lemma.toLowerCase() !=
lemma.toLowerCase() && // must not be the lemma itself
c.category.toLowerCase() ==
pos.toLowerCase(), // must be same part of speech
)
.toList();