Skip to content

Work4Labs/guess_language-spirit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.")
'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 MSI binary packages provided on the download page.

Prerequisites

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages