python类用于检测语言。
languagedet的Python项目详细描述
这个包裹是什么
languagedet包使用stopwords和trigrams实现语言检测。它有三个等级:
- languagedet.stopwords.StopWordsDetector:使用stopword列表检测语言。
- languagedet.textcat.TextCatDetector:使用libexttexcat库进行语言检测。
- languagedet.mixed.MixedDetector:使用stopWordsDetector,如果失败,则使用textCatDetector。
安装
这个包依赖于libexttextcat库。在ubuntu中安装:
$ sudo apt-get install build-essential python-dev libexttextcat-dev
现在您可以使用pip进行安装:
$ pip install languagedet
示例
In [1]: from languagedet.mixed import MixedDetector In [2]: det = MixedDetector() In [3]: det.available Out[3]: ['fr', 'en', 'de', 'it', 'da', 'fi', 'hu', 'es', 'ru', 'nl', 'pt', 'no', 'tr', 'sv'] In [4]: det('biblioteca para la detectar idioma') Out[4]: 'es'
更改日志
版本0.1.1
- 已修改setup.py。
- 添加了readme.txt。
- 添加了manifest.in以包含版本0.1中缺少的数据文件。
- 已从cython和setuptools cython中删除依赖项。
版本0.1
- 初始版本。
- 支持使用stopwords和exttextcat库的语言检测。