Soundex algorithm for russian, english and finnish languages
Project description
# Soundex for Russian
Russian, English and Finnish Phonetic algorithm based on Soundex.
Package has both implemented phoneme transformation into letter-number sequence and distance engine for comparison of Soundex sequences (based on Levenstein distance).
### Quick start
1. Install this package via ```pip```
```python
pip install ru-soundex
```
2. Import Soundex algorithm.
Package supports a lot of opportunities, it's possible to cut a result sequence (like in the original Soundex version) or also code vowels.
```python
from ru_soundex.soundex import RussianSoundex
soundex = RussianSoundex(delete_first_letter=True)
soundex.transform('ёлочка')
...
J070530
soundex = Soundex(delete_first_letter=True, code_vowels=True)
soundex.transform('ёлочка')
...
JA7A53A
```
> A structure of the library is scalable, `RussianSoundex` class inherits basic class `Soundex` (original for English language). In order to extend our algorithm, you need just inherit own class from `Soundex` and override methods.
3. Import Soundex distance for usage of string comparision
```python
from ru_soundex.distance import SoundexDistance
soundex = RussianSoundex(delete_first_letter=True)
soundex_distance = SoundexDistance(soundex)
soundex_distance.distance('ёлочка', 'йолочка')
...
0
```
Russian, English and Finnish Phonetic algorithm based on Soundex.
Package has both implemented phoneme transformation into letter-number sequence and distance engine for comparison of Soundex sequences (based on Levenstein distance).
### Quick start
1. Install this package via ```pip```
```python
pip install ru-soundex
```
2. Import Soundex algorithm.
Package supports a lot of opportunities, it's possible to cut a result sequence (like in the original Soundex version) or also code vowels.
```python
from ru_soundex.soundex import RussianSoundex
soundex = RussianSoundex(delete_first_letter=True)
soundex.transform('ёлочка')
...
J070530
soundex = Soundex(delete_first_letter=True, code_vowels=True)
soundex.transform('ёлочка')
...
JA7A53A
```
> A structure of the library is scalable, `RussianSoundex` class inherits basic class `Soundex` (original for English language). In order to extend our algorithm, you need just inherit own class from `Soundex` and override methods.
3. Import Soundex distance for usage of string comparision
```python
from ru_soundex.distance import SoundexDistance
soundex = RussianSoundex(delete_first_letter=True)
soundex_distance = SoundexDistance(soundex)
soundex_distance.distance('ёлочка', 'йолочка')
...
0
```
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
ru_soundex-1.1.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for ru_soundex-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f54aa6a25826ac27278f656d92a143d556aaf19972f124fe7e6551be218a60f |
|
MD5 | 1ab20f6b27b1756e781125524e3c0f91 |
|
BLAKE2b-256 | be2f4158d12a33bfb925bf785a857abf786abe49954fc672482401295a39e199 |