|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.GoogleV1Engine</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.GoogleV1Engine</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the Google V1 translation engine. |
|
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="#GoogleV1Engine">GoogleV1Engine</a></td> |
|
39 <td>Class implementing the translation engine for the old Google translation service.</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="GoogleV1Engine" ID="GoogleV1Engine"></a> |
|
50 <h2>GoogleV1Engine</h2> |
|
51 |
|
52 <p> |
|
53 Class implementing the translation engine for the old Google |
|
54 translation service. |
|
55 </p> |
|
56 <h3>Derived from</h3> |
|
57 TranslationEngine |
|
58 <h3>Class Attributes</h3> |
|
59 |
|
60 <table> |
|
61 <tr><td>TextToSpeechLimit</td></tr><tr><td>TextToSpeechUrl</td></tr><tr><td>TranslatorUrl</td></tr> |
|
62 </table> |
|
63 <h3>Class Methods</h3> |
|
64 |
|
65 <table> |
|
66 <tr><td>None</td></tr> |
|
67 </table> |
|
68 <h3>Methods</h3> |
|
69 |
|
70 <table> |
|
71 |
|
72 <tr> |
|
73 <td><a href="#GoogleV1Engine.__init__">GoogleV1Engine</a></td> |
|
74 <td>Constructor</td> |
|
75 </tr> |
|
76 <tr> |
|
77 <td><a href="#GoogleV1Engine.engineName">engineName</a></td> |
|
78 <td>Public method to return the name of the engine.</td> |
|
79 </tr> |
|
80 <tr> |
|
81 <td><a href="#GoogleV1Engine.getTextToSpeechData">getTextToSpeechData</a></td> |
|
82 <td>Public method to pronounce the given text.</td> |
|
83 </tr> |
|
84 <tr> |
|
85 <td><a href="#GoogleV1Engine.getTranslation">getTranslation</a></td> |
|
86 <td>Public method to translate the given text.</td> |
|
87 </tr> |
|
88 <tr> |
|
89 <td><a href="#GoogleV1Engine.hasTTS">hasTTS</a></td> |
|
90 <td>Public method indicating the Text-to-Speech capability.</td> |
|
91 </tr> |
|
92 <tr> |
|
93 <td><a href="#GoogleV1Engine.supportedLanguages">supportedLanguages</a></td> |
|
94 <td>Public method to get the supported languages.</td> |
|
95 </tr> |
|
96 </table> |
|
97 <h3>Static Methods</h3> |
|
98 |
|
99 <table> |
|
100 <tr><td>None</td></tr> |
|
101 </table> |
|
102 |
|
103 <a NAME="GoogleV1Engine.__init__" ID="GoogleV1Engine.__init__"></a> |
|
104 <h4>GoogleV1Engine (Constructor)</h4> |
|
105 <b>GoogleV1Engine</b>(<i>plugin, parent=None</i>) |
|
106 |
|
107 <p> |
|
108 Constructor |
|
109 </p> |
|
110 <dl> |
|
111 |
|
112 <dt><i>plugin</i></dt> |
|
113 <dd> |
|
114 reference to the plugin object (TranslatorPlugin) |
|
115 </dd> |
|
116 <dt><i>parent</i></dt> |
|
117 <dd> |
|
118 reference to the parent object (QObject) |
|
119 </dd> |
|
120 </dl> |
|
121 <a NAME="GoogleV1Engine.engineName" ID="GoogleV1Engine.engineName"></a> |
|
122 <h4>GoogleV1Engine.engineName</h4> |
|
123 <b>engineName</b>(<i></i>) |
|
124 |
|
125 <p> |
|
126 Public method to return the name of the engine. |
|
127 </p> |
|
128 <dl> |
|
129 <dt>Return:</dt> |
|
130 <dd> |
|
131 engine name (string) |
|
132 </dd> |
|
133 </dl> |
|
134 <a NAME="GoogleV1Engine.getTextToSpeechData" ID="GoogleV1Engine.getTextToSpeechData"></a> |
|
135 <h4>GoogleV1Engine.getTextToSpeechData</h4> |
|
136 <b>getTextToSpeechData</b>(<i>requestObject, text, language</i>) |
|
137 |
|
138 <p> |
|
139 Public method to pronounce the given text. |
|
140 </p> |
|
141 <dl> |
|
142 |
|
143 <dt><i>requestObject</i></dt> |
|
144 <dd> |
|
145 reference to the request object |
|
146 (TranslatorRequest) |
|
147 </dd> |
|
148 <dt><i>text</i></dt> |
|
149 <dd> |
|
150 text to be pronounced (string) |
|
151 </dd> |
|
152 <dt><i>language</i></dt> |
|
153 <dd> |
|
154 language code of the text (string) |
|
155 </dd> |
|
156 </dl> |
|
157 <dl> |
|
158 <dt>Return:</dt> |
|
159 <dd> |
|
160 tuple with pronounce data (QByteArray) or error string (string) |
|
161 and success flag (boolean) |
|
162 </dd> |
|
163 </dl> |
|
164 <a NAME="GoogleV1Engine.getTranslation" ID="GoogleV1Engine.getTranslation"></a> |
|
165 <h4>GoogleV1Engine.getTranslation</h4> |
|
166 <b>getTranslation</b>(<i>requestObject, text, originalLanguage, translationLanguage</i>) |
|
167 |
|
168 <p> |
|
169 Public method to translate the given text. |
|
170 </p> |
|
171 <dl> |
|
172 |
|
173 <dt><i>requestObject</i></dt> |
|
174 <dd> |
|
175 reference to the request object |
|
176 (TranslatorRequest) |
|
177 </dd> |
|
178 <dt><i>text</i></dt> |
|
179 <dd> |
|
180 text to be translated (string) |
|
181 </dd> |
|
182 <dt><i>originalLanguage</i></dt> |
|
183 <dd> |
|
184 language code of the original (string) |
|
185 </dd> |
|
186 <dt><i>translationLanguage</i></dt> |
|
187 <dd> |
|
188 language code of the translation (string) |
|
189 </dd> |
|
190 </dl> |
|
191 <dl> |
|
192 <dt>Return:</dt> |
|
193 <dd> |
|
194 tuple of translated text (string) and flag indicating |
|
195 success (boolean) |
|
196 </dd> |
|
197 </dl> |
|
198 <a NAME="GoogleV1Engine.hasTTS" ID="GoogleV1Engine.hasTTS"></a> |
|
199 <h4>GoogleV1Engine.hasTTS</h4> |
|
200 <b>hasTTS</b>(<i></i>) |
|
201 |
|
202 <p> |
|
203 Public method indicating the Text-to-Speech capability. |
|
204 </p> |
|
205 <dl> |
|
206 <dt>Return:</dt> |
|
207 <dd> |
|
208 flag indicating the Text-to-Speech capability (boolean) |
|
209 </dd> |
|
210 </dl> |
|
211 <a NAME="GoogleV1Engine.supportedLanguages" ID="GoogleV1Engine.supportedLanguages"></a> |
|
212 <h4>GoogleV1Engine.supportedLanguages</h4> |
|
213 <b>supportedLanguages</b>(<i></i>) |
|
214 |
|
215 <p> |
|
216 Public method to get the supported languages. |
|
217 </p> |
|
218 <dl> |
|
219 <dt>Return:</dt> |
|
220 <dd> |
|
221 list of supported language codes (list of string) |
|
222 </dd> |
|
223 </dl> |
|
224 <div align="right"><a href="#top">Up</a></div> |
|
225 <hr /> |
|
226 </body></html> |