unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* aspell dictionaries
@ 2010-09-03  9:01 Sébastien Vauban
  0 siblings, 0 replies; only message in thread
From: Sébastien Vauban @ 2010-09-03  9:01 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-03  9:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03  9:01 aspell dictionaries Sébastien Vauban

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).