mindmeld.components.translators module¶
This module contains translator clients used by the MultiLingual Annotator.
-
class
mindmeld.components.translators.
GoogleTranslator
[source]¶ Bases:
mindmeld.components.translators.Translator
Class for translation using the Google Translate API.
-
detect_language
(text)[source]¶ Parameters: text (str) -- Input text Returns: Detected Language Code Return type: language_code (str)
-
static
get_translate_client
()[source]¶ Creates a translation client after finding the credential path. Attempts to import the Google Cloud Translation library.
Returns: Google Translation Client Return type: translate_client (translate_v2.Client) Raises: ModuleNotFoundError
-
-
class
mindmeld.components.translators.
NoOpTranslator
[source]¶ Bases:
mindmeld.components.translators.Translator
No-Ops translator to be used when a Translator is not selected or available.
-
class
mindmeld.components.translators.
Translator
[source]¶ Bases:
object
Abstract Translator Base Class for Translators to be used by Mindmeld.