Could I please have some help with pyspelling in a CI pipeline? #173
-
Hi there, I am using pyspelling in Github Actions with the following .spellcheck.yaml file:
In the CI pipeline I see that it is running this command:
What happens if a word is duplicated inside of the dictionary? I think it might be related to that. Also is there any way to get it to not print the contents of each file that it is checking? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
I would need a minimal reproducible example so that I could troubleshoot the issue. If you can provide that, I might be able to help. I just don't have enough context about your environment to guess what your issue is.
Nothing, it should work fine.
There are a couple levels of verbose. You can add increasing |
Beta Was this translation helpful? Give feedback.
-
Yes, it seems you're right, the problem is with the apostrophes. In the minimal example, attached, the word Rahash does not appear in the list of misspelled words, although Rahash’s (with an apostrophe) does, even though it's in the dictionary. Edit: For some reason, the word Imuşay gets flagged up in as misspelled even when it's in the dictionary.
Edit: it turns out that the HTML you see below was actually added by https://github.com/rojopolis/spellcheck-github-actions not pyspelling. I configured my CI to use pyspelling directly (installing all the dependencies and stuff) and now I get much more manageable output. |
Beta Was this translation helpful? Give feedback.
-
Aspell doesn't actually have intelligent handling for possessive words. You basically have two options when dealing with possessive words.
|
Beta Was this translation helpful? Give feedback.
-
@Alex-Bujorianu Did I answer your questions? Do you have others? |
Beta Was this translation helpful? Give feedback.
-
Hi Isaac, yes, thanks for answering my question. Adding the possessive form to the dictionary did not make any difference (at least not with ’ instead of '). I will try using the regex filter and get back to you. Edit: the following code is parsed but makes no difference, the possessive forms show up as mis-spelled.
The difference seems to be the use of the ’ character instead of '. |
Beta Was this translation helpful? Give feedback.
-
Keep in mind that I used two - pyspelling.filters.context:
context_visible_first: true
delimiters:
# Ignore possessive endings
- open: '(?<=\w)’s(?!\w)'
close: '\b' |
Beta Was this translation helpful? Give feedback.
-
Thanks very much, that filtered out a lot of output and actually helped me catch a typo! I will close this PR now. It may be helpful to include the example in the documentation, as filtering the possessive form is a very common use-case, especially in a book. |
Beta Was this translation helpful? Give feedback.
-
Yeah, this may be a good idea. It is easier than duplicating a word with possessive forms in the dictionary, and this question surfaces in different places now and then. |
Beta Was this translation helpful? Give feedback.
Aspell doesn't actually have intelligent handling for possessive words. You basically have two options when dealing with possessive words.
Add the possessive form to the dictionary.
Create a filter that will ignore the possessive part of the word. By ignoring
's
, the word will be treated as a non-possessive word.