langdetect-py


Namelangdetect-py JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/DoodleBears/langdetect
SummaryLanguage detection library ported from Google's language-detection.
upload_time2024-06-30 20:53:49
maintainerNone
docs_urlNone
authorDoodleBear
requires_pythonNone
licenseCopyright 2014-2015 Michal "Mimino" Danilak Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords language detection library
VCS
bugtrack_url
requirements six
Travis-CI
coveralls test coverage No coveralls.
            langdetect
==========

[![Build Status](https://travis-ci.org/Mimino666/langdetect.svg?branch=master)](https://travis-ci.org/Mimino666/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.6, 2.7, 3.x.


Basic usage
===========

To detect the language of the text:

```python
>>> 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:

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

**IMPORTANT**

Language detection algorithm is non-deterministic, which means that if you try to run it on a text which is either too short or too ambiguous, you might get different results everytime you run it.

To enforce consistent results, call following code before the first language detection:

```python
from langdetect import DetectorFactory
DetectorFactory.seed = 0
```

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 unit tests) are unchanged, so for more information see the project's website or wiki.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DoodleBears/langdetect",
    "name": "langdetect-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "language detection library",
    "author": "DoodleBear",
    "author_email": "yangmufeng233@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/09/6a/fb44ea19ea63b2f476900c700af56d05d6a8171f8317744f6a52935f61fa/langdetect-py-1.1.1.tar.gz",
    "platform": null,
    "description": "langdetect\n==========\n\n[![Build Status](https://travis-ci.org/Mimino666/langdetect.svg?branch=master)](https://travis-ci.org/Mimino666/langdetect)\n\nPort of [language-detection](https://code.google.com/p/language-detection/) (version from 03/03/2014) library to Python.\n\n\nInstallation\n============\n\n    $ pip install langdetect\n\nSupported Python versions 2.6, 2.7, 3.x.\n\n\nBasic usage\n===========\n\nTo detect the language of the text:\n\n```python\n>>> from langdetect import detect\n>>> detect(\"War doesn't show who's right, just who's left.\")\n'en'\n>>> detect(\"Ein, zwei, drei, vier\")\n'de'\n```\n\nTo find out the probabilities for the top languages:\n\n```python\n>>> from langdetect import detect_langs\n>>> detect_langs(\"Otec matka syn.\")\n[sk:0.572770823327, pl:0.292872522702, cs:0.134356653968]\n```\n\n**IMPORTANT**\n\nLanguage detection algorithm is non-deterministic, which means that if you try to run it on a text which is either too short or too ambiguous, you might get different results everytime you run it.\n\nTo enforce consistent results, call following code before the first language detection:\n\n```python\nfrom langdetect import DetectorFactory\nDetectorFactory.seed = 0\n```\n\nMore information\n================\n\nThis 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 unit tests) are unchanged, so for more information see the project's website or wiki.\n\n\n",
    "bugtrack_url": null,
    "license": "Copyright 2014-2015 Michal \"Mimino\" Danilak  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
    "summary": "Language detection library ported from Google's language-detection.",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/DoodleBears/langdetect"
    },
    "split_keywords": [
        "language",
        "detection",
        "library"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "338598532c24110055b5f7601e1bae17e894c5205f9c22e4845346e232a7f121",
                "md5": "845f2e25033303236b839d2ed89084e0",
                "sha256": "f31023136acc964992b9257d83af04f13116b89f026139d52da3567e462e38ee"
            },
            "downloads": -1,
            "filename": "langdetect_py-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "845f2e25033303236b839d2ed89084e0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1003504,
            "upload_time": "2024-06-30T20:53:44",
            "upload_time_iso_8601": "2024-06-30T20:53:44.466959Z",
            "url": "https://files.pythonhosted.org/packages/33/85/98532c24110055b5f7601e1bae17e894c5205f9c22e4845346e232a7f121/langdetect_py-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "096afb44ea19ea63b2f476900c700af56d05d6a8171f8317744f6a52935f61fa",
                "md5": "1d7ed5f67c4d22df4e0355129cc90d99",
                "sha256": "12647e1a3f9d4e719e7f3e4a5c3464198436b6713a6bdd2973ad9ae08c98f8af"
            },
            "downloads": -1,
            "filename": "langdetect-py-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1d7ed5f67c4d22df4e0355129cc90d99",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 989936,
            "upload_time": "2024-06-30T20:53:49",
            "upload_time_iso_8601": "2024-06-30T20:53:49.042226Z",
            "url": "https://files.pythonhosted.org/packages/09/6a/fb44ea19ea63b2f476900c700af56d05d6a8171f8317744f6a52935f61fa/langdetect-py-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-30 20:53:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DoodleBears",
    "github_project": "langdetect",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "six",
            "specs": []
        }
    ],
    "lcname": "langdetect-py"
}
        
Elapsed time: 0.74436s