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

To install with pip, use:

$ pip install guess_language-spirit

On Windows, you may use one of the binary packages provided on the releases 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.4.tar.gz (122.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

guess_language_spirit-0.5.4-py3-none-any.whl (138.1 kB view details)

Uploaded Python 3

File details

Details for the file guess_language_spirit-0.5.4.tar.gz.

File metadata

  • Download URL: guess_language_spirit-0.5.4.tar.gz
  • Upload date:
  • Size: 122.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for guess_language_spirit-0.5.4.tar.gz
Algorithm Hash digest
SHA256 536e0f17b2a19da861481a72ebb28a775dfa329fe70f7b76a8dee5cd3201c702
MD5 9dc1ef264aba21694e7bc645f604e62d
BLAKE2b-256 d43defef9e756ca7ddc10bf2d352cd0924a669d4a4d7cb22005e887d4be0c346

See more details on using hashes here.

File details

Details for the file guess_language_spirit-0.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for guess_language_spirit-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 927efa53a75e2c3bcd6229ed17760f3a785576d72c6b6d59db37292953f9d104
MD5 794fb8f6283cddf00782b312a18a456c
BLAKE2b-256 910153abc7a2968e5052dad0e20dd9c03da3588350a00d2e756aec17dd07fe13

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