guess-language

Guess the natural language of a text
Download

guess-language Ranking & Summary

Advertisement

  • Rating:
  • License:
  • LGPL
  • Publisher Name:
  • Kent Johnson
  • Publisher web site:
  • http://code.google.com/u/kent3737/

guess-language Tags


guess-language Description

Guess the natural language of a text guess-language 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.UsageThe 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:guessLanguage(txt) - IANA language codeguessLanguageTag(txt) - IANA language code (same as guessLanguage)guessLanguageName(txt) - Language name in EnglishguessLanguageId(txt) - language IDguessLanguageInfo(txt) - tuple of (IANA code, id, name) Requirements: · Python


guess-language Related Software