joshaven / string_score

JavaScript string ranking 0 for no match upto 1 for perfect... "String".score("str"); //=> 0.825
MIT License
840 stars 62 forks source link

score demo #32

Open MAMMISAID opened 7 years ago

MAMMISAID commented 7 years ago

hello i was testing the algorithm So i tried hello and hellô and the result was 0 wtf!

joshaven commented 7 years ago

Can you send the command you tested?

You must have a fuzziness setting to accept mismatches.

[image: Inline image 1]

On Sat, Jul 1, 2017 at 1:52 PM, AMMISAID Mustapha notifications@github.com wrote:

hello i was testing the algorithm So i tried hello and hellô and the result was 0 wtf!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/joshaven/string_score/issues/32, or mute the thread https://github.com/notifications/unsubscribe-auth/AABVp4w0b_iNPr2NZLxzCryHdJ5xAGudks5sJpVegaJpZM4OLY8W .

-- Sincerely, Joshaven Potter C: 517-607-9370

Among the sins to which the human heart is prone, hardly any other is more hateful to God than idolatry, for idolatry is at bottom a libel on His character. The idolatrous heart assumes that God is other than He is - in itself a monstrous sin - and substitutes for the true God one made after its own likeness. Always this God will conform to the image of the one who created it and will be base or pure, cruel or kind, according to the moral state of the mind from which it emerges. -- A. W. Tozer

raphaklaus commented 7 years ago

Yes, it happened with me too.

var stringScore = require("string-score")

console.log(stringScore('1','1ó'))

It seems the algorithm confuses itself when adding extra characters at the end of the string.

joshaven commented 7 years ago

The third argument is required for fuzzy matching. fuzzy means a degree of matching when it isnt a match.

On Aug 31, 2017 11:12 PM, "Raphael D. Pinheiro" notifications@github.com wrote:

Yes, it happened with me too.

var stringScore = require("string-score")

console.log(stringScore('1','1ó'))

It seems the algorithm confuses itself when adding extra characters at the end of the string.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/joshaven/string_score/issues/32#issuecomment-326482630, or mute the thread https://github.com/notifications/unsubscribe-auth/AABVpzJWDvg5qd_MhOhTwne0nrTPu1Mqks5sd4QZgaJpZM4OLY8W .

raphaklaus commented 7 years ago

Ok, I didn't see it, thank you!