David542
David542

Reputation: 110382

How to use guess-language package

I am trying to detect the language of a string, and have decided to use guess-language. However, there is not documentation or examples on how to use it. Does anyone know how I would use this package to detect the language of a given string?

https://pypi.python.org/pypi/guess-language

For example, something like:

>>> from guesslanguage import detect_language
>>> detect_language('Hello this is Bob')
English

Upvotes: 1

Views: 3037

Answers (3)

Gigi
Gigi

Reputation: 617

You can try this instead:

from langdetect import detect
lang = detect("Hi, How are you doin?")
>>> print lang
>>> 'en'

Upvotes: 0

user7771264
user7771264

Reputation:

See the README on guess_language over at bitbucket. The site provides support for python 3 as well

Upvotes: 1

David542
David542

Reputation: 110382

>>> from guess_language import guessLanguage
>>> guessLanguage('ボウリング・フォー・コロンバイン(字幕版)')
'ja'

Upvotes: 3

Related Questions