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
Python 3.2+ (or 2.7)
PyEnchant (optional)
lib3to2 (if installing for Python 2)
This is a Python 3 version of guess-language with further improvements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
536e0f17b2a19da861481a72ebb28a775dfa329fe70f7b76a8dee5cd3201c702
|
|
| MD5 |
9dc1ef264aba21694e7bc645f604e62d
|
|
| BLAKE2b-256 |
d43defef9e756ca7ddc10bf2d352cd0924a669d4a4d7cb22005e887d4be0c346
|
File details
Details for the file guess_language_spirit-0.5.4-py3-none-any.whl.
File metadata
- Download URL: guess_language_spirit-0.5.4-py3-none-any.whl
- Upload date:
- Size: 138.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
927efa53a75e2c3bcd6229ed17760f3a785576d72c6b6d59db37292953f9d104
|
|
| MD5 |
794fb8f6283cddf00782b312a18a456c
|
|
| BLAKE2b-256 |
910153abc7a2968e5052dad0e20dd9c03da3588350a00d2e756aec17dd07fe13
|