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

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

aspell dictionaries


From: Sébastien Vauban
Subject: aspell dictionaries
Date: Wed, 08 Dec 2010 15:27:17 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hello,

In order to make my .emacs more robust to different PC installations, I would
like to test for the presence of the French dictionary before loading it.
Something like the following:

--8<---------------cut here---------------start------------->8---
(setq ispell-dictionary-alist
      ;; those not here will result in "undefined dictionary"
      '(
        ;; default
        (nil
         "[A-Za-z]" "[^A-Za-z]"
         "[']" nil ("-B") nil iso-8859-1)

        ;; Yankee English
        ("en_US"
         "[A-Za-z]" "[^A-Za-z]"
         "[']" nil ("-B") nil utf-8)))

;; standard French
(when (file-exists-p "/usr/lib/aspell/fr_FR")
                           ; file can be opened for reading
  (add-to-list 'ispell-dictionary-alist
               '("fr_FR"
                 "[a-zàâäéèêëîïôöùûüçA-ZÀÂÄÉÈÊËÎÏÔÖÙÛÜÇ]" 
"[^a-zàâäéèêëîïôöùûüçA-ZÀÂÄÉÈÊËÎÏÔÖÙÛÜÇ]"
                 "[-']" t nil "~list" utf-8)
               'append))
--8<---------------cut here---------------end--------------->8---

My questions are:

- which file do I have to test for its existence?  There are so many different
  files for every language (not to mention differences between ispell, aspell
  and hunspell dictionaries).

  Just an extract of /usr/lib/aspell/:

--8<---------------cut here---------------start------------->8---
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr-40.multi
  lrwxrwxrwx   1 root root     30 2010-09-03 10:44 fr-40-only.rws -> 
/var/lib/aspell/fr-40-only.rws
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr-60.multi
  lrwxrwxrwx   1 root root     30 2010-09-03 10:44 fr-60-only.rws -> 
/var/lib/aspell/fr-60-only.rws
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr-80.multi
  lrwxrwxrwx   1 root root     30 2010-09-03 10:44 fr-80-only.rws -> 
/var/lib/aspell/fr-80-only.rws
  -rw-r--r--   1 root root     78 2002-10-12 20:55 francais-40.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 francais-60.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 francais-80.alias
  -rw-r--r--   1 root root     75 2002-10-12 20:55 francais.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 francais-lrg.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 francais-med.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 francais-sml.alias
  -rw-r--r--   1 root root     97 2002-10-12 20:55 fr_CH-40.multi
  -rw-r--r--   1 root root    116 2002-10-12 20:55 fr_CH-60.multi
  -rw-r--r--   1 root root    135 2002-10-12 20:55 fr_CH-80.multi
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr_CH-lrg.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr_CH-med.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr_CH.multi
  lrwxrwxrwx   1 root root     30 2010-09-03 10:44 fr_CH-only.rws -> 
/var/lib/aspell/fr_CH-only.rws
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr_CH-sml.alias
  -rw-r--r--   1 root root    126 2002-10-12 20:55 fr.dat
  -rw-r--r--   1 root root     78 2002-10-12 20:55 french-40.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 french-60.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 french-80.alias
  -rw-r--r--   1 root root     75 2002-10-12 20:55 french.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 french-lrg.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 french-med.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 french-sml.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr_FR-40.multi
  -rw-r--r--   1 root root     97 2002-10-12 20:55 fr_FR-60.multi
  -rw-r--r--   1 root root    116 2002-10-12 20:55 fr_FR-80.multi
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr_FR-lrg.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr_FR-med.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr_FR.multi
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr_FR-sml.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr-lrg.alias
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr-med.alias
  -rw-r--r--   1 root root     75 2002-10-12 20:55 fr.multi
  -rw-r--r--   1 root root   2931 2001-06-13 05:16 fr_phonet.dat
  -rw-r--r--   1 root root     78 2002-10-12 20:55 fr-sml.alias
--8<---------------cut here---------------end--------------->8---

  and of /var/lib/aspell/:

--8<---------------cut here---------------start------------->8---
  -rw-r--r--  1 root root  5826736 2010-09-03 10:44 fr-40-only.rws
  -rw-r--r--  1 root root 11590736 2010-09-03 10:44 fr-60-only.rws
  -rw-r--r--  1 root root   334880 2010-09-03 10:44 fr-80-only.rws
  -rw-r--r--  1 root root     2816 2010-09-03 10:44 fr_CH-only.rws
  -rw-r--r--  1 root root        8 2010-09-03 10:44 fr.compat
--8<---------------cut here---------------end--------------->8---

- How to alias fr_FR to the right dictionary files?

Best regards,
  Seb

-- 
Sébastien Vauban


reply via email to

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