help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Let ispell use use multiple dictionaries stored in different files.


From: Hongyi Zhao
Subject: Re: Let ispell use use multiple dictionaries stored in different files.
Date: Sun, 8 Aug 2021 11:10:11 +0800

On Sat, Aug 7, 2021 at 11:54 PM Emanuel Berg via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
> Hongyi Zhao wrote:
>
> > On Ubuntu 20.04, I noticed that ispell use the following
> > file as its completion dictionary: "/usr/share/dict/words",
> > which comes from wamerican package:
> >
> > $ apt-file search /usr/share/dict/words wamerican:
> > /usr/share/dict/words
> >
> > But I want to know if ispell can use multiple dictionaries
> > stored in different files for this purpose.
>
> Install wamerican-insane - that should be the biggest ... then
> just start type and spell, insert everything that is correct,
> using the interface. It should be more than enough
> pretty soon.

In fact, I have already installed this package some time ago. Here are
some additional comments:

There are 3 similar packages available in Ubuntu, and they all come
from wordlist project [1], as shown below:

$ apt-cache pkgnames | grep --  '^w.*-insane'
wbritish-insane
wamerican-insane
wcanadian-insane

But I still haven't figured out the convenient way to build/create the
latest insane version of English dictionary words lists from its
upstream repo, for which I've filed an issue there [2].

In my case, I first create a word list based on
Webster_s_Unabridged_3, see here [3] for more detailed steps. Then I
combine the wamerican-insane and Webster_s_Unabridged_3 into one even
bigger word list file, which includes 790592 entries at the moment:

$ awk '!a[$0]++' /usr/share/dict/american-english-insane
Webster_s_Unabridged_3.txt |
   tee ~/american-english-insane-Webster_s_Unabridged | wc
 790592  892589 8649982

[1] https://github.com/en-wl/wordlist
[2] https://github.com/en-wl/wordlist/issues/329
[3] 
https://github.com/company-mode/company-mode/issues/1146#issuecomment-886172208

> As for using multiple files, you can do a little Elisp loop
> that iterates the dictionaries.

Thank you for your instruction.

> Another alternative is this, see this discussion of virtual
> files on Linux:
>
>   
> https://unix.stackexchange.com/questions/94041/a-virtual-file-containing-the-concatenation-of-other-files
>
> But I think it is overkill for this purpose (could be cool to
> try tho), if I wanted to use several files, I'd just have
> a simple script or Makefile that merged them into a new,
> regular file, and then that's what I would use.

I agree, and thank you again for sharing your views.

Hongyi
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



reply via email to

[Prev in Thread] Current Thread [Next in Thread]