Skip to main content

Wltr Phonetics é uma biblioteca de algoritmos fonéticos

Project description

Wltr Phonetics

PyPI

Build Status

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

📝 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wltr-phonetics-1.0.2.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

wltr_phonetics-1.0.2-py3-none-any.whl (12.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page