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

branch
eric7
changeset 8372
e0227a7c850e
child 8596
d64760b2da50
equal deleted inserted replaced
8371:d6062691d424 8372:e0227a7c850e
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.TranslationEngine</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body>
22 <a NAME="top" ID="top"></a>
23 <h1>eric7.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.TranslationEngine</h1>
24
25 <p>
26 Module implementing the translation engine base class.
27 </p>
28 <h3>Global Attributes</h3>
29
30 <table>
31 <tr><td>None</td></tr>
32 </table>
33 <h3>Classes</h3>
34
35 <table>
36
37 <tr>
38 <td><a href="#TranslationEngine">TranslationEngine</a></td>
39 <td>Class implementing the translation engine base class containing default methods.</td>
40 </tr>
41 </table>
42 <h3>Functions</h3>
43
44 <table>
45 <tr><td>None</td></tr>
46 </table>
47 <hr />
48 <hr />
49 <a NAME="TranslationEngine" ID="TranslationEngine"></a>
50 <h2>TranslationEngine</h2>
51
52 <p>
53 Class implementing the translation engine base class containing
54 default methods.
55 </p>
56 <h3>Signals</h3>
57 <dl>
58
59 <dt>availableTranslationsLoaded()</dt>
60 <dd>
61 emitted to indicate the availability
62 of the list of supported translation languages
63 </dd>
64 </dl>
65 <h3>Derived from</h3>
66 QObject
67 <h3>Class Attributes</h3>
68
69 <table>
70 <tr><td>None</td></tr>
71 </table>
72 <h3>Class Methods</h3>
73
74 <table>
75 <tr><td>None</td></tr>
76 </table>
77 <h3>Methods</h3>
78
79 <table>
80
81 <tr>
82 <td><a href="#TranslationEngine.__init__">TranslationEngine</a></td>
83 <td>Constructor</td>
84 </tr>
85 <tr>
86 <td><a href="#TranslationEngine.engineName">engineName</a></td>
87 <td>Public method to get the name of the engine.</td>
88 </tr>
89 <tr>
90 <td><a href="#TranslationEngine.getTextToSpeechData">getTextToSpeechData</a></td>
91 <td>Public method to pronounce the given text.</td>
92 </tr>
93 <tr>
94 <td><a href="#TranslationEngine.getTranslation">getTranslation</a></td>
95 <td>Public method to translate the given text.</td>
96 </tr>
97 <tr>
98 <td><a href="#TranslationEngine.hasTTS">hasTTS</a></td>
99 <td>Public method indicating the Text-to-Speech capability.</td>
100 </tr>
101 <tr>
102 <td><a href="#TranslationEngine.supportedLanguages">supportedLanguages</a></td>
103 <td>Public method to get the supported languages.</td>
104 </tr>
105 <tr>
106 <td><a href="#TranslationEngine.supportedTargetLanguages">supportedTargetLanguages</a></td>
107 <td>Public method to get a list of supported target languages for an original language.</td>
108 </tr>
109 </table>
110 <h3>Static Methods</h3>
111
112 <table>
113 <tr><td>None</td></tr>
114 </table>
115
116 <a NAME="TranslationEngine.__init__" ID="TranslationEngine.__init__"></a>
117 <h4>TranslationEngine (Constructor)</h4>
118 <b>TranslationEngine</b>(<i>plugin, parent=None</i>)
119
120 <p>
121 Constructor
122 </p>
123 <dl>
124
125 <dt><i>plugin</i></dt>
126 <dd>
127 reference to the plugin object (TranslatorPlugin)
128 </dd>
129 <dt><i>parent</i></dt>
130 <dd>
131 reference to the parent object (QObject)
132 </dd>
133 </dl>
134 <a NAME="TranslationEngine.engineName" ID="TranslationEngine.engineName"></a>
135 <h4>TranslationEngine.engineName</h4>
136 <b>engineName</b>(<i></i>)
137
138 <p>
139 Public method to get the name of the engine.
140 </p>
141 <dl>
142 <dt>Return:</dt>
143 <dd>
144 engine name (string)
145 </dd>
146 </dl>
147 <a NAME="TranslationEngine.getTextToSpeechData" ID="TranslationEngine.getTextToSpeechData"></a>
148 <h4>TranslationEngine.getTextToSpeechData</h4>
149 <b>getTextToSpeechData</b>(<i>requestObject, text, language</i>)
150
151 <p>
152 Public method to pronounce the given text.
153 </p>
154 <dl>
155
156 <dt><i>requestObject</i></dt>
157 <dd>
158 reference to the request object
159 (TranslatorRequest)
160 </dd>
161 <dt><i>text</i></dt>
162 <dd>
163 text to be pronounced (string)
164 </dd>
165 <dt><i>language</i></dt>
166 <dd>
167 language code of the text (string)
168 </dd>
169 </dl>
170 <dl>
171 <dt>Return:</dt>
172 <dd>
173 tuple with pronounce data (QByteArray) or error string (string)
174 and success flag (boolean)
175 </dd>
176 </dl>
177 <a NAME="TranslationEngine.getTranslation" ID="TranslationEngine.getTranslation"></a>
178 <h4>TranslationEngine.getTranslation</h4>
179 <b>getTranslation</b>(<i>requestObject, text, originalLanguage, translationLanguage</i>)
180
181 <p>
182 Public method to translate the given text.
183 </p>
184 <dl>
185
186 <dt><i>requestObject</i></dt>
187 <dd>
188 reference to the request object
189 (TranslatorRequest)
190 </dd>
191 <dt><i>text</i></dt>
192 <dd>
193 text to be translated (string)
194 </dd>
195 <dt><i>originalLanguage</i></dt>
196 <dd>
197 language code of the original (string)
198 </dd>
199 <dt><i>translationLanguage</i></dt>
200 <dd>
201 language code of the translation (string)
202 </dd>
203 </dl>
204 <dl>
205 <dt>Return:</dt>
206 <dd>
207 tuple of translated text (string) and flag indicating
208 success (boolean)
209 </dd>
210 </dl>
211 <a NAME="TranslationEngine.hasTTS" ID="TranslationEngine.hasTTS"></a>
212 <h4>TranslationEngine.hasTTS</h4>
213 <b>hasTTS</b>(<i></i>)
214
215 <p>
216 Public method indicating the Text-to-Speech capability.
217 </p>
218 <dl>
219 <dt>Return:</dt>
220 <dd>
221 flag indicating the Text-to-Speech capability (boolean)
222 </dd>
223 </dl>
224 <a NAME="TranslationEngine.supportedLanguages" ID="TranslationEngine.supportedLanguages"></a>
225 <h4>TranslationEngine.supportedLanguages</h4>
226 <b>supportedLanguages</b>(<i></i>)
227
228 <p>
229 Public method to get the supported languages.
230 </p>
231 <dl>
232 <dt>Return:</dt>
233 <dd>
234 list of supported language codes (list of string)
235 </dd>
236 </dl>
237 <a NAME="TranslationEngine.supportedTargetLanguages" ID="TranslationEngine.supportedTargetLanguages"></a>
238 <h4>TranslationEngine.supportedTargetLanguages</h4>
239 <b>supportedTargetLanguages</b>(<i>original</i>)
240
241 <p>
242 Public method to get a list of supported target languages for an
243 original language.
244 </p>
245 <p>
246 Note: The default implementation return the list of supported languages
247 (i.e. the same as those for the source) with the given original
248 removed.
249 </p>
250 <dl>
251
252 <dt><i>original</i> (str)</dt>
253 <dd>
254 original language
255 </dd>
256 </dl>
257 <dl>
258 <dt>Return:</dt>
259 <dd>
260 list of supported target languages for the given original
261 </dd>
262 </dl>
263 <dl>
264 <dt>Return Type:</dt>
265 <dd>
266 list of str
267 </dd>
268 </dl>
269 <div align="right"><a href="#top">Up</a></div>
270 <hr />
271 </body></html>

eric ide

mercurial