Skip to content

Commit

Permalink
Adding BASE and NMT constants for translation.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Nov 14, 2016
1 parent d7175b0 commit de69ded
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@

"""Google Cloud Translate API wrapper."""

from google.cloud.translate.client import BASE
from google.cloud.translate.client import Client
from google.cloud.translate.client import NMT
from google.cloud.translate.connection import Connection
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
ENGLISH_ISO_639 = 'en'
"""ISO 639-1 language code for English."""

BASE = 'base'
"""Base translation model."""

NMT = 'nmt'
"""Neural Machine Translation model."""


class Client(BaseClient):
"""Client to bundle configuration needed for API requests.
Expand Down Expand Up @@ -194,7 +200,7 @@ def translate(self, values, target_language=None, format_=None,
:type model: str
:param model: (Optional) The model used to translate the text. The
only accepted values are ``base`` and ``nmt``.
only accepted values are :attr:`BASE` and :attr:`NMT`.
:rtype: str or list
:returns: A list of dictionaries for each queried value. Each
Expand Down

0 comments on commit de69ded

Please sign in to comment.