fuzzy
fuzzy copied to clipboard
DMetaphone has issues with long words
Originally reported by: Brian (Bitbucket: eode, GitHub: eode)
#!python
import fuzzy
fdm = fuzzy.DMetaphone()
fdm10 = fuzzy.DMetaphone(10)
# note that this also trounces the 's' phoneme of 'decent'
>>> fdm('decent')
['TKNT', None]
>>> fdm('decentralization')
['TKNT', None]
>>> fdm10('decentralization')
['TKNT', None]
# ..for comparison:
import metaphone
mdm = metaphone.dm
>>> mdm('decent')
('TSNT', '')
>>> mdm('decentralization')
('TSNTRLSXN', '')
Expected behavior:
- produce phonemes for the whole word, or for the word up to the length specified.
- Bitbucket: https://bitbucket.org/yougov/fuzzy/issue/5