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.1.tar.gz
(4.1 kB
view details)
Built Distribution
File details
Details for the file ru_soundex-1.1.1.tar.gz
.
File metadata
- Download URL: ru_soundex-1.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/37.0.0 requests-toolbelt/0.8.0 tqdm/4.17.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce2f81ef0c6aaa17c60b02ac2ae7a4ad9da431923eebd15d73b621700e9a65b0 |
|
MD5 | b74d0451f5ef1460f133e707401876fa |
|
BLAKE2b-256 | 3b6a5fd289d92a78c0b5dad192fc56676fcff0f6e92f2bde36ef569508b34285 |
File details
Details for the file ru_soundex-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: ru_soundex-1.1.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/37.0.0 requests-toolbelt/0.8.0 tqdm/4.17.1 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e50ce5a76e9563dd25880e613b0fbf0c0d7014f961e0b266d12c80573e6a64a0 |
|
MD5 | 0ecedd5b079970ac541eea969efb4ba7 |
|
BLAKE2b-256 | 06edfc73cb44ec79ca9fd0aef7ff5ade91436c025baa24f46307d71599820eab |