ThyWoof
commited on
Commit
·
ac77ea3
1
Parent(s):
a175f0e
update doc
Browse files- deep_translator/deepl.py +6 -3
deep_translator/deepl.py
CHANGED
|
@@ -16,6 +16,8 @@ class DeepL(object):
|
|
| 16 |
"""
|
| 17 |
@param api_key: your DeepL api key.
|
| 18 |
Get one here: https://www.deepl.com/docs-api/accessing-the-api/
|
|
|
|
|
|
|
| 19 |
"""
|
| 20 |
if not api_key:
|
| 21 |
raise ServerException(401)
|
|
@@ -26,6 +28,10 @@ class DeepL(object):
|
|
| 26 |
self.__base_url = BASE_URLS.get("DEEPL").format(version=self.version)
|
| 27 |
|
| 28 |
def translate(self, text):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
# Create the request parameters.
|
| 30 |
translate_endpoint = 'translate'
|
| 31 |
params = {
|
|
@@ -53,9 +59,6 @@ class DeepL(object):
|
|
| 53 |
|
| 54 |
def translate_batch(self, batch):
|
| 55 |
"""
|
| 56 |
-
translate a batch of texts
|
| 57 |
-
@param source: source language
|
| 58 |
-
@param target: target language
|
| 59 |
@param batch: list of texts to translate
|
| 60 |
@return: list of translations
|
| 61 |
"""
|
|
|
|
| 16 |
"""
|
| 17 |
@param api_key: your DeepL api key.
|
| 18 |
Get one here: https://www.deepl.com/docs-api/accessing-the-api/
|
| 19 |
+
@param source: source language
|
| 20 |
+
@param target: target language
|
| 21 |
"""
|
| 22 |
if not api_key:
|
| 23 |
raise ServerException(401)
|
|
|
|
| 28 |
self.__base_url = BASE_URLS.get("DEEPL").format(version=self.version)
|
| 29 |
|
| 30 |
def translate(self, text):
|
| 31 |
+
"""
|
| 32 |
+
@param text: text to translate
|
| 33 |
+
@return: translated text
|
| 34 |
+
"""
|
| 35 |
# Create the request parameters.
|
| 36 |
translate_endpoint = 'translate'
|
| 37 |
params = {
|
|
|
|
| 59 |
|
| 60 |
def translate_batch(self, batch):
|
| 61 |
"""
|
|
|
|
|
|
|
|
|
|
| 62 |
@param batch: list of texts to translate
|
| 63 |
@return: list of translations
|
| 64 |
"""
|