1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
5 ;;; Copyright © 2017, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
6 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
8 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
9 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages dictionaries)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system python)
33 #:use-module (guix build-system trivial)
34 #:use-module (guix build-system copy)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages curl)
39 #:use-module (gnu packages emacs)
40 #:use-module (gnu packages flex)
41 #:use-module (gnu packages fribidi)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages pcre)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages readline)
47 #:use-module (gnu packages texinfo)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages tcl)
50 #:use-module (gnu packages xml))
59 (uri (string-append "mirror://gnu/vera/vera-" version
63 "1j5p679vw72bv766acbg6g89k31ynmrzlpg7s3wzy4krlwdf92xc"))))
64 (build-system trivial-build-system)
67 (use-modules (guix build utils))
69 (let* ((out (assoc-ref %outputs "out"))
70 (info (string-append out "/share/info"))
71 (html (string-append out "/share/html"))
72 (source (assoc-ref %build-inputs "source"))
73 (tar (assoc-ref %build-inputs "tar"))
74 (gz (assoc-ref %build-inputs "gzip"))
75 (texi (assoc-ref %build-inputs "texinfo")))
76 (setenv "PATH" (string-append gz "/bin"))
77 (invoke (string-append tar "/bin/tar") "xvf" source)
79 (chdir (string-append "vera-" ,version))
83 ;; Change a ‘Malformed UTF-8 character: \xd7\x34 (unexpected
84 ;; non-continuation byte 0x34, immediately after start byte
85 ;; 0xd7; need 2 bytes, got 1) in pattern match (m//)’.
87 (("320.480") "320x480"))
89 ;; XXX: Use '--force' because the document is unhappy
90 ;; with Texinfo 5 (yes, documents can be unhappy.)
91 (invoke (string-append texi "/bin/makeinfo")
92 "vera.texi" "--force" "-o"
93 (string-append info "/vera.info"))
94 (invoke (string-append texi "/bin/makeinfo")
95 "vera.texi" "--force" "--html" "-o"
96 (string-append html "/vera.html"))))
97 #:modules ((guix build utils))))
98 (native-inputs `(("texinfo" ,texinfo)
101 (home-page "https://savannah.gnu.org/projects/vera/")
102 (synopsis "List of acronyms")
104 "V.E.R.A. (Virtual Entity of Relevant Acronyms) is a list of computing
105 acronyms distributed as an info document.")
106 (license license:fdl1.3+)))
115 "mirror://gnu/gcide/gcide-" version ".tar.xz"))
118 "1n3bp91sik66z3ca7mjqbr9nck3hg5ck0c8g84xc0qnfpx5vznh2"))))
119 (build-system copy-build-system)
122 '(("." "share/gcide/" #:exclude ("COPYING")))))
123 (synopsis "GNU Collaborative International Dictionary of English")
125 "GCIDE is a free dictionary based on a combination of sources. It can
126 be used via the GNU Dico program or accessed online at
127 http://gcide.gnu.org.ua/")
128 (home-page "https://gcide.gnu.org.ua/")
129 (license license:gpl3+)))
131 (define-public diction
132 ;; Not quite a dictionary, not quite a spell checker either…
139 (uri (string-append "http://www.moria.de/~michael/diction/diction-"
142 (base32 "1z6p5x3l1a00h4v4s33qa82fznzc1jdqdnlc4dnmd9nblnrjy0fs"))))
143 (build-system gnu-build-system)
144 (synopsis "Identifies wordy and commonly misused phrases")
146 "A package providing two classic Unix commands, style and diction.
147 Diction is used to identify wordy and commonly misused phrases in a
148 body of text. Style instead analyzes surface aspects of a written
149 work, such as sentence length and other readability measures.")
150 (home-page "https://www.gnu.org/software/diction/")
151 (license license:gpl3+)))
159 (uri (string-append "http://ftp.tu-chemnitz.de/pub/Local/urz/" name
160 "/" name "-" version ".tar.gz"))
163 "0chjqs3z9zs1w3l7b5lsaj682rgnkf9kibcbzhggqqcn1pbvl5sq"))))
164 (build-system gnu-build-system)
165 (inputs `(("tk" ,tk)))
168 (modify-phases %standard-phases
174 (let ((bindir (string-append
175 (assoc-ref %outputs "out") "/bin"))
177 (assoc-ref %build-inputs "tk")
179 (sharedir (string-append
180 (assoc-ref %outputs "out")
181 "/share/applications"))
182 (libdir (string-append
183 (assoc-ref %outputs "out") "/lib")))
188 (substitute* "ding.desktop"
189 (("Exec=/usr/bin/ding")
190 (string-append "Exec=" bindir "/ding")))
191 (with-fluids ((%default-port-encoding "ISO-8859-1"))
192 (substitute* "ding" (("exec wish") (string-append "exec " wish))))
193 (substitute* "install.sh"
196 (("NEEDPROG=\"wish\"")
197 (string-append "NEEDPROG=\"" wish "\""))
198 (("DEFBINDIR=\"/usr/local/bin\"")
199 (string-append "DEFBINDIR=\"" bindir "\""))
200 (("DEFLIBDIR=\"/usr/local/lib\"")
201 (string-append "DEFLIBDIR=\"" libdir "\"")))
202 (install-file "ding.desktop" sharedir)
203 (install-file "ding.png" sharedir)
204 (invoke "./install.sh")))))))
205 (synopsis "Dictionary lookup program with a German-English dictionary")
206 (description "Ding is a dictionary lookup program for the X window system.
207 It comes with a German-English dictionary with approximately 270,000 entries.")
208 (home-page "https://www-user.tu-chemnitz.de/~fri/ding/")
209 (license license:gpl2+)))
211 (define-public grammalecte
217 (method url-fetch/zipbomb)
218 (uri (string-append "https://grammalecte.net/grammalecte/zip/"
219 "Grammalecte-fr-v" version ".zip"))
221 (base32 "1qny2l5dr08pfj2dnzmvm5gmwqz8m879ryxfaw4k8dhaacrrrf62"))))
222 (build-system python-build-system)
223 (home-page "https://grammalecte.net")
224 (synopsis "French spelling and grammar checker")
225 (description "Grammalecte is a grammar checker for the French language,
226 derived from Lightproof.
228 Grammalecte helps writing a proper French, without distracting users with
229 false positives. This grammar checker follows the principle: the less false
230 positives, the better; if it cannot know with a good chance that a dubious
231 expression is wrong, it keeps silent.
233 The package provides the command line interface, along with a server
234 and a Python library.")
235 (license license:gpl3+)))
237 (define-public translate-shell
239 (name "translate-shell")
245 (url"https://github.com/soimort/translate-shell")
246 (commit (string-append "v" version))))
247 (file-name (git-file-name name version))
249 (base32 "075vqnha21rhr1b61dim7dqlfwm1yffyzcaa83s36rpk9r5sddzx"))))
250 (build-system gnu-build-system)
253 (modify-phases %standard-phases
254 (delete 'configure) ; no configure script
255 (add-after 'unpack 'remove-unnecessary-file
256 ;; This file gets generated during the build phase.
258 (delete-file "translate")
260 (add-after 'install 'wrap-binary
261 (lambda* (#:key inputs outputs #:allow-other-keys)
262 (let* ((out (assoc-ref outputs "out"))
263 (bin (string-append out "/bin/trans"))
264 (curl (assoc-ref inputs "curl"))
265 (fribidi (assoc-ref inputs "fribidi"))
266 (rlwrap (assoc-ref inputs "rlwrap")))
269 (,(string-append out "/bin:"
274 (add-after 'install 'emacs-install
275 (lambda* (#:key inputs outputs #:allow-other-keys)
276 (let* ((out (assoc-ref outputs "out"))
277 (dest (string-append out "/share/emacs/site-lisp"))
278 (emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs")))
279 (install-file "google-translate-mode.el" dest)
280 (emacs-generate-autoloads ,name dest)))))
281 #:make-flags (list (string-append "PREFIX=" %output)
282 "NETWORK_ACCESS=no test")
283 #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils))
284 #:modules ((guix build gnu-build-system)
285 (guix build emacs-utils)
287 #:test-target "test"))
293 `(("emacs" ,emacs-minimal)
294 ("util-linux" ,util-linux))) ; hexdump, for the test
295 (home-page "https://www.soimort.org/translate-shell/")
296 (synopsis "Translations from the command line")
298 "Translate Shell (formerly Google Translate CLI) is a command-line
299 translator powered by Google Translate (default), Bing Translator,
300 Yandex.Translate and Apertium. It gives you easy access to one of these
301 translation engines from your terminal.")
302 (license license:public-domain)))
304 (define-public lttoolbox
312 "https://github.com/apertium/lttoolbox/releases/download/v"
313 version "/lttoolbox-" version ".tar.gz"))
315 (base32 "14yyrkzyqlsrii3v3ggg4dyvwlrcqcqc0aprphz5781a44jsrcwz"))))
316 (build-system gnu-build-system)
319 (modify-phases %standard-phases
321 ;; The included ./autogen.sh unconditionally runs ./configure before
322 ;; its shebangs have been patched.
324 (invoke "autoreconf" "-vfi"))))))
326 `(("libxml2" ,libxml2)))
328 `(("autoconf" ,autoconf)
329 ("automake" ,automake)
331 ("pkg-config" ,pkg-config)))
332 (home-page "http://wiki.apertium.org/wiki/Lttoolbox")
333 (synopsis "Lexical processing toolbox")
334 (description "Lttoolbox is a toolbox for lexical processing, morphological
335 analysis and generation of words. Analysis is the process of splitting a
336 word (e.g. cats) into its lemma \"cat\" and the grammatical information
337 @code{<n><pl>}. Generation is the opposite process.")
338 (license (list license:gpl2 ; main license
339 license:expat)))) ; utf8/*
341 (define-public apertium
349 "https://github.com/apertium/apertium/releases/download/v"
350 version "/apertium-" version ".tar.gz"))
353 "0lrx58ipx2kzh1pd3xm1viz05dqyrq38jbnj9dnk92c9ckkwkp4h"))
354 (file-name (string-append name "-" version ".tar.gz"))))
355 (build-system gnu-build-system)
357 `(("libxml2" ,libxml2)
359 ("lttoolbox" ,lttoolbox)
366 (url "https://github.com/apertium/apertium-get")
367 (commit "692d030e68008fc123089cf2446070fe8c6e3a3b")))
370 "0kgp68azvds7yjwfz57z8sa5094fyk5yr0qxzblrw7bisrrihnav"))))
372 ("pkg-config" ,pkg-config)
373 ;; python is only required for running the test suite
377 (modify-phases %standard-phases
378 ;; If apertium-get does not exist in the source tree, the build tries
379 ;; to download it using an svn checkout. To avoid this, copy
380 ;; apertium-get into the source tree.
381 (add-after 'unpack 'unpack-apertium-get
382 (lambda* (#:key inputs #:allow-other-keys)
383 (copy-recursively (assoc-ref inputs "apertium-get")
384 "apertium/apertium-get")
386 (home-page "https://www.apertium.org/")
387 (synopsis "Rule based machine translation system")
388 (description "Apertium is a rule based machine translation system
389 featuring a shallow-transfer machine translation engine. The design of the
390 system makes translations fast (translating tens of thousands of words per
391 second on ordinary desktop computers) and, in spite of the errors, reasonably
392 intelligible and easily correctable.")
393 (license (list license:gpl2 ; main license
394 license:expat)))) ; utf8/*