| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The purpose of this repo is to provide a well tested basic python implementation of levenshein / WER so it can be shared across projects. It's based on this with a couple of minor changes.
>>> wer("the cat sat on the mat", "the mat sat on the cat")
0.3333333333333333Run with: PYTHONPATH=$(pwd) python3 -m unittest discover . Results:
rob@rob-T480s:~/projects/SimplePythonWER (master)$ PYTHONPATH=$(pwd) python3 -m unittest discover .
..
----------------------------------------------------------------------
Ran 9 tests in 0.001s
OK
from simplepythonwer.simplepythonwer import *
import timeit
sentence = "the cat sat on the mat"*5
print(timeit.timeit('levenshtein(sentence, sentence[::-1])', number=10000, globals=globals()))
print(timeit.timeit('levenshtein_original(sentence, sentence[::-1])', number=10000, globals=globals()))
38.16882774699479
44.751817572047| Back | FazBrowse Home | New Git URL |