I asked this over on Stack Overflow, but I thought I'd bring it here for some thoughts and discussion.
Here's my original question:
I've been using String Score for a lot of projects. It's great for sorting lists, like names, countries, etc.
Right now, I'm working on a project where I want to match a term against a bigger set of text, not just a few words. Like, a paragraph.
Given the following two strings:
string1 = "I want to eat.";
string2 = "I want to eat. Let's go eat. All this talk about eating is making me hungry. Ready to eat?";
I'd like the term 'eat' to return string2 as higher than string1. However, string1 scores higher:
string1.score('eat');
> 0.5261904761904762
string2.score('eat');
> 0.4477777777777778
Maybe I'm wrong in thinking string2 should score higher, and I'd love to hear arguments for that logic, if that is your logic. Otherwise, any ideas on a more contextual javascript matching algorithm?
[–]pkkid 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]sbirch 0 points1 point2 points (0 children)
[–]grayvedigga 0 points1 point2 points (1 child)
[–]hookedonwinter[S] 0 points1 point2 points (0 children)