Giter Club home page Giter Club logo

deeplator's Introduction

Deeplator

About

Deeplator is a Python library and application enabling translation via the DeepL translator available at deepl.com.

In August 2017, DeepL released the DeepL translator. With unprecedented translation quality, the DeepL translator sets a new standard in neural machine translation. Check out deepl.com to get more information.

Currently, the supported languages include English, German, French, Spanish, Italian, Dutch and Polish.

If you're coding in PHP instead, DeepLy might be the right choice.

Application Usage

Using the application is straight forward. Basically, you just need to launch deeplator.py.

The -l LANG argument specifies the source and output languages. If omitted, the application will ask for the languages interactively. LANG is the translation code in the format AA-BB where AA ist the source language code and BB is the output language code. See the table below for all language codes. For example, if you were to translate from English to German, the argument should be -l EN-DE. You can also tell DeepL to automatically detect the language of the source text by supplying AUTO as the source language (e.g. -l AUTO-DE).

Language Code
English EN
German DE
French FR
Spanish ES
Italian IT
Dutch NL
Polish PL

You can tell Deeplator to read input from a file using the -f PATH argument. When ommitted, Deeplator will read input from stdin instead. Remember to exit the multiline input with Ctrl+D.

Library Usage

The Deeplator library was written for Python 3.

Single Sentence

from deeplator import Translator

t = Translator("EN", "DE")
sentence = "Hello world."
translation = t.translate_sentence(sentence)
print(translation)

Multiple Sentences

In case it is unknown if the input string consists of multiple sentences, use the translate_sentences method. It will split the passed argument into sentences first and translate each sentence by its own.

from deeplator import Translator

t = Translator("EN", "DE")
paragraph = "Hello world. DeepL is awesome."
translations = t.translate_sentences(paragraph)
print(translations)

deeplator's People

Contributors

jonbulica99 avatar nick-traeger avatar uinput avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.