Skip to main content

Guess the natural language of a text

Project description

Example usage

>>> from guess_language import guess_language
>>> guess_language("Ces eaux regorgent de renégats et de voleurs.")
'fr'
>>> guess_language("Tienes que seguir tu corazón.")
'es'
>>> guess_language("いいえ!忍者がいます")
'ja'
>>> not guess_language("??")
True

If your text is less than 20 characters long, you need PyEnchant and the appropriate dictionaries installed:

>>> guess_language("Hello, World!")
'en'

Installation

To install the package for Python 3, use:

$ ./setup.py install

To install the package for Python 2, use:

$ python2 setup.py install

On Windows, you may use one of the MSI binary packages provided on the download page.

Prerequisites

This is a Python 3 version of guess-language with further improvements.

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

guess_language-spirit-0.5.tar.bz2 (81.8 kB view details)

Uploaded Source

File details

Details for the file guess_language-spirit-0.5.tar.bz2.

File metadata

File hashes

Hashes for guess_language-spirit-0.5.tar.bz2
Algorithm Hash digest
SHA256 3ecabbd670045f488c8bda4f6a009f1e1b8234d58d2bd3458f34724b79e6833c
MD5 5d05976fcb615032661627478a286a45
BLAKE2b-256 74b68df0e72de80bb56323aee2bb67332cf7ab5485b6302304b6cf2502bb8327

See more details on using hashes here.

Supported by

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