atom / spell-check

Spell check Atom package
MIT License
204 stars 121 forks source link

Alternate Apostrophe shows as misspelled. #280

Closed jdgwf closed 4 years ago

jdgwf commented 5 years ago

Prerequisites

Description

When a standard Ascii 39 (') apostrophe is used, contraction words are marked properly spelled. However, when I use an alternate apostrope Ascii 146 (’) the word is marked misspelled.

I write markdown with standard Ascii39 then change the written pages with smart-quotes-plus (https://atom.io/packages/smart-quotes-plus) for export to epub and mobis

I'd like for the Ascii146 to be treated like an Ascii39 by the spell checker.

Steps to Reproduce

image image

Expected behavior: I'd expect contractions to be marked properly spelled with both characters

Actual behavior: First part of contraction is marked as a separate word then counted as a misspelled word

Reproduces how often: 100% with alternate apostrophe

dmoonfire commented 5 years ago

What operating system? The reason I ask is because Mac and Windows 10 both use a different spell-checking than the others.

jdgwf commented 5 years ago

My apologies for not specifying this. It's Linux, Specifically Ubuntu Linux 18.10, but it's doing the same behavior in 18.04 and 16.04

jdgwf commented 5 years ago

It looks like Linux (at least Ubuntu) is using the hunspell dictionaries in /usr/share/hunspell Would it be possible to patch spell-check to replace the character before comparison and still keep its speed?

dmoonfire commented 4 years ago

Looking into this, but I don't think I can figure out how to do this easily or quickly. Because we don't do word splitting, we would have to do a replace on the entire buffer before passing it over to Hunspell. So for large documents, this would effectively double the usage and probably wouldn't be very fast either.

There are some discussions about that which pretty much say the only approach is to do the S/R.

I'm going to close this issue as not solvable with Atom as the problem is integral to Hunspell which doesn't support it.