计算用于索引或模糊匹配的字符串的语音键
phonetics的Python项目详细描述
语音模块使用不同的算法计算字符串的语音键。
- Soundex
- NYSISS
- Metaphone
- Double Metaphone
目录
Installation
Latest development release on github
拉入并安装到当前目录:
pip install -e git+https://github.com/Zack--/phonetics.git@master#egg=phonetics
Running tests
$ python -m unittest discover phonetics/tests/ -v
或
nosetests --with-coverage --cover-package=phonetics
Usage
>>>importphonetics>>>phonetics.dmetaphone('Danger')('TNJR','TNKR')
Module Contents
phonetics模块定义了以下函数:
- phonetics。soundex(source[,size=4])
- 使用soundex算法创建source字符串的语音键。
- phonetics。nysis(source)
- 使用纽约州识别和情报系统创建source字符串的语音键。
- phonetics。metaphone(source)
- 使用变音算法创建source字符串的语音键。
- phonetics。dmetaphone(source)
- 使用双美沙酮算法创建source字符串的语音键。