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
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
Close
Hashes for guess_language-spirit-0.5.2.tar.bz2
Algorithm | Hash digest | |
---|---|---|
SHA256 | be57eb2779438b018f17b1709a294a533ac1fa2963b56f8ad1a24c0f87444940 |
|
MD5 | 0a91584a5452313088a7fc50a3471672 |
|
BLAKE2b-256 | 477b2320f08ddac7a6366a80495ee622230fe9109a7eafbf9286c503b40c111f |