Splitting Russian words into phonetic syllables
Project description
rusyll
Python 3 package for dividing Russian words into phonetic syllables.
About
This package provides algorithmic phonetic syllable division for Russian language, similar to nltk SyllableTokenizer, but adding some language-specific rules.
In fact, there are no unified rules for breaking words into syllables in Russian. Therefore I've selected the most applicable rule set developed by R. I. Avanesov, professor of MSU, in 50s. In short it's based on the sonority index of the letters.
This package can be useful for various Natural Language applications. However, it is not suitable for hyphenation.
Installation
pip install rusyll
How to use
>>> from rusyll import rusyll
>>> rusyll.token_to_syllables("черепаха")
['че', 'ре', 'па', 'ха']
>>> rusyll.word_to_syllables("черепаха-гофер")
['че', 'ре', 'па', 'ха', 'го', 'фер']
>>> rusyll.word_to_syllables_wd("черепаха-гофер")
['че', 'ре', 'па', 'ха', '-', 'го', 'фер']
>>> rusyll.word_to_syllables_safe("черепаха гофер")
>>> Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/toor_2/wonder/Python/rusyll/src/rusyll/rusyll.py",
line 125, in word_to_syllables_safe
assert bool(AssertionError: Word contains unsuitable symbols
>>> rusyll.word_to_syllables_safe("черепаха-гофер")
['че', 'ре', 'па', 'ха', 'го', 'фер']
>>> help(rusyll)
#...complete description of functions
Feedback
This is my first attempt to make proper package for PyPI, so any feedback is highly appreciated!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rusyll-0.1.1.tar.gz
.
File metadata
- Download URL: rusyll-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.8.3 Linux/4.19.104-microsoft-standard
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c11e7ee8cb6f5f14adba19869e007ec7a2e1c49835059ca286b40752b7f7bc6e |
|
MD5 | cbcc3d3f9b276407c72c60fc18a2bd4a |
|
BLAKE2b-256 | 538b82d9fbfa3a2bf6e864c0c8dfb80e4cc51a5d70c5500cdd559bc3ed56347c |
File details
Details for the file rusyll-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: rusyll-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.8.3 Linux/4.19.104-microsoft-standard
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3d1490aaa00f8f3a0315721565c3a358f397b7ef28e439d9ffa78c26070a4fa |
|
MD5 | 62aa6817999685f032b600825cd70048 |
|
BLAKE2b-256 | 7ab6e614c16bc90ec2d2f7efc40923d17446e095318b5e55ac29bb798e3a7af4 |