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

Mon, 09 Jan 2023 11:22:56 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 09 Jan 2023 11:22:56 +0100
branch
eric7
changeset 9686
2eee7a645cba
parent 9503
ae9232bf4854
child 10479
856476537696
permissions
-rw-r--r--

Moved the 'QtHelp' subpackage out of the WebBrowser package because it is used in the HelpViewer as well.

<!DOCTYPE html>
<html><head>
<title>eric7.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.MicrosoftEngine</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<a NAME="top" ID="top"></a>
<h1>eric7.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.MicrosoftEngine</h1>

<p>
Module implementing the Microsoft translation engine.
</p>
<h3>Global Attributes</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Classes</h3>

<table>

<tr>
<td><a href="#MicrosoftEngine">MicrosoftEngine</a></td>
<td>Class implementing the translation engine for the Microsoft translation service.</td>
</tr>
</table>
<h3>Functions</h3>

<table>

<tr>
<td><a href="#createEngine">createEngine</a></td>
<td>Function to instantiate a translator engine object.</td>
</tr>
</table>
<hr />
<hr />
<a NAME="MicrosoftEngine" ID="MicrosoftEngine"></a>
<h2>MicrosoftEngine</h2>

<p>
    Class implementing the translation engine for the Microsoft
    translation service.
</p>
<h3>Derived from</h3>
TranslationEngine
<h3>Class Attributes</h3>

<table>
<tr><td>TranslatorUrl</td></tr>
</table>
<h3>Class Methods</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>

<table>

<tr>
<td><a href="#MicrosoftEngine.__init__">MicrosoftEngine</a></td>
<td>Constructor</td>
</tr>
<tr>
<td><a href="#MicrosoftEngine.__getClientDataAzure">__getClientDataAzure</a></td>
<td>Private method to retrieve the client data.</td>
</tr>
<tr>
<td><a href="#MicrosoftEngine.__mapLanguageCode">__mapLanguageCode</a></td>
<td>Private method to map a language code to the Microsoft code.</td>
</tr>
<tr>
<td><a href="#MicrosoftEngine.engineName">engineName</a></td>
<td>Public method to return the name of the engine.</td>
</tr>
<tr>
<td><a href="#MicrosoftEngine.getTranslation">getTranslation</a></td>
<td>Public method to translate the given text.</td>
</tr>
<tr>
<td><a href="#MicrosoftEngine.supportedLanguages">supportedLanguages</a></td>
<td>Public method to get the supported languages.</td>
</tr>
</table>
<h3>Static Methods</h3>

<table>
<tr><td>None</td></tr>
</table>

<a NAME="MicrosoftEngine.__init__" ID="MicrosoftEngine.__init__"></a>
<h4>MicrosoftEngine (Constructor)</h4>
<b>MicrosoftEngine</b>(<i>plugin, parent=None</i>)

<p>
        Constructor
</p>
<dl>

<dt><i>plugin</i> (TranslatorPlugin)</dt>
<dd>
reference to the plugin object
</dd>
<dt><i>parent</i> (QObject)</dt>
<dd>
reference to the parent object
</dd>
</dl>
<a NAME="MicrosoftEngine.__getClientDataAzure" ID="MicrosoftEngine.__getClientDataAzure"></a>
<h4>MicrosoftEngine.__getClientDataAzure</h4>
<b>__getClientDataAzure</b>(<i></i>)

<p>
        Private method to retrieve the client data.
</p>
<dl>
<dt>Return:</dt>
<dd>
tuple giving the API subscription key, the API subscription
            region and a flag indicating validity
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
tuple of (str, str, bool)
</dd>
</dl>
<a NAME="MicrosoftEngine.__mapLanguageCode" ID="MicrosoftEngine.__mapLanguageCode"></a>
<h4>MicrosoftEngine.__mapLanguageCode</h4>
<b>__mapLanguageCode</b>(<i>code</i>)

<p>
        Private method to map a language code to the Microsoft code.
</p>
<dl>

<dt><i>code</i> (str)</dt>
<dd>
language code
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
mapped language code
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="MicrosoftEngine.engineName" ID="MicrosoftEngine.engineName"></a>
<h4>MicrosoftEngine.engineName</h4>
<b>engineName</b>(<i></i>)

<p>
        Public method to return the name of the engine.
</p>
<dl>
<dt>Return:</dt>
<dd>
engine name
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="MicrosoftEngine.getTranslation" ID="MicrosoftEngine.getTranslation"></a>
<h4>MicrosoftEngine.getTranslation</h4>
<b>getTranslation</b>(<i>requestObject, text, originalLanguage, translationLanguage</i>)

<p>
        Public method to translate the given text.
</p>
<dl>

<dt><i>requestObject</i> (TranslatorRequest)</dt>
<dd>
reference to the request object
</dd>
<dt><i>text</i> (str)</dt>
<dd>
text to be translated
</dd>
<dt><i>originalLanguage</i> (str)</dt>
<dd>
language code of the original
</dd>
<dt><i>translationLanguage</i> (str)</dt>
<dd>
language code of the translation
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
tuple of translated text and flag indicating success
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
tuple of (str, bool)
</dd>
</dl>
<a NAME="MicrosoftEngine.supportedLanguages" ID="MicrosoftEngine.supportedLanguages"></a>
<h4>MicrosoftEngine.supportedLanguages</h4>
<b>supportedLanguages</b>(<i></i>)

<p>
        Public method to get the supported languages.
</p>
<dl>
<dt>Return:</dt>
<dd>
list of supported language codes
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="createEngine" ID="createEngine"></a>
<h2>createEngine</h2>
<b>createEngine</b>(<i>plugin, parent=None</i>)

<p>
    Function to instantiate a translator engine object.
</p>
<dl>

<dt><i>plugin</i> (TranslatorPlugin)</dt>
<dd>
reference to the plugin object
</dd>
<dt><i>parent</i> (QObject (optional))</dt>
<dd>
reference to the parent object (defaults to None)
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
reference to the instantiated translator engine object
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
MicrosoftEngine
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial