TranslateMicrosoft class

微软翻译实现。

Constructors

TranslateMicrosoft({required String textEndpoint, required String wordEndpoint, required String wordSamplesEndpoint, required String locationRegion, required String key, required TtsMicrosoft ttsMicrosoft, Map<String, String>? partParams, Dio? dio})

Properties

hashCode int
The hash code for this object.
no setterinherited
key String
final
locationRegion String
final
partParams Map<String, String>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textEndpoint String
final
ttsMicrosoft TtsMicrosoft
final
wordEndpoint String
final
wordSamplesEndpoint String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
translateSentence(String text, {required LanguageCodeOfBackend sourceLanguageCode, required LanguageCodeOfBackend targetLanguageCode}) Future<Map<String, dynamic>>
翻译句子(文本翻译接口),并补充发音。
translateWord(String word, {required LanguageCodeOfBackend sourceLanguageCode, required LanguageCodeOfBackend targetLanguageCode}) Future<Map<String, dynamic>>
翻译单词(词典接口),并补充发音与例句。

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

formatSentenceResponse(Map<String, dynamic> response) SentenceInfo
将补充处理后的句子翻译结果转换为 SentenceInfo。
formatWordResponse(Map<String, dynamic> response) WordInfo
将补充处理后的词典结果转换为 WordInfo。