Wltr Phonetics é uma biblioteca de algoritmos fonéticos
Project description
Wltr Phonetics
WltrPhonetics é uma biblioteca Python para algoritmos fonéticos. Os seguintes algoritmos estão disponíveis:
- Soundex
- Metaphone
- Refined Soundex
- Fuzzy Soundex
- Lein
- Matching Rating Approach
Além disso, as seguintes métricas de distância:
- Hamming
- Levenshtein
Autor
👤 Walter Avelino
- StackOverFlow @walteravelino
- Github: @walteravelino
- Linkedin: @walteravelino
- DEV: @walteravelino
📝 Licença
Copyright © 2020 Walter Avelino.
Os projetos estão sob a licença MIT.
Instalação
O módulo está disponível no PyPI, basta instalar pelo pip pip install wltr-phonetics
.
Utilização
>>> from wltr_phonetics import Soundex
>>> soundex = Soundex()
>>> soundex.phonetics('Walter')
'W436'
>>> soundex.phonetics('Waltie')
'W430'
>>> soundex.sounds_like('Walter', 'Waltie')
False
A mesma API se aplica a todos os algoritmos, por exemplo:
>>> from wltr_phonetics import Metaphone
>>> metaphone = Metaphone()
>>> metaphone.phonetics('discriminação')
'TSKRMNK'
Você também pode usar o método distance(word1, word2, metric='levenshtein')
para encontrar a distância entre 2 representações fonéticas.
>>> from wltr_phonetics import RefinedSoundex
>>> rs = RefinedSoundex()
>>> rs.distance('Walter', 'Waltie')
1
>>> rs.distance('assign', 'assist', metric='hamming')
2
Créditos
O módulo foi amplamente baseado na implementação de algoritmos fonéticos encontrados em Talisman.js "Node NLP library".
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
Hashes for wltr_phonetics-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ea0ddeaf723fa9905d46ac23bb64a6410582a7406978e9afa989dbf0ef8f00d |
|
MD5 | 4404978eabcf8ac3f72fade716616f6e |
|
BLAKE2b-256 | 0165eb77adac878e492bcef9660d65bdcbf7cf39af5ea9b614533de71f08f058 |