Skip to content

Fix StringMatcher's score calculation on distance of first match#77

Merged
jjw24 merged 9 commits intodevfrom
fix_stringmatcher_resultweighting
Jun 28, 2020
Merged

Fix StringMatcher's score calculation on distance of first match#77
jjw24 merged 9 commits intodevfrom
fix_stringmatcher_resultweighting

Conversation

@jjw24
Copy link
Member

@jjw24 jjw24 commented Jun 22, 2020

Current problem:
Part of how score is calculated with distance from first match is taking into consideration that a match found that is near the beginning of the compare string is scored more than a match found closer to the end.

So when searching for "man" in "eManual" and "Task Manager", more weight is given for 'eManual' as oppose to 'Task Manager' as the first match index in "eManual" is 1 whereas it is 5 for "Task Manager".

Solution:
When calculating the distance, consider the beginning of the distance as the space before the first match index.

So the space before "Manager" is the start of the distance calculation as oppose to using index 0 (the index of "T")

@jjw24 jjw24 added the bug Something isn't working label Jun 22, 2020
@jjw24 jjw24 self-assigned this Jun 22, 2020
jjw24 added 4 commits June 23, 2020 18:50
we expect the score to change since we updated the logic for calculating the distance from the first match
@jjw24 jjw24 changed the title Fix StringMatcher's result score weighting Fix StringMatcher's score calculation on distance of first match Jun 23, 2020
Copy link
Member

@JohnTheGr8 JohnTheGr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jjw24 jjw24 merged commit 4676a2a into dev Jun 28, 2020
@jjw24 jjw24 deleted the fix_stringmatcher_resultweighting branch June 28, 2020 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments