eric7/Documentation/Source/eric7.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.MicrosoftEngine.html

branch
eric7
changeset 9148
b31f0d894b55
parent 8596
d64760b2da50
equal deleted inserted replaced
9147:bbf3af40c223 9148:b31f0d894b55
42 <h3>Derived from</h3> 42 <h3>Derived from</h3>
43 TranslationEngine 43 TranslationEngine
44 <h3>Class Attributes</h3> 44 <h3>Class Attributes</h3>
45 45
46 <table> 46 <table>
47 <tr><td>AccessTokenUrl</td></tr><tr><td>TextToSpeechUrl</td></tr><tr><td>TranslatorUrl</td></tr> 47 <tr><td>TranslatorUrl</td></tr>
48 </table> 48 </table>
49 <h3>Class Methods</h3> 49 <h3>Class Methods</h3>
50 50
51 <table> 51 <table>
52 <tr><td>None</td></tr> 52 <tr><td>None</td></tr>
58 <tr> 58 <tr>
59 <td><a href="#MicrosoftEngine.__init__">MicrosoftEngine</a></td> 59 <td><a href="#MicrosoftEngine.__init__">MicrosoftEngine</a></td>
60 <td>Constructor</td> 60 <td>Constructor</td>
61 </tr> 61 </tr>
62 <tr> 62 <tr>
63 <td><a href="#MicrosoftEngine.__getAccessToken">__getAccessToken</a></td>
64 <td>Private slot to get an access token.</td>
65 </tr>
66 <tr>
67 <td><a href="#MicrosoftEngine.__getClientDataAzure">__getClientDataAzure</a></td> 63 <td><a href="#MicrosoftEngine.__getClientDataAzure">__getClientDataAzure</a></td>
68 <td>Private method to retrieve the client data.</td> 64 <td>Private method to retrieve the client data.</td>
69 </tr> 65 </tr>
70 <tr> 66 <tr>
71 <td><a href="#MicrosoftEngine.__mapLanguageCode">__mapLanguageCode</a></td> 67 <td><a href="#MicrosoftEngine.__mapLanguageCode">__mapLanguageCode</a></td>
74 <tr> 70 <tr>
75 <td><a href="#MicrosoftEngine.engineName">engineName</a></td> 71 <td><a href="#MicrosoftEngine.engineName">engineName</a></td>
76 <td>Public method to return the name of the engine.</td> 72 <td>Public method to return the name of the engine.</td>
77 </tr> 73 </tr>
78 <tr> 74 <tr>
79 <td><a href="#MicrosoftEngine.getTextToSpeechData">getTextToSpeechData</a></td>
80 <td>Public method to pronounce the given text.</td>
81 </tr>
82 <tr>
83 <td><a href="#MicrosoftEngine.getTranslation">getTranslation</a></td> 75 <td><a href="#MicrosoftEngine.getTranslation">getTranslation</a></td>
84 <td>Public method to translate the given text.</td> 76 <td>Public method to translate the given text.</td>
85 </tr>
86 <tr>
87 <td><a href="#MicrosoftEngine.hasTTS">hasTTS</a></td>
88 <td>Public method indicating the Text-to-Speech capability.</td>
89 </tr> 77 </tr>
90 <tr> 78 <tr>
91 <td><a href="#MicrosoftEngine.supportedLanguages">supportedLanguages</a></td> 79 <td><a href="#MicrosoftEngine.supportedLanguages">supportedLanguages</a></td>
92 <td>Public method to get the supported languages.</td> 80 <td>Public method to get the supported languages.</td>
93 </tr> 81 </tr>
105 <p> 93 <p>
106 Constructor 94 Constructor
107 </p> 95 </p>
108 <dl> 96 <dl>
109 97
110 <dt><i>plugin</i></dt> 98 <dt><i>plugin</i> (TranslatorPlugin)</dt>
111 <dd> 99 <dd>
112 reference to the plugin object (TranslatorPlugin) 100 reference to the plugin object
113 </dd> 101 </dd>
114 <dt><i>parent</i></dt> 102 <dt><i>parent</i> (QObject)</dt>
115 <dd> 103 <dd>
116 reference to the parent object (QObject) 104 reference to the parent object
117 </dd>
118 </dl>
119 <a NAME="MicrosoftEngine.__getAccessToken" ID="MicrosoftEngine.__getAccessToken"></a>
120 <h4>MicrosoftEngine.__getAccessToken</h4>
121 <b>__getAccessToken</b>(<i>requestObject</i>)
122
123 <p>
124 Private slot to get an access token.
125 </p>
126 <p>
127 If the stored token is no longer valid, get a new one and store it.
128 </p>
129 <dl>
130
131 <dt><i>requestObject</i></dt>
132 <dd>
133 reference to the request object
134 (TranslatorRequest)
135 </dd>
136 </dl>
137 <dl>
138 <dt>Return:</dt>
139 <dd>
140 access token (string)
141 </dd> 105 </dd>
142 </dl> 106 </dl>
143 <a NAME="MicrosoftEngine.__getClientDataAzure" ID="MicrosoftEngine.__getClientDataAzure"></a> 107 <a NAME="MicrosoftEngine.__getClientDataAzure" ID="MicrosoftEngine.__getClientDataAzure"></a>
144 <h4>MicrosoftEngine.__getClientDataAzure</h4> 108 <h4>MicrosoftEngine.__getClientDataAzure</h4>
145 <b>__getClientDataAzure</b>(<i></i>) 109 <b>__getClientDataAzure</b>(<i></i>)
148 Private method to retrieve the client data. 112 Private method to retrieve the client data.
149 </p> 113 </p>
150 <dl> 114 <dl>
151 <dt>Return:</dt> 115 <dt>Return:</dt>
152 <dd> 116 <dd>
153 tuple giving the API subscription key and a flag indicating 117 tuple giving the API subscription key, the API subscription
154 validity 118 region and a flag indicating validity
155 </dd> 119 </dd>
156 </dl> 120 </dl>
157 <dl> 121 <dl>
158 <dt>Return Type:</dt> 122 <dt>Return Type:</dt>
159 <dd> 123 <dd>
160 tuple of (str, bool) 124 tuple of (str, str, bool)
161 </dd> 125 </dd>
162 </dl> 126 </dl>
163 <a NAME="MicrosoftEngine.__mapLanguageCode" ID="MicrosoftEngine.__mapLanguageCode"></a> 127 <a NAME="MicrosoftEngine.__mapLanguageCode" ID="MicrosoftEngine.__mapLanguageCode"></a>
164 <h4>MicrosoftEngine.__mapLanguageCode</h4> 128 <h4>MicrosoftEngine.__mapLanguageCode</h4>
165 <b>__mapLanguageCode</b>(<i>code</i>) 129 <b>__mapLanguageCode</b>(<i>code</i>)
167 <p> 131 <p>
168 Private method to map a language code to the Microsoft code. 132 Private method to map a language code to the Microsoft code.
169 </p> 133 </p>
170 <dl> 134 <dl>
171 135
172 <dt><i>code</i></dt> 136 <dt><i>code</i> (str)</dt>
173 <dd> 137 <dd>
174 language code (string) 138 language code
175 </dd> 139 </dd>
176 </dl> 140 </dl>
177 <dl> 141 <dl>
178 <dt>Return:</dt> 142 <dt>Return:</dt>
179 <dd> 143 <dd>
180 mapped language code (string) 144 mapped language code
145 </dd>
146 </dl>
147 <dl>
148 <dt>Return Type:</dt>
149 <dd>
150 str
181 </dd> 151 </dd>
182 </dl> 152 </dl>
183 <a NAME="MicrosoftEngine.engineName" ID="MicrosoftEngine.engineName"></a> 153 <a NAME="MicrosoftEngine.engineName" ID="MicrosoftEngine.engineName"></a>
184 <h4>MicrosoftEngine.engineName</h4> 154 <h4>MicrosoftEngine.engineName</h4>
185 <b>engineName</b>(<i></i>) 155 <b>engineName</b>(<i></i>)
188 Public method to return the name of the engine. 158 Public method to return the name of the engine.
189 </p> 159 </p>
190 <dl> 160 <dl>
191 <dt>Return:</dt> 161 <dt>Return:</dt>
192 <dd> 162 <dd>
193 engine name (string) 163 engine name
194 </dd> 164 </dd>
195 </dl> 165 </dl>
196 <a NAME="MicrosoftEngine.getTextToSpeechData" ID="MicrosoftEngine.getTextToSpeechData"></a> 166 <dl>
197 <h4>MicrosoftEngine.getTextToSpeechData</h4> 167 <dt>Return Type:</dt>
198 <b>getTextToSpeechData</b>(<i>requestObject, text, language</i>) 168 <dd>
199 169 str
200 <p>
201 Public method to pronounce the given text.
202 </p>
203 <dl>
204
205 <dt><i>requestObject</i></dt>
206 <dd>
207 reference to the request object
208 (TranslatorRequest)
209 </dd>
210 <dt><i>text</i></dt>
211 <dd>
212 text to be pronounced (string)
213 </dd>
214 <dt><i>language</i></dt>
215 <dd>
216 language code of the text (string)
217 </dd>
218 </dl>
219 <dl>
220 <dt>Return:</dt>
221 <dd>
222 tuple with pronounce data (QByteArray) or error string (string)
223 and success flag (boolean)
224 </dd> 170 </dd>
225 </dl> 171 </dl>
226 <a NAME="MicrosoftEngine.getTranslation" ID="MicrosoftEngine.getTranslation"></a> 172 <a NAME="MicrosoftEngine.getTranslation" ID="MicrosoftEngine.getTranslation"></a>
227 <h4>MicrosoftEngine.getTranslation</h4> 173 <h4>MicrosoftEngine.getTranslation</h4>
228 <b>getTranslation</b>(<i>requestObject, text, originalLanguage, translationLanguage</i>) 174 <b>getTranslation</b>(<i>requestObject, text, originalLanguage, translationLanguage</i>)
230 <p> 176 <p>
231 Public method to translate the given text. 177 Public method to translate the given text.
232 </p> 178 </p>
233 <dl> 179 <dl>
234 180
235 <dt><i>requestObject</i></dt> 181 <dt><i>requestObject</i> (TranslatorRequest)</dt>
236 <dd> 182 <dd>
237 reference to the request object 183 reference to the request object
238 (TranslatorRequest) 184 </dd>
239 </dd> 185 <dt><i>text</i> (str)</dt>
240 <dt><i>text</i></dt> 186 <dd>
241 <dd> 187 text to be translated
242 text to be translated (string) 188 </dd>
243 </dd> 189 <dt><i>originalLanguage</i> (str)</dt>
244 <dt><i>originalLanguage</i></dt> 190 <dd>
245 <dd> 191 language code of the original
246 language code of the original (string) 192 </dd>
247 </dd> 193 <dt><i>translationLanguage</i> (str)</dt>
248 <dt><i>translationLanguage</i></dt> 194 <dd>
249 <dd> 195 language code of the translation
250 language code of the translation (string) 196 </dd>
251 </dd> 197 </dl>
252 </dl> 198 <dl>
253 <dl> 199 <dt>Return:</dt>
254 <dt>Return:</dt> 200 <dd>
255 <dd> 201 tuple of translated text and flag indicating success
256 tuple of translated text (string) and flag indicating 202 </dd>
257 success (boolean) 203 </dl>
258 </dd> 204 <dl>
259 </dl> 205 <dt>Return Type:</dt>
260 <a NAME="MicrosoftEngine.hasTTS" ID="MicrosoftEngine.hasTTS"></a> 206 <dd>
261 <h4>MicrosoftEngine.hasTTS</h4> 207 tuple of (str, bool)
262 <b>hasTTS</b>(<i></i>)
263
264 <p>
265 Public method indicating the Text-to-Speech capability.
266 </p>
267 <dl>
268 <dt>Return:</dt>
269 <dd>
270 flag indicating the Text-to-Speech capability (boolean)
271 </dd> 208 </dd>
272 </dl> 209 </dl>
273 <a NAME="MicrosoftEngine.supportedLanguages" ID="MicrosoftEngine.supportedLanguages"></a> 210 <a NAME="MicrosoftEngine.supportedLanguages" ID="MicrosoftEngine.supportedLanguages"></a>
274 <h4>MicrosoftEngine.supportedLanguages</h4> 211 <h4>MicrosoftEngine.supportedLanguages</h4>
275 <b>supportedLanguages</b>(<i></i>) 212 <b>supportedLanguages</b>(<i></i>)
278 Public method to get the supported languages. 215 Public method to get the supported languages.
279 </p> 216 </p>
280 <dl> 217 <dl>
281 <dt>Return:</dt> 218 <dt>Return:</dt>
282 <dd> 219 <dd>
283 list of supported language codes (list of string) 220 list of supported language codes
221 </dd>
222 </dl>
223 <dl>
224 <dt>Return Type:</dt>
225 <dd>
226 list of str
284 </dd> 227 </dd>
285 </dl> 228 </dl>
286 <div align="right"><a href="#top">Up</a></div> 229 <div align="right"><a href="#top">Up</a></div>
287 <hr /> 230 <hr />
288 </body></html> 231 </body></html>

eric ide

mercurial