fitrat
An NLP library for Uzbek. It includes morphological analysis, transliterators, language identifiers, tokenizers and many more.
It is named after historian and linguist Abdurauf Fitrat, who was one of the creators of Modern Uzbek as well as the first Uzbek professor.
Usage
Installation
pip install fitrat
Transliteration
We used hfst library for creating transliterators. This library provides finite-state transducers, a finite-state machines that come very handy for efficient mapping one text to another.
from fitrat import Transliterator, WritingType
t = Transliterator(to=WritingType.LAT)
result = t.convert("Кеча циркка бордим.")
print(result)
# Kecha sirkka bordim.
t2 = Transliterator(to=WritingType.CYR)
result = t2.convert("Kecha sirkka bordim.")
print(result)
# Кеча циркка бордим.
While Cyrillic-Latin conversion is rule-based and simple, the converse is not true. We included special pre-compiled exceptions transducer for Latin-Cyrillic that handles all (to our knowledge) exceptions. We'll continue working on improving on our exceptions list.
If you want to compile the transliterators from source, you have to use hfst-dev or hfst library. The package uses only pre-compiled binaries and hfstol library for efficient lookup.
Language Identification
We can recognize Uzbek text, both Latin or Cyrillic. Additionally, we can recognize other major languages, such as Russian, English, Arabic and etc.
from fitrat import LanguageDetector
lang_detector = LanguageDetector()
print(lang_detector.is_uzbek("bu o'zbekchada yozilgan matn"))
# True
print(lang_detector.is_uzbek("бу нотугри йозилган булсаям, лекин узбекча матн"))
# True
print(lang_detector.is_uzbek("Текст на русском языке"))
# False
Tokenization
from fitrat import word_tokenize
s = "Bugun o'zbekchada gapirishga qaror qildim!"
print(word_tokenize(s))
# ['Bugun', "o'zbekchada", 'gapirishga', 'qaror', 'qildim', '!']
Authors
- Mukhammadsaid Mamasaidov
- Jasur Yusupov
Metadata
Release files for fitrat 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fitrat-0.0.9.tar.gz | 16.3 MB | Without provenance | Details for fitrat-0.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fitrat-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for fitrat-0.0.9-py3-none-any.whl |
Total release size: 32.1 MB
Release files / fitrat-0.0.9.tar.gz
| Download URL | fitrat-0.0.9.tar.gz |
|---|---|
| Size | 16.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cce818d4247bb29bd9c279833c66c4e736458808fcc551e4775ea1cbdbedd45e
|
|
BLAKE2b-256 checksum How to use checksums |
15a8bd57eb9098fbef77fa377e421bb314041f1b8ea2e5a6733d2b0f24562441
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.5
|
Release files / fitrat-0.0.9-py3-none-any.whl
| Download URL | fitrat-0.0.9-py3-none-any.whl |
|---|---|
| Size | 15.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fdfbaaf627420bb1a66d0061ebcf8589d7b378ca5e32e3e146bdb4d1bf5511a8
|
|
BLAKE2b-256 checksum How to use checksums |
a8f422eb8e9e7bcc846655754ce20965ee6d93af85e693c8814d7747a5e2d55f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.5
|
Security for fitrat 0.0.9
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.