DeepL support #17

Open
opened 2023-10-02 08:23:39 +02:00 by juk0de · 0 comments
Collaborator

https://github.com/DeepLcom/deepl-python
https://www.deepl.com/en/docs-api/

DeepL Configuration

DeepL AI class

  • New functions translate_text() and translate_document()
  • Parameters:
    • source_lang
    • dest_lang
    • glossaries: list of glossaries to use for translation
    • more parameters
  • Some parameters could also be part of the DeepL Config instead

DeepL Glossary

DeepL Commands and options

  • New subcommand translation
  • Options:
    • --create, --ask, --repeat
      • similiar to the question command (share code where possible!)
    • --text (string)
    • --documents (tuple of input and output documents)
    • --source-lang (string)
    • --target-lang (string)
    • --glossaries (list of glossaries to use for translation)
    • more options
  • New subcommand glossary
  • Options:
    • create: create new glossary from .glo file
    • update/upload: update existing remote glossary from .glo file
    • get/download: download existing remote glossary and dump into new .glo file
    • print: print existing glossary from .glo file
      • additional options for filtering (e. g. substrings)

Open questions

  • How to handle DeepL tags (xml, html)?
https://github.com/DeepLcom/deepl-python https://www.deepl.com/en/docs-api/ ### DeepL Configuration * `API Key` * Maybe put some [translation options](https://github.com/DeepLcom/deepl-python#text-translation-options) in the config? ### DeepL AI class * New functions `translate_text()` and `translate_document()` * Parameters: * `source_lang` * `dest_lang` * `glossaries`: list of glossaries to use for translation * [more parameters](https://github.com/DeepLcom/deepl-python#text-translation-options) * Some parameters could also be part of the DeepL Config instead ### DeepL Glossary * New class `Glossary` * Members: * `Name` (free to choose) * `ID` (automatic, created / modified on upload) * `source_lang` * `target_lang` * `entries` * Functions: * `to_file()` * `from_file()` * `print()` * File format: `tsv` (tab-separated values, see https://www.deepl.com/de/docs-api/glossaries/formats) * File suffix: `.glo` * [Glossary API](https://github.com/DeepLcom/deepl-python#creating-a-glossary) ### DeepL Commands and options * New subcommand `translation` * Options: * `--create`, `--ask`, `--repeat` * similiar to the `question` command (share code where possible!) * `--text` (string) * `--documents` (tuple of input and output documents) * `--source-lang` (string) * `--target-lang` (string) * `--glossaries` (list of glossaries to use for translation) * [more options](https://github.com/DeepLcom/deepl-python#text-translation-options) * New subcommand `glossary` * Options: * `create`: create new glossary from `.glo` file * `update`/`upload`: update existing remote glossary from `.glo` file * deletes the old one and [creates a new one with the same name](https://www.deepl.com/de/docs-api/glossaries/) * `get`/`download`: download existing remote glossary and dump into new `.glo` file * `print`: print existing glossary from `.glo` file * additional options for filtering (e. g. substrings) ### Open questions * How to handle DeepL tags ([xml](https://www.deepl.com/de/docs-api/xml), [html](https://www.deepl.com/de/docs-api/html))?
juk0de added the enhancement label 2023-10-02 08:23:44 +02:00
juk0de self-assigned this 2023-10-02 08:23:54 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kaizenkodo/ChatMastermind#17