Skip to main content

Get English translations of foreign word with Wiktionary

Project description

wiktionary_translate

Get English translations of foreign word with Wiktionary

ko-fi

Usage

You can only get the English definitions of foreign words

from wiktionary_translate.wiktionary_translate import WiktionaryResult

if __name__ == "__main__":

    wr = WiktionaryResult()
    if wr.query(word="essen", lang="de"):
        print(wr.definitions)  # ['to eat']
        print(wr.partOfSpeech)  # Verb
        print(wr.definitionList[0].parsedExamples)  # {'Er isst gern Schokolade.': 'He likes eating chocolate.', '...}
        print(wr.definitionList[0].examples)  # ['Er isst gern Schokolade.', 'Ich esse einen Apfel.']
        print(wr.definitionList[0].definition)  # to eat
        print(wr.rawResult)  # {'other': [{'partOfSpeech': 'Verb', 'language': 'Alemannic German', ...

 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wiktionary_translate-0.1.1.tar.gz (8.7 kB view hashes)

Uploaded Source

Built Distribution

wiktionary_translate-0.1.1-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page