drahnr / cargo-spellcheck

Checks all your documentation for spelling and grammar mistakes with hunspell and a nlprule based checker for grammar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vulgar fractions and single emojis are detected as mistakes

drahnr opened this issue · comments

Describe the bug

is marked as error.

To Reproduce

Steps to reproduce the behaviour:

  1. A file containing
  2. Run cargo-spellcheck $file
  3. See the thing marked as possible spelling mistake

Expected behavior

Accept it and be happy.

Please complete the following information:

  • System: Fedora
  • Obtained: cargo
  • Version:

This should be rather simple, checking single characters, that are detected as mistakes, if they are on certain sections of the unicode code pages.

I will give it a try, can you assign it to me @drahnr thanks!

Potential solution path: check the character category: https://lib.rs/crates/unicode-general-category with the unicode charcter properties listed here: https://www.unicode.org/reports/tr44/#Extended_Pictographic

Edit: https://docs.rs/unic/0.9.0/unic/ seems to be more comprehensive and provides fn is_emoji i.e.