一个纯粹的python levenshtein实现,它没有吓坏gpl'd。
pylev的Python项目详细描述
一个纯粹的python levenshtein实现,它没有吓坏gpl。
基于wikipedia代码示例 http://en.wikipedia.org/wiki/Levenshtein_distance。
要求
- python 2.7.x、python 3.3+或pypy 1.6.0+
用法
用法相当简单。
import pylev distance = pylev.levenshtein('kitten', 'sitting') assert(distance, 3)
许可证
新的疯牛病。
测试
设置:
$ git clone https://github.com/toastdriven/pylev.git $ cd pylev
跑步:
$ python -m unittest tests
[![生成状态](https://travis-ci.org/toastdriven/pylev.png)](https://travis-ci.org/toastdriven/pylev)
版本历史记录
1.3.0版
- Implemented a considerably faster variants (orders of magnitude).
- Tested & working on Python 2.7.4, Python 3.3.1 & PyPy 1.9.0.
1.2.0版
- Fixed all incorrect spellings of “Levenshtein” (there’s no “c” in it).
- Old methods are aliased for backward-compatibility.
1.1.0版
- Implemented a much faster variant (several orders of magnitude).
- The older variant was renamed to ^{tt1}$.
- Tested & working on Python 3.3 & PyPy 1.6.0 as well.
1.0.2版
- Python packaging is REALLY hard. Including the README this time.
1.0.1版
- Python packaging is hard. Including the README this time.
1.0.0版
- Initial release, just the naive implementation of Levenshtein.