class
DeepL::Translator
- DeepL::Translator
- Reference
- Object
Overview
DEPRECATED Use V3 MultilingualGlossaryInfo instead
Defined in:
deepl/translator.crdeepl/v2/document.cr
deepl/v2/glossary.cr
deepl/v2/language.cr
deepl/v2/rephrase.cr
deepl/v2/text.cr
deepl/v2/usage.cr
deepl/v3/glossary.cr
Constant Summary
-
DEEPL_API_VERSION =
{{ (env("DEEPL_API_VERSION")) || "v2" }}
-
DEEPL_DEFAULT_SERVER_URL =
"https://api.deepl.com"
-
Note: The default server URL is set during the compilation process. To change the default server URL, you need to recompile the code.
-
DEEPL_DEFAULT_SERVER_URL_FREE =
"https://api-free.deepl.com"
-
DEEPL_SERVER_URL =
{{ (env("DEEPL_SERVER_URL")) || DEEPL_DEFAULT_SERVER_URL }}
-
DEEPL_SERVER_URL_FREE =
{{ (env("DEEPL_SERVER_URL_FREE")) || DEEPL_DEFAULT_SERVER_URL_FREE }}
-
HTTP_STATUS_QUOTA_EXCEEDED =
456
Constructors
Instance Method Summary
- #auth_key : String
- #auth_key=(auth_key : String | Nil)
- #create_glossary(name, source_lang, target_lang, entries, entry_format = "tsv") : GlossaryInfo
-
#create_multilingual_glossary(name : String, dictionaries : Array(GlossaryDictionary)) : MultilingualGlossaryInfo
Create a multilingual glossary with specified name and dictionaries
- #delete_glossary(glossary : GlossaryInfo) : Bool
- #delete_glossary(glossary_id : String) : Bool
- #delete_glossary_by_name(name : String) : Bool
-
#delete_multilingual_glossary(glossary_id : String) : Bool
Delete a multilingual glossary by ID
-
#delete_multilingual_glossary(glossary : MultilingualGlossaryInfo) : Bool
Delete a multilingual glossary (convenience method)
-
#delete_multilingual_glossary_dictionary(glossary_id : String, source_lang : String, target_lang : String) : Bool
Delete a dictionary from the glossary
- #find_glossary_info_by_name(name : String) : GlossaryInfo
-
#find_multilingual_glossary_by_name(name : String) : MultilingualGlossaryInfo
Find multilingual glossary by name
- #get_glossary_entries(glossary : GlossaryInfo) : String
- #get_glossary_entries(glossary_id : String) : String
- #get_glossary_entries_by_name(name : String) : String
- #get_glossary_info(glossary_id : String) : GlossaryInfo
- #get_glossary_info_by_name(name : String) : Array(GlossaryInfo)
- #get_glossary_language_pairs : Array(GlossaryLanguagePair)
-
#get_multilingual_glossaries_by_name(name : String) : Array(MultilingualGlossaryInfo)
Get multilingual glossaries by name (multiple matches possible)
-
#get_multilingual_glossary(glossary_id : String) : MultilingualGlossaryInfo
Get multilingual glossary details by ID
-
#get_multilingual_glossary_entries(glossary_id : String, source_lang : String, target_lang : String) : GlossaryDictionary
Get glossary entries for specific language pair
-
#get_multilingual_glossary_entries(glossary : MultilingualGlossaryInfo, source_lang : String, target_lang : String) : GlossaryDictionary
Get glossary entries (convenience method)
-
#get_multilingual_glossary_language_pairs : Array(MultilingualGlossaryLanguagePair)
Get supported language pairs for multilingual glossaries
- #get_source_languages : Array(LanguageInfo)
- #get_target_languages : Array(LanguageInfo)
- #get_usage : Usage
- #get_usage_free : UsageFree
- #get_usage_pro : UsagePro
- #guess_target_language : String
- #list_glossaries : Array(GlossaryInfo)
-
#list_multilingual_glossaries : Array(MultilingualGlossaryInfo)
List all multilingual glossaries and their meta-information
-
#patch_multilingual_glossary(glossary_id : String, name : String | Nil = nil, dictionaries : Array(GlossaryDictionary) | Nil = nil) : MultilingualGlossaryInfo
Edit glossary details (name or dictionaries)
-
#put_multilingual_glossary_dictionary(glossary_id : String, source_lang : String, target_lang : String, entries : String, entries_format : String = "tsv") : GlossaryEntriesInformation
Replace or create a dictionary in the glossary
- #rephrase_text(text : String | Array(String), target_lang = nil, writing_style = nil, tone = nil) : Array(RephraseResult)
- #server_url : String
- #server_url=(server_url : String | Nil)
- #translate_document(path, target_lang, source_lang = nil, formality = nil, glossary_id = nil, glossary_name = nil, output_format = nil, output_file = nil, interval = 5.0, message_prefix = "[deepl.cr] ", &block : String -> )
- #translate_document(path, target_lang, source_lang = nil, formality = nil, glossary_id = nil, glossary_name = nil, output_format = nil, output_file = nil, interval = 5.0, message_prefix = "[deepl.cr] ", block : String -> | Nil = nil)
- #translate_document_download(handle : DocumentHandle, output_file)
- #translate_document_get_status(handle : DocumentHandle) : DocumentStatus
- #translate_document_upload(path : Path | String, target_lang, source_lang = nil, formality = nil, glossary_id = nil, glossary_name = nil, output_format = nil) : DocumentHandle
- #translate_document_wait_until_done(handle : DocumentHandle, interval = 5.0, &block : DocumentStatus -> )
- #translate_document_wait_until_done(handle : DocumentHandle, interval = 5.0, block : DocumentStatus -> | Nil = nil)
- #translate_text(text : String | Array(String), target_lang, source_lang = nil, context = nil, show_billed_characters : Bool | Nil = nil, split_sentences = nil, preserve_formatting : Bool | Nil = nil, formality = nil, glossary_id = nil, glossary_name = nil, tag_handling = nil, outline_detection : Bool | Nil = nil, non_splitting_tags : Array(String) | Nil = nil, splitting_tags : Array(String) | Nil = nil, ignore_tags : Array(String) | Nil = nil, model_type = nil) : Array(TextResult)
- #user_agent : String
- #user_agent=(user_agent : String | Nil)
Constructor Detail
Instance Method Detail
Create a multilingual glossary with specified name and dictionaries
Delete a multilingual glossary by ID
Delete a multilingual glossary (convenience method)
Delete a dictionary from the glossary
Find multilingual glossary by name
Get multilingual glossaries by name (multiple matches possible)
Get multilingual glossary details by ID
Get glossary entries for specific language pair
Get glossary entries (convenience method)
Get supported language pairs for multilingual glossaries
List all multilingual glossaries and their meta-information
Edit glossary details (name or dictionaries)
Replace or create a dictionary in the glossary