GlobalNamesArchitecture / damerau-levenshtein

Calculates edit distance using Damerau-Levenshtein algorithm
MIT License
135 stars 19 forks source link

allow any array of numbers to be passed into distance alg #9

Closed azhi closed 7 years ago

azhi commented 7 years ago

introduce two new methods on core module - .string_distance and .array_distance

keep .distance as a .string_distance for backward compatibility

rename C implementation to .internal_distance to avoid misinterpretation (keeping backward compatibility as well)

change C implementation to convert numbers to long long instead of int, thus supporting maximum of machine-native formats

PS: i needed that kind of stuff to run Levenshtein alg not on conventional 'string', but rather on sequence of large numbers (> MAX_INT). If you find that not useful for anyone else, feel free to close this PR.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-2.2%) to 97.826% when pulling 25a91d5d2d0110948e296c7493a36ec0ccf160fc on azhi:allow-passing-any-non-utf8-array into 750c491bda8253d95fdfe816abfbb738de98e8ef on GlobalNamesArchitecture:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-2.2%) to 97.826% when pulling 25a91d5d2d0110948e296c7493a36ec0ccf160fc on azhi:allow-passing-any-non-utf8-array into 750c491bda8253d95fdfe816abfbb738de98e8ef on GlobalNamesArchitecture:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling d59ebb6dedfa7354c2fb93e0f60380332fe71370 on azhi:allow-passing-any-non-utf8-array into 750c491bda8253d95fdfe816abfbb738de98e8ef on GlobalNamesArchitecture:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling d59ebb6dedfa7354c2fb93e0f60380332fe71370 on azhi:allow-passing-any-non-utf8-array into 750c491bda8253d95fdfe816abfbb738de98e8ef on GlobalNamesArchitecture:master.

dimus commented 7 years ago

I will add it to the master, thank you @azhi