fluffychat/lib/pangea/lemmas/lemma_info_request.dart
wcjord d773347d6e
Morph-repo-2 (#1681)
* feat(morphs): repo for getting lang-specific list of morphs

* integrated repo into use of morph features and tags

* generated

* merged with previous push

* generated

* generated

* chore: fix .env file path

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com>
Co-authored-by: ggurdin <ggurdin@gmail.com>
2025-02-03 12:21:29 -05:00

47 lines
1.2 KiB
Dart

import 'package:fluffychat/pangea/events/models/content_feedback.dart';
import 'package:fluffychat/pangea/lemmas/lemma_info_response.dart';
class LemmaInfoRequest {
final String lemma;
final String partOfSpeech;
final String lemmaLang;
final String userL1;
ContentFeedback<LemmaInfoResponse>? feedback;
LemmaInfoRequest({
required String partOfSpeech,
required String lemmaLang,
required this.userL1,
required this.lemma,
this.feedback,
}) : partOfSpeech = partOfSpeech.toLowerCase(),
lemmaLang = lemmaLang.toLowerCase();
Map<String, dynamic> toJson() {
return {
'lemma': lemma,
'part_of_speech': partOfSpeech,
'lemma_lang': lemmaLang,
'user_l1': userL1,
'feedback': feedback?.toJson(),
};
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is LemmaInfoRequest &&
runtimeType == other.runtimeType &&
lemma == other.lemma &&
partOfSpeech == other.partOfSpeech &&
feedback == other.feedback;
@override
int get hashCode =>
lemma.hashCode ^ partOfSpeech.hashCode ^ feedback.hashCode;
String get storageKey {
return 'l:$lemma,p:$partOfSpeech,lang:$lemmaLang,l1:$userL1';
}
}