GNUAspell / aspell

http://aspell.net
GNU Lesser General Public License v2.1
243 stars 53 forks source link

Custom "do-not-match" list? #637

Open ewa opened 1 year ago

ewa commented 1 year ago

Motivation

(a1398) Trev.Barth.(Add 27944:Seymour) By weuyng and weryng [read: weþyng] togidere of trees ofte men kepeth and defendeþ hemselue from enemyes. -- from Bartholomaeus's "De Proprietatibus Rerum", AD 1398.

I have a document in which I've typed "withing." Apparently, this is technically a word. It is the present participle of "to withe". If you are binding or beating someone with slender shoots and twigs of plants ("withes") then you are withing. I'm not sure it's really be used since the middle English period, but it's a word.

Aspell likes the word just fine:

...lib/aspell-0.60 andersoe  % echo "withing" | aspell -a
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.8)
*

It's in the en-common dictionary:

...lib/aspell-0.60 andersoe % grep 'withing' *
Binary file en-common.rws matches

And that's all fine. It is a word.

But it's also clearly not the word I meant. I mis-typed "within."

Feature Request

Can we have a mechanism for excluding words, on a configurable, per-user, basis? We already have a "custom whitelist," that is, a "match this even if the dictionary says no" list. Can we have the opposite, a "blacklist" or "don't match this, even if the dictionary says yes" list?

Many thanks!

ewa commented 1 year ago

See also issue #440.

kevina commented 1 year ago

Hi, sorry for the delay.

Excluding words will introduce a lot of special cases I would rather avoid (expecially in the suggestion code). It is actually pretty easy to create a custom dictionary. Assuming you are using American English all you need to do is:

$ aspell dump master -d en_US > en_US.wl
# edit en_US to remove any problematic words
$ aspell create master -l en ~/.aspell.en-custom.rws < en_US.wl

Then to use it:

$ aspell -d ~/.aspell.en-custom.rws ...

You can name the file anything you want.