Use builtin dictionary' instead of external lexic'

This commit is contained in:
Gerard Vermeulen 2022-10-12 06:08:27 +02:00
parent c21ff1df05
commit f4d2e5d712

View File

@ -3354,13 +3354,92 @@ the future.
(setq ok (= (aref word head) (aref word tail))))))
#+end_src
*** [[https://github.com/tecosaur/lexic#readme][Emacs LEXICal information viewer]]
*** [[https://dict.org/bin/Dict][DICT.org]]
:PROPERTIES:
:CUSTOM_ID: sec:writing-dict
:END:
Evaluating src_emacs-lisp{(dictionary)} connects to a local or remote =dictd=
server. The following links explain how to configure and use =dictd=:
1. [[https://jpmens.net/2020/03/08/looking-up-words-with-dict/][Looking up words with DICT]]
2. [[https://www.rfc-editor.org/rfc/rfc2229.html][RFC 2229: A Dictionary Server Protocol]]
3. [[https://www.masteringemacs.org/article/wordsmithing-in-emacs][Wordsmithing in Emacs]]
I am using the following Debian Bullseye dictionaries on Darwin and Gentoo:
1. [[http://ftp.fr.debian.org/debian/pool/main/d/dict-gcide/dict-gcide_0.48.5+nmu1_all.deb][dict-gcide_0.48.5+nmu1_all.deb]]
2. [[http://ftp.fr.debian.org/debian/pool/main/d/dict-devil/dict-devil_1.0-13.1_all.deb][dict-devil_1.0-13.1_all.deb]]
3. [[http://ftp.fr.debian.org/debian/pool/main/d/dict-foldoc/dict-foldoc_20201018-1_all.deb][dict-foldoc_20201018-1_all.deb]]
4. [[http://ftp.fr.debian.org/debian/pool/main/d/dict-jargon/dict-jargon_4.4.7-3.1_all.deb][dict-jargon_4.4.7-3.1_all.deb]]
5. [[http://ftp.fr.debian.org/debian/pool/main/v/vera/dict-vera_1.24-1_all.deb][dict-vera_1.24-1_all.deb]]
6. [[http://ftp.fr.debian.org/debian/pool/main/w/wordnet/dict-wn_3.0-36_all.deb][dict-wn_3.0-36_all.deb]]
#+caption[Resource file for =dict= on =Darwin=]:
#+caption: Resource file for =dict= on =Darwin=.
#+name: lst:darwin-dict-resource-file
#+header: :tangle (if (eq 'darwin system-type) "~/.dictrc" "no")
#+begin_src conf
# https://jpmens.net/2020/03/08/looking-up-words-with-dict/
server 127.0.0.1 {
port 2628
}
# Local Variables:
# mode: conf-unix
# End:
#+end_src
#+caption[Make a configuration file for =dictd= on =Darwin=]:
#+caption: Make a configuration file for =dictd= on =Darwin=.
#+name: lst:dictd-configuration-file
#+begin_src shell :eval (if (eq 'darwin system-type) "yes" "never") :results silent
cat > ~/.dictd.conf <<EOF
# https://www.masteringemacs.org/article/wordsmithing-in-emacs
database devil {
data "${HOME}/.local/share/dictd/devil.dict.dz"
index "${HOME}/.local/share/dictd/devil.index"
}
database foldoc {
data "${HOME}/.local/share/dictd/foldoc.dict.dz"
index "${HOME}/.local/share/dictd/foldoc.index"
}
database gcide {
data "${HOME}/.local/share/dictd/gcide.dict.dz"
index "${HOME}/.local/share/dictd/gcide.index"
}
database jargon {
data "${HOME}/.local/share/dictd/jargon.dict.dz"
index "${HOME}/.local/share/dictd/jargon.index"
}
database vera {
data "${HOME}/.local/share/dictd/vera.dict.dz"
index "${HOME}/.local/share/dictd/vera.index"
}
database wn {
data "${HOME}/.local/share/dictd/wn.dict.dz"
index "${HOME}/.local/share/dictd/wn.index"
}
EOF
#+end_src
#+caption[Run =dictd= in debug mode on =Darwin=]:
#+caption: Run =dictd= in debug mode on =Darwin=.
#+name: lst:darwin-dictd-launch
#+begin_src shell :eval never :tangle no
# https://jpmens.net/2020/03/08/looking-up-words-with-dict/
/usr/local/sbin/dictd \
--config .dictd.conf \
--verbose \
--logfile .dictd.log \
-d nodetach
#+end_src
*** [[https://github.com/tecosaur/lexic#readme][Emacs LEXICal information viewer]] :noexport:
:PROPERTIES:
:CUSTOM_ID: sec:writing-lexic
:header-args:emacs-lisp: :tangle no
:END:
The [[https://github.com/tecosaur/lexic#readme][Emacs LEXICal information viewer]] is a front-end for offline dictionary,
etymology, or thesaurus back-ends (current limited to [[https://en.wikipedia.org/wiki/Sdcv][sdcv]]). Listing
etymology, or thesaurus back-ends (currently limited to [[https://en.wikipedia.org/wiki/Sdcv][sdcv]]). Listing
[[lst:configure-lexic]] configures [[https://github.com/tecosaur/lexic#readme][lexic]].
#+attr_latex: :options breaklines