update lemma factory

pull/1384/head
William Jordan-Cooley 1 year ago
parent 266826fd0e
commit 8ab62fed3b

2
.gitignore vendored

@ -13,6 +13,8 @@
prime prime
*.env *.env
!/public/.env !/public/.env
*.env.local_choreo
*.env.prod
# libolm package # libolm package
/assets/js/package /assets/js/package

@ -22,7 +22,7 @@ void main() async {
// #Pangea // #Pangea
try { try {
await dotenv.load(fileName: ".env"); await dotenv.load(fileName: ".env.local_choreo");
} catch (e) { } catch (e) {
Logs().e('Failed to load .env file', e); Logs().e('Failed to load .env file', e);
} }

@ -16,14 +16,15 @@ class Lemma {
/// [morph] ex {} - morphological features of the lemma /// [morph] ex {} - morphological features of the lemma
/// https://universaldependencies.org/u/feat/ /// https://universaldependencies.org/u/feat/
final Map<String, String> morph; final Map<String, dynamic> morph;
Lemma( Lemma({
{required this.text, required this.text,
required this.saveVocab, required this.saveVocab,
required this.form, required this.form,
this.pos = '', this.pos = '',
this.morph = const {}}); this.morph = const {},
});
factory Lemma.fromJson(Map<String, dynamic> json) { factory Lemma.fromJson(Map<String, dynamic> json) {
return Lemma( return Lemma(
@ -31,7 +32,7 @@ class Lemma {
saveVocab: json['save_vocab'] ?? json['saveVocab'] ?? false, saveVocab: json['save_vocab'] ?? json['saveVocab'] ?? false,
form: json["form"] ?? json['text'], form: json["form"] ?? json['text'],
pos: json['pos'] ?? '', pos: json['pos'] ?? '',
morph: json['morph'] ?? {}, morph: json['morph'] ?? '{}',
); );
} }
@ -41,7 +42,7 @@ class Lemma {
'save_vocab': saveVocab, 'save_vocab': saveVocab,
'form': form, 'form': form,
'pos': pos, 'pos': pos,
'morph': morph 'morph': morph,
}; };
} }

@ -151,6 +151,8 @@ flutter:
# causes error with github actions # causes error with github actions
# - .env # - .env
# - assets/.env # - assets/.env
- .env.local_choreo
- assets/.env.local_choreo
- assets/pangea/ - assets/pangea/
- assets/pangea/bot_faces/ - assets/pangea/bot_faces/
# Pangea# # Pangea#

Loading…
Cancel
Save