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

[RFE] Add the ability to check for non-desirable words #148

Closed
pmatulis opened this issue Apr 1, 2022 · 4 comments
Closed

[RFE] Add the ability to check for non-desirable words #148

pmatulis opened this issue Apr 1, 2022 · 4 comments

Comments

@pmatulis
Copy link

pmatulis commented Apr 1, 2022

This seems like an obvious one but I don't see it in the documentation. How can Sphinx be informed of non-desirable words?

@dhellmann
Copy link
Member

What does "non-desirable" mean?

@pmatulis
Copy link
Author

pmatulis commented Apr 2, 2022

Those words which I do not want to have used. Like a blacklist (denylist?).

@dhellmann
Copy link
Member

The PyEnchant filter API won't quite do what you want, since that only emits words that should be checked against the dictionary.

One way would be to modify the checker to understand about alternative ways to check words besides the dictionary, and then you can add the set of undesirable words via a configuration option with a filename just like we do for the custom dictionary. https://github.com/sphinx-contrib/spelling/blob/master/sphinxcontrib/spelling/checker.py#L51

On the other hand, it might make more sense to create a separate builder. One limitation of the spelling builder is that it only looks at one word at a time after passing them through the PyEnchant tokenizer. Creating your own builder would let you process the text yourself, and open up features like preventing the use of multi-word phrases (lingo, slang, etc.). https://github.com/sphinx-contrib/spelling/blob/master/sphinxcontrib/spelling/builder.py#L165

@dhellmann
Copy link
Member

I think this is a dupe of #120 so I'm going to close it and track any future work in this area on that ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants