You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, due to minor typo or an extra space here and there, a match is not successful and queries throw the error. Due to the typo being non-obvious (like double-space or a dash instead of em-dash etc), it isn't always an instantaneous pin-point to where the problem is.
I think it might be very useful for the users if they see something like this:
Unable to find an element with exact match: 15-25
Found close matches. Did you mean one of these:
15–25
19–22
<div><ul> ... </ul></div>
Suggested implementation:
When a candidate node is tested for a match, also calculate levenshtein distance from its textContent to the target string, and push the score to an array (along with the node itself). After all nodes are tested, and no match is found, sort the array on distance score and suggest top 3 close candidates to the user.
The text was updated successfully, but these errors were encountered:
I've considered this and think it would be really cool. However, I'm worried that this will be very challenging to do well. I don't have the bandwidth to work on it myself, but I would be willing to look at a pull request for it.
Describe the feature you'd like:
Sometimes, due to minor typo or an extra space here and there, a match is not successful and queries throw the error. Due to the typo being non-obvious (like double-space or a dash instead of em-dash etc), it isn't always an instantaneous pin-point to where the problem is.
I think it might be very useful for the users if they see something like this:
Suggested implementation:
When a candidate node is tested for a match, also calculate levenshtein distance from its
textContent
to the target string, and push the score to an array (along with the node itself). After all nodes are tested, and no match is found, sort the array on distance score and suggest top 3 close candidates to the user.The text was updated successfully, but these errors were encountered: