more grammar copy updates
This commit is contained in:
parent
e7e5367595
commit
4c26e4629a
2 changed files with 11 additions and 3 deletions
|
|
@ -39,13 +39,15 @@ enum MorphologicalCategories {
|
|||
extension MorphologicalCategoriesExtension on MorphologicalCategories {
|
||||
/// Convert enum to string
|
||||
String toShortString() {
|
||||
return toString().split('.').last;
|
||||
return toString().split('.').last.toLowerCase();
|
||||
}
|
||||
|
||||
/// Convert string to enum
|
||||
static MorphologicalCategories? fromString(String category) {
|
||||
return MorphologicalCategories.values.firstWhereOrNull(
|
||||
(e) => e.toShortString() == category,
|
||||
(e) =>
|
||||
e.toShortString() ==
|
||||
category.toLowerCase().replaceAll(RegExp(r'[,\[\]]'), ''),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ String? getGrammarCopy({
|
|||
}
|
||||
|
||||
final String key =
|
||||
'grammarCopy${category.toUpperCase()}${lemma.replaceAll(",", "").toLowerCase()}';
|
||||
'grammarCopy${category.replaceAll(RegExp(r'[,\[\]]'), '').toUpperCase()}${lemma.replaceAll(RegExp(r'[,\[\]]'), '').toLowerCase()}';
|
||||
|
||||
switch (key) {
|
||||
case 'grammarCopyPOSsconj':
|
||||
|
|
@ -81,6 +81,12 @@ String? getGrammarCopy({
|
|||
return L10n.of(context)!.grammarCopyPUNCTTYPEbrck;
|
||||
case 'grammarCopyNOUNTYPEart':
|
||||
return L10n.of(context)!.grammarCopyNOUNTYPEart;
|
||||
case 'grammarCopyNUMBERPSORsing':
|
||||
return L10n.of(context)!.grammarCopyNUMBERPSORsing;
|
||||
case 'grammarCopyNUMBERPSORplur':
|
||||
return L10n.of(context)!.grammarCopyNUMBERPSORplur;
|
||||
case 'grammarCopyNUMBERPSORdual':
|
||||
return L10n.of(context)!.grammarCopyNUMBERPSORdual;
|
||||
case 'grammarCopyNUMBERsing':
|
||||
return L10n.of(context)!.grammarCopyNUMBERsing;
|
||||
case 'grammarCopyGENDERmasc':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue