guess_language – Guess the natural language of a text

Example usage

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

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

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


To install the package for Python 3, use:

$ ./ install

To install the package for Python 2, use:

$ python2 install

To install with pip, use:

$ pip install guess_language-spirit

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


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