Skip to main content

Language detection library ported from Google's language-detection.

Project description

langdetect

Port of [language-detection](https://code.google.com/p/language-detection/) (version from 03/03/2014) library to Python.

Installation

$ pip install langdetect

Supported Python versions 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](https://code.google.com/p/language-detection/) from Java to Python. All the classes and methods (even unittsets) are unchanged, so for more information see the project’s website or wiki.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langdetect-1.0.0.zip (934.5 kB view details)

Uploaded Source

File details

Details for the file langdetect-1.0.0.zip.

File metadata

  • Download URL: langdetect-1.0.0.zip
  • Upload date:
  • Size: 934.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for langdetect-1.0.0.zip
Algorithm Hash digest
SHA256 58ecd571ab003b417895cdedaba2b8de1619ec7330a5c711ec9ac281d5feaa47
MD5 7ec701e3bbcf2d5c1fa9b29e0677430f
BLAKE2b-256 815abdd083c0adccc7c059e56753565bf1f976ae3ebc3c5166ea3b2dbdf5c82c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page