Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install guess-language

How to install guess-language

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install guess-language
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2 Available View build log
Windows (64-bit)
0.2 Available View build log
Mac OS X (10.5+)
0.2 Available View build log
Linux (32-bit)
0.2 Available View build log
Linux (64-bit)
0.2 Available View build log
0.2 Available View build log
 
Author
License
LGPL
Imports
Lastest release
version 0.2 on Jan 5th, 2011

Attempts to determine the natural language of a selection of Unicode (utf-8) text.

Based on guesslanguage.cpp by Jacob R Rideout for KDE which itself is based on Language::Guess by Maciej Ceglowski.

Detects over 60 languages - all languages listed in the trigrams directory plus Japanese, Chinese, Korean and Greek.

guess_language uses heuristics based on the character set and trigrams in a sample text to detect the language. It works better with longer samples and will be confused if the sample text includes markup such as HTML tags.

Usage

The main entry points all take a single string as input and return a language identifier. The string must be Unicode or UTF-8 text. The language identifer can be the language name in English, the two- or three-letter IANA language code, a language ID or a tuple containing all three codes.

The primary entry points, and the return values, are as follows:

System Message: WARNING/2 (<string>, line 26)

Literal block expected; none found.

guessLanguage(txt) - IANA language code guessLanguageTag(txt) - IANA language code (same as guessLanguage) guessLanguageName(txt) - Language name in English guessLanguageId(txt) - language ID guessLanguageInfo(txt) - tuple of (IANA code, id, name)

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.