Skip to content

Port of Google's language-detection library to Python.

License

Notifications You must be signed in to change notification settings

aledotdev/langdetect

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

langdetect

Port of language-detection (version from 03/03/2014) library to Python.

Installation

$ pip install langdetect

Supported Python versions 2.6, 2.7, 3.x.

Basic usage

To detect the language of the text:

>>> from langdetect import detect
>>> detect("War doesn't show who's right, just who's left.")
'en'
>>> detect("Ein, zwei, drei, vier")
'de'

To find out the probabilities for the top languages:

>>> from langdetect import detect_langs
>>> detect_langs("Otec matka syn.")
[sk:0.572770823327, pl:0.292872522702, cs:0.134356653968]

More information

This library is a direct port of language-detection from Java to Python. All the classes and methods (even unit tests) are unchanged, so for more information see the project's website or wiki.

About

Port of Google's language-detection library to Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%