Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive on "Pass" #110

Closed
nscherer opened this issue Nov 23, 2018 · 4 comments
Closed

False positive on "Pass" #110

nscherer opened this issue Nov 23, 2018 · 4 comments
Labels
Bug Something isn't working

Comments

@nscherer
Copy link

Description

This text: "I’ve been waiting for the first decent snow at Snoqualmie Pass"
was rendered as "I’ve been waiting for the first decent snow at Snoqualmie P***"

Later, when "pass" was not capitalized, it was handled correctly.

Details (Bugs Only)

Firefox Version: 63.0.3 64 bit
Extension Version: don't know, I don't see where this is displayed
Operating System: Windows 10
Site(s) Affected: I assume any but found here in the comments: https://jalopnik.com/reminder-yes-you-absolutely-need-winter-tires-even-if-1830590607

Steps to reproduce (Bugs only)

Other details

Screenshots

@richardfrost
Copy link
Collaborator

Thanks for submitting this issue, I'm sorry that its filtering a word that it shouldn't be. Unfortunately this is happening due to how the page is structured, as shown below:

image

When the filter analyzes the text, it is getting it in pieces. So, the first piece that it gets is: "I live in the PNW too (25", then it gets the next piece, " minutes from Seattle)...", and so on. By the time it gets to the "False positive", you can see that the word Pass was split between two of these pieces.

Unfortunately, I am not sure the best way to address this, but at least we can explain why it is happening. There shouldn't be a false positive with the word "pass", which you can verify in other places, but this instance makes it tough. I will need some time to see if I can find a good way to address this.

@duckbrain
Copy link

Sounds like problem is that the text is being split up into separate text nodes.

I haven't tested to see if that solves the problem, but a simpler solution could be to just call Node#normalize before the search.

@richardfrost
Copy link
Collaborator

Thanks for the suggestions! I will take a look at the implementation when I get some time, but that blog post and accompanying demo look promising.

Unfortunately normalize doesn't seem to work in this instance, and it has the drawback of usually formatting.

@richardfrost
Copy link
Collaborator

Thanks to @duckbrain for pointing me to that wonderful library, I have now released version 2.0.0 which should address the issue when running in Advanced mode. I am hesitant to use the library everywhere because I did observe some slowdown, though not significant. Please let me know if it works for you in advanced mode, or if you have any more concerns or comments.

@richardfrost richardfrost added the Bug Something isn't working label May 17, 2019
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

No branches or pull requests

3 participants