# lang-detect: a tool to detect language
Detecting the language for a small piece of unicode text without any dependency to other libraries.
Currently we support detecting de, en, es, fr, it, ja, nl, pl, ru, zh-hans, zh-hant, and zh-yue.
After some simple testing, we found that the result for long sentence is better.
## Method
We focus on the Basic Multilingual Plane in unicode encoding, and current language support set could be extended.
For each language, we use a uniformed ngram vector to represent the language itself. This vector can be seen at the data folder.
When we detect a text, we generate the uniformed ngram vector for this text, and just comparing the cosine value of the angle between the text vector and the language vector.
To get the language vector, we use feature articles on Wikipedia as corpus.
## Usage
cd to the project root
bin/langdetect YOUR_SENTENCE_HERE
Metadata
Release files for lang-detect 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lang_detect-0.0.1-py2.6.egg | Legacy Egg format | - | - | Details for lang_detect-0.0.1-py2.6.egg |
Release files / lang_detect-0.0.1-py2.6.egg
| Download URL | lang_detect-0.0.1-py2.6.egg |
|---|---|
| Size | 1.4 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
c1fa4a594eab61f1d2cbf9fece10f91cd5b507a7155410764c8b579c4c6e8a09
|
|
BLAKE2b-256 checksum How to use checksums |
ce63a28dd6e7a709c6d758d70cc6690b834dc769300960affd1621cbacd170c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for lang-detect 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.