Code Monkey home page Code Monkey logo

pylev2's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pombredanne

pylev2's Issues

Algorithm seems to be non-deterministic, doesn't return 0 distance for levenshtein(a, a)

I'm surprised by the following output:

$ cat test.py
import pylev2

test_case = "00000001100111011000100011000000100011100011101000001000001000001000010011111110001000000010111111111011001000001001001111111110001000001000100111111110001000000101100011111100101000100000000010111101001110110000100011110000000001100010000011101101111111011110100011010000111101010010110000010000110000001010110100000000110000000001000011111011101011010011101000001000010010100100101001001010010010100000100111000000100011010011100100001000010011000000000011000110000000001000110110001101100011011101011111000001110100111101010011000101110011001100000111001110110001001010000011000100110010011101001111001011101000001101001111001001110001001100010110100000101000111011001010001101100011011101000011010010110001011101001111010011101000001100000111001110110110011010000011001011110001011101100110100000110101001100111110100000110100101100010111000010110011111100111111010100101011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
for i in xrange(10):
print pylev2.levenshtein(test_case, test_case)

$ python test.py
0
55
1152
55
55
55
0
128
55
0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.