Posts

Showing posts from August, 2018

holy math Levenshtein!

Update3:
Thanks to the person that suggested this!!!
It really helped explain some things I was really curious about.
http://norvig.com/spell-correct.html
I might have ideas now about using the nltk library of words for that probability part!
But first I need to get the insertion part working, if it's possible.
If not, time to move on!

Update2:
* Working levenshtein alg, and test
* pytest for my failed method
Now to decide if I try to fenagle a way to make my method account for insertions.
I know everyone would say:  You have a working algorithm! Don't reinvent the wheel!
Well someone at some point decided rubber on the outside of the wheel made it better
At some point wood was no longer used
At some point we attached axles and engines and drive trains
I'm not reinventing anything.  I just want to see what I can do with it.

Update 1:
*Not yet functional --
levenshtein algorithm file
No idea wh…

levenshtein algoritham.... whatever

So I recently did a codewars that it seemed, tested the results with the Levenshtein algorithm.

I will update soon, but it seems to me, it does not fully test similarity, although, the author of the kata used it to get the proper responses. ( in my opinion,  as are all humans, I can be wrong)

The one in particular that got me wondering was:

heaven:  to python
is less of a similarity than
heaven: to java

no pun intended.  I like python, but I really do think that all languages break down to a base component of, on/off, computer says: this, or that.  No matter what the language or data you feed it.

There may be a language out there that communicates desired intentions better, I need to find it.

In the meantime.

although java shares two letter similarities, heaven and python only need replace 5 characters to get intended word, 'heaven'.
while java, if you have to replace the order of the letters, to make the new word, requires 6 changes.
The tests for this kata, wanted 'java&…