added language detection controller to pangea controller
This commit is contained in:
parent
757e9be212
commit
392aad50bb
3 changed files with 23 additions and 14 deletions
|
|
@ -15,7 +15,6 @@ import '../../models/it_response_model.dart';
|
|||
import '../../models/it_step.dart';
|
||||
import '../../models/system_choice_translation_model.dart';
|
||||
import '../../repo/interactive_translation_repo.dart';
|
||||
import '../../repo/message_service.repo.dart';
|
||||
import 'choreographer.dart';
|
||||
|
||||
class ITController {
|
||||
|
|
@ -247,19 +246,19 @@ class ITController {
|
|||
),
|
||||
);
|
||||
|
||||
MessageServiceModel? messageServiceModelWithMessageId() =>
|
||||
usedInteractiveTranslation
|
||||
? MessageServiceModel(
|
||||
classId: choreographer.classId,
|
||||
roomId: choreographer.roomId,
|
||||
message: choreographer.currentText,
|
||||
messageId: null,
|
||||
payloadIds: payLoadIds,
|
||||
userId: choreographer.userId!,
|
||||
l1Lang: sourceLangCode,
|
||||
l2Lang: targetLangCode,
|
||||
)
|
||||
: null;
|
||||
// MessageServiceModel? messageServiceModelWithMessageId() =>
|
||||
// usedInteractiveTranslation
|
||||
// ? MessageServiceModel(
|
||||
// classId: choreographer.classId,
|
||||
// roomId: choreographer.roomId,
|
||||
// message: choreographer.currentText,
|
||||
// messageId: null,
|
||||
// payloadIds: payLoadIds,
|
||||
// userId: choreographer.userId!,
|
||||
// l1Lang: sourceLangCode,
|
||||
// l2Lang: targetLangCode,
|
||||
// )
|
||||
// : null;
|
||||
|
||||
//maybe we store IT data in the same format? make a specific kind of match?
|
||||
void selectTranslation(int chosenIndex) {
|
||||
|
|
|
|||
|
|
@ -62,6 +62,13 @@ class LanguageDetectionResponse {
|
|||
fullText: json['full_text'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'detections': detections,
|
||||
'full_text': fullText,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class _LanguageDetectionCacheItem {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:fluffychat/pangea/constants/pangea_event_types.dart';
|
|||
import 'package:fluffychat/pangea/controllers/class_controller.dart';
|
||||
import 'package:fluffychat/pangea/controllers/contextual_definition_controller.dart';
|
||||
import 'package:fluffychat/pangea/controllers/language_controller.dart';
|
||||
import 'package:fluffychat/pangea/controllers/language_detection_controller.dart';
|
||||
import 'package:fluffychat/pangea/controllers/language_list_controller.dart';
|
||||
import 'package:fluffychat/pangea/controllers/local_settings.dart';
|
||||
import 'package:fluffychat/pangea/controllers/message_data_controller.dart';
|
||||
|
|
@ -51,6 +52,7 @@ class PangeaController {
|
|||
late SubscriptionController subscriptionController;
|
||||
late TextToSpeechController textToSpeech;
|
||||
late SpeechToTextController speechToText;
|
||||
late LanguageDetectionController languageDetection;
|
||||
|
||||
///store Services
|
||||
late PLocalStore pStoreService;
|
||||
|
|
@ -98,6 +100,7 @@ class PangeaController {
|
|||
itFeedback = ITFeedbackController(this);
|
||||
textToSpeech = TextToSpeechController(this);
|
||||
speechToText = SpeechToTextController(this);
|
||||
languageDetection = LanguageDetectionController(this);
|
||||
PAuthGaurd.pController = this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue