Conversation
| @@ -0,0 +1,110 @@ | |||
| //! Spell checking in theorem comments and section headers. | |||
| //! | |||
| //! This goes through each statement and parses the comments, ignoring HTML and italics, and stopping at the parentheticals. | |||
There was a problem hiding this comment.
It is possible for words to appear between parentheticals, for example with revision reasons. Would it make more sense to just ignore parentheticals?
(Note to self: parentheticals refers to standard Contributed by Revised by etc statements)
There was a problem hiding this comment.
Yes, this way I miss those revision reasons, which appear between parentheticals. I went for the easy solution here.
Ideally parenthetical would be left off or treated as a special CommentItem in the CommentParser iterator, this might be added at a later time, and would simplify this treatment.
Similarly, the lines of =-=-=-= in section headers are currently treated the same way and parsed for spellchecking, but it's not a big issue.
This adds spell checking for theorem comments and section headers.
The new function is added in
metamath-knifeonly, there are a few supporting changes tometamath-rs.The function is conditional to the feature
spell_check(but maybe this is not necessary?)Spell checking goes through each statement and parses the comments, ignoring HTML and italics, and stopping at the parentheticals.
The
zspellrust library is used for spellchecking.The
add_word$jcommand allows to append custom words to the dictionary.The dictionary included has been taken from https://github.com/wooorm/dictionaries/tree/main/dictionaries/en.
The dictionary format is described here: https://manpages.ubuntu.com/manpages/bionic/man5/hunspell.5.html.