From 772c0daa88a8883e6227909216bb3a1cca692cad Mon Sep 17 00:00:00 2001 From: wcjord <32568597+wcjord@users.noreply.github.com> Date: Tue, 3 Feb 2026 17:51:28 -0500 Subject: [PATCH] feat: add new parts of speech (idiom, phrasal verb, compound) and update localization (#5564) --- lib/l10n/intl_en.arb | 3 +++ lib/pangea/morphs/parts_of_speech_enum.dart | 24 +++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index f61e52653..a47f1a03e 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -3809,6 +3809,9 @@ "grammarCopyPOSpropn": "Proper Noun", "grammarCopyPOSnoun": "Noun", "grammarCopyPOSintj": "Interjection", + "grammarCopyPOSidiom": "Idiom", + "grammarCopyPOSphrasalv": "Phrasal Verb", + "grammarCopyPOScompn": "Compound", "grammarCopyPOSx": "Other", "grammarCopyGENDERfem": "Feminine", "grammarCopyPERSON2": "Second Person", diff --git a/lib/pangea/morphs/parts_of_speech_enum.dart b/lib/pangea/morphs/parts_of_speech_enum.dart index c9103781d..754024a71 100644 --- a/lib/pangea/morphs/parts_of_speech_enum.dart +++ b/lib/pangea/morphs/parts_of_speech_enum.dart @@ -1,13 +1,11 @@ import 'dart:developer'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; - import 'package:collection/collection.dart'; - import 'package:fluffychat/l10n/l10n.dart'; import 'package:fluffychat/pangea/common/utils/error_handler.dart'; import 'package:fluffychat/pangea/practice_activities/activity_type_enum.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; /// list ordered by priority enum PartOfSpeechEnum { @@ -16,6 +14,9 @@ enum PartOfSpeechEnum { verb, adj, adv, + idiom, + phrasalv, + compn, //Function tokens sconj, @@ -86,6 +87,12 @@ enum PartOfSpeechEnum { return L10n.of(context).grammarCopyPOSnoun; case PartOfSpeechEnum.intj: return L10n.of(context).grammarCopyPOSintj; + case PartOfSpeechEnum.idiom: + return L10n.of(context).grammarCopyPOSidiom; + case PartOfSpeechEnum.phrasalv: + return L10n.of(context).grammarCopyPOSphrasalv; + case PartOfSpeechEnum.compn: + return L10n.of(context).grammarCopyPOScompn; case PartOfSpeechEnum.x: return L10n.of(context).grammarCopyPOSx; } @@ -96,6 +103,9 @@ enum PartOfSpeechEnum { PartOfSpeechEnum.verb, PartOfSpeechEnum.adj, PartOfSpeechEnum.adv, + PartOfSpeechEnum.idiom, + PartOfSpeechEnum.phrasalv, + PartOfSpeechEnum.compn, ].contains(this); bool get canBeDefined => [ @@ -112,6 +122,9 @@ enum PartOfSpeechEnum { PartOfSpeechEnum.adp, PartOfSpeechEnum.aux, PartOfSpeechEnum.num, + PartOfSpeechEnum.idiom, + PartOfSpeechEnum.phrasalv, + PartOfSpeechEnum.compn, ].contains(this); bool get canBeHeard => [ @@ -128,6 +141,9 @@ enum PartOfSpeechEnum { PartOfSpeechEnum.adp, PartOfSpeechEnum.aux, PartOfSpeechEnum.num, + PartOfSpeechEnum.idiom, + PartOfSpeechEnum.phrasalv, + PartOfSpeechEnum.compn, ].contains(this); bool eligibleForPractice(ActivityTypeEnum activityType) {