gnu: Add cl-ana.statistical-learning.
[jackhill/guix/guix.git] / gnu / packages / dictionaries.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2017, 2018 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 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>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
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.
17 ;;;
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.
22 ;;;
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/>.
25
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 (gnu packages)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages curl)
38 #:use-module (gnu packages emacs)
39 #:use-module (gnu packages flex)
40 #:use-module (gnu packages fribidi)
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages pcre)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages readline)
46 #:use-module (gnu packages texinfo)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages tcl)
49 #:use-module (gnu packages xml))
50
51
52 (define-public vera
53 (package
54 (name "vera")
55 (version "1.23")
56 (source (origin
57 (method url-fetch)
58 (uri (string-append "mirror://gnu/vera/vera-" version
59 ".tar.gz"))
60 (sha256
61 (base32
62 "1az0v563jja8xb4896jyr8yv7jd9zacqyfkjd7psb73v7clg1mzz"))))
63 (build-system trivial-build-system)
64 (arguments
65 `(#:builder (begin
66 (use-modules (guix build utils))
67
68 (let* ((out (assoc-ref %outputs "out"))
69 (info (string-append out "/share/info"))
70 (html (string-append out "/share/html"))
71 (source (assoc-ref %build-inputs "source"))
72 (tar (assoc-ref %build-inputs "tar"))
73 (gz (assoc-ref %build-inputs "gzip"))
74 (texi (assoc-ref %build-inputs "texinfo")))
75 (setenv "PATH" (string-append gz "/bin"))
76 (invoke (string-append tar "/bin/tar") "xvf" source)
77
78 (chdir (string-append "vera-" ,version))
79 (mkdir-p info)
80 (mkdir-p html)
81
82 ;; XXX: Use '--force' because the document is unhappy
83 ;; with Texinfo 5 (yes, documents can be unhappy.)
84 (invoke (string-append texi "/bin/makeinfo")
85 "vera.texi" "--force" "-o"
86 (string-append info "/vera.info"))
87 (invoke (string-append texi "/bin/makeinfo")
88 "vera.texi" "--force" "--html" "-o"
89 (string-append html "/vera.html"))))
90 #:modules ((guix build utils))))
91 (native-inputs `(("texinfo" ,texinfo)
92 ("tar" ,tar)
93 ("gzip" ,gzip)))
94 (home-page "https://savannah.gnu.org/projects/vera/")
95 (synopsis "List of acronyms")
96 (description
97 "V.E.R.A. (Virtual Entity of Relevant Acronyms) is a list of computing
98 acronyms distributed as an info document.")
99 (license license:fdl1.3+)))
100
101 (define-public gcide
102 (package
103 (name "gcide")
104 (version "0.52")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append
108 "mirror://gnu/gcide/gcide-" version ".tar.xz"))
109 (sha256
110 (base32
111 "1n3bp91sik66z3ca7mjqbr9nck3hg5ck0c8g84xc0qnfpx5vznh2"))))
112 (build-system trivial-build-system)
113 (arguments
114 '(#:builder (begin
115 (use-modules (guix build utils))
116 (let* ((src (assoc-ref %build-inputs "source"))
117 (tar (assoc-ref %build-inputs "tar"))
118 (xz (assoc-ref %build-inputs "xz"))
119 (out (assoc-ref %outputs "out"))
120 (datadir (string-append out "/share/gcide")))
121 (set-path-environment-variable "PATH" '("bin")
122 (list tar xz))
123 (mkdir-p datadir)
124 (invoke "tar" "-C" datadir
125 "--strip-components=1"
126 "-xvf" src)))
127 #:modules ((guix build utils))))
128 (native-inputs
129 `(("tar" ,tar)
130 ("xz" ,xz)))
131 (synopsis "GNU Collaborative International Dictionary of English")
132 (description
133 "GCIDE is a free dictionary based on a combination of sources. It can
134 be used via the GNU Dico program or accessed online at
135 http://gcide.gnu.org.ua/")
136 (home-page "http://gcide.gnu.org.ua/")
137 (license license:gpl3+)))
138
139 (define-public diction
140 ;; Not quite a dictionary, not quite a spell checker either…
141 (package
142 (name "diction")
143 (version "1.11")
144 (source (origin
145 (method url-fetch)
146 (uri (string-append "mirror://gnu/diction/diction-"
147 version ".tar.gz"))
148 (sha256
149 (base32
150 "1xi4l1x1vvzmzmbhpx0ghmfnwwrhabjwizrpyylmy3fzinzz3him"))))
151 (build-system gnu-build-system)
152 (synopsis "Identifies wordy and commonly misused phrases")
153 (description
154 "A package providing two classic Unix commands, style and diction.
155 Diction is used to identify wordy and commonly misused phrases in a
156 body of text. Style instead analyzes surface aspects of a written
157 work, such as sentence length and other readability measures.")
158 (home-page "https://www.gnu.org/software/diction/")
159 (license license:gpl3+)))
160
161 (define-public ding
162 (package
163 (name "ding")
164 (version "1.8.1")
165 (source (origin
166 (method url-fetch)
167 (uri (string-append "http://ftp.tu-chemnitz.de/pub/Local/urz/" name
168 "/" name "-" version ".tar.gz"))
169 (sha256
170 (base32
171 "0chjqs3z9zs1w3l7b5lsaj682rgnkf9kibcbzhggqqcn1pbvl5sq"))))
172 (build-system gnu-build-system)
173 (inputs `(("tk" ,tk)))
174 (arguments
175 `(#:phases
176 (modify-phases %standard-phases
177 (delete 'configure)
178 (delete 'build)
179 (delete 'check)
180 (replace 'install
181 (lambda _
182 (let ((bindir (string-append
183 (assoc-ref %outputs "out") "/bin"))
184 (wish (string-append
185 (assoc-ref %build-inputs "tk")
186 "/bin/wish8.6"))
187 (sharedir (string-append
188 (assoc-ref %outputs "out")
189 "/share/applications"))
190 (libdir (string-append
191 (assoc-ref %outputs "out") "/lib")))
192 (mkdir-p bindir)
193 (mkdir-p libdir)
194 (mkdir-p sharedir)
195
196 (substitute* "ding.desktop"
197 (("Exec=/usr/bin/ding")
198 (string-append "Exec=" bindir "/ding")))
199 (with-fluids ((%default-port-encoding "ISO-8859-1"))
200 (substitute* "ding" (("exec wish") (string-append "exec " wish))))
201 (substitute* "install.sh"
202 (("/bin/cp") "cp")
203 (("/bin/mv") "mv")
204 (("NEEDPROG=\"wish\"")
205 (string-append "NEEDPROG=\"" wish "\""))
206 (("DEFBINDIR=\"/usr/local/bin\"")
207 (string-append "DEFBINDIR=\"" bindir "\""))
208 (("DEFLIBDIR=\"/usr/local/lib\"")
209 (string-append "DEFLIBDIR=\"" libdir "\"")))
210 (install-file "ding.desktop" sharedir)
211 (install-file "ding.png" sharedir)
212 (invoke "./install.sh")))))))
213 (synopsis "Dictionary lookup program with a German-English dictionary")
214 (description "Ding is a dictionary lookup program for the X window system.
215 It comes with a German-English dictionary with approximately 270,000 entries.")
216 (home-page "http://www-user.tu-chemnitz.de/~fri/ding/")
217 (license license:gpl2+)))
218
219 (define-public grammalecte
220 (package
221 (name "grammalecte")
222 (version "1.6.0")
223 (source
224 (origin
225 (method url-fetch/zipbomb)
226 (uri (string-append "https://grammalecte.net/grammalecte/zip/"
227 "Grammalecte-fr-v" version ".zip"))
228 (sha256
229 (base32
230 "0kz13gx2hd23xd6bfr4z73lh18slj3vbvs2xcb7qvhramxjqzqcn"))))
231 (build-system python-build-system)
232 (home-page "https://grammalecte.net")
233 (synopsis "French spelling and grammar checker")
234 (description "Grammalecte is a grammar checker dedicated to the French
235 language, derived from Lightproof.
236
237 Grammalecte aims at helping to write a proper French without distracting users
238 with false positives. This grammar checker follows the principle: the less
239 false positives, the better; if it cannot know with a good chance if
240 a dubious expression is wrong, it will keep silent.
241
242 The package provides the command line interface, along with a server
243 and a Python library.")
244 (license license:gpl3+)))
245
246 (define-public translate-shell
247 (package
248 (name "translate-shell")
249 (version "0.9.6.11")
250 (source
251 (origin
252 (method git-fetch)
253 (uri (git-reference
254 (url"https://github.com/soimort/translate-shell.git")
255 (commit (string-append "v" version))))
256 (file-name (git-file-name name version))
257 (sha256
258 (base32 "137fz3ahzf65hfqcs4k7hhrmfjlhlw7wr3gfsvk88bnyqkyw44sm"))))
259 (build-system gnu-build-system)
260 (arguments
261 `(#:phases
262 (modify-phases %standard-phases
263 (delete 'configure) ; no configure script
264 (add-after 'unpack 'remove-unnecessary-file
265 ;; This file gets generated during the build phase.
266 (lambda _
267 (delete-file "translate")
268 #t))
269 (add-after 'install 'wrap-binary
270 (lambda* (#:key inputs outputs #:allow-other-keys)
271 (let* ((out (assoc-ref outputs "out"))
272 (bin (string-append out "/bin/trans"))
273 (curl (assoc-ref inputs "curl"))
274 (fribidi (assoc-ref inputs "fribidi"))
275 (rlwrap (assoc-ref inputs "rlwrap")))
276 (wrap-program bin
277 `("PATH" ":" prefix
278 (,(string-append out "/bin:"
279 curl "/bin:"
280 fribidi "/bin:"
281 rlwrap "/bin")))))
282 #t))
283 (add-after 'install 'emacs-install
284 (lambda* (#:key inputs outputs #:allow-other-keys)
285 (let* ((out (assoc-ref outputs "out"))
286 (dest (string-append out "/share/emacs/site-lisp/guix.d/"
287 ,name "-" ,version))
288 (emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs")))
289 (install-file "google-translate-mode.el" dest)
290 (emacs-generate-autoloads ,name dest)))))
291 #:make-flags (list (string-append "PREFIX=" %output)
292 "NETWORK_ACCESS=no test")
293 #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils))
294 #:modules ((guix build gnu-build-system)
295 (guix build emacs-utils)
296 (guix build utils))
297 #:test-target "test"))
298 (inputs
299 `(("curl" ,curl)
300 ("fribidi" ,fribidi)
301 ("rlwrap" ,rlwrap)))
302 (native-inputs
303 `(("emacs" ,emacs-minimal)
304 ("util-linux" ,util-linux))) ; hexdump, for the test
305 (home-page "https://www.soimort.org/translate-shell/")
306 (synopsis "Translations from the command line")
307 (description
308 "Translate Shell (formerly Google Translate CLI) is a command-line
309 translator powered by Google Translate (default), Bing Translator,
310 Yandex.Translate and Apertium. It gives you easy access to one of these
311 translation engines from your terminal.")
312 (license license:public-domain)))
313
314 (define-public lttoolbox
315 (package
316 (name "lttoolbox")
317 (version "3.5.0")
318 (source
319 (origin
320 (method url-fetch)
321 (uri (string-append
322 "https://github.com/apertium/lttoolbox/releases/download/v"
323 version "/lttoolbox-" version ".tar.gz"))
324 (sha256
325 (base32
326 "08y6pf1hl7prwygy1g8h6ndqww18pmb9f3r5988q0pcrp8w6xz6b"))
327 (file-name (string-append name "-" version ".tar.gz"))))
328 (build-system gnu-build-system)
329 (inputs
330 `(("libxml2" ,libxml2)))
331 (native-inputs
332 `(("pkg-config" ,pkg-config)))
333 (home-page "http://wiki.apertium.org/wiki/Lttoolbox")
334 (synopsis "Lexical processing toolbox")
335 (description "Lttoolbox is a toolbox for lexical processing, morphological
336 analysis and generation of words. Analysis is the process of splitting a
337 word (e.g. cats) into its lemma \"cat\" and the grammatical information
338 @code{<n><pl>}. Generation is the opposite process.")
339 (license (list license:gpl2 ; main license
340 license:expat)))) ; utf8/*
341
342 (define-public apertium
343 (package
344 (name "apertium")
345 (version "3.5.2")
346 (source
347 (origin
348 (method url-fetch)
349 (uri (string-append
350 "https://github.com/apertium/apertium/releases/download/v"
351 version "/apertium-" version ".tar.gz"))
352 (sha256
353 (base32
354 "0lrx58ipx2kzh1pd3xm1viz05dqyrq38jbnj9dnk92c9ckkwkp4h"))
355 (file-name (string-append name "-" version ".tar.gz"))))
356 (build-system gnu-build-system)
357 (inputs
358 `(("libxml2" ,libxml2)
359 ("libxslt" ,libxslt)
360 ("lttoolbox" ,lttoolbox)
361 ("pcre" ,pcre)))
362 (native-inputs
363 `(("apertium-get"
364 ,(origin
365 (method git-fetch)
366 (uri (git-reference
367 (url "https://github.com/apertium/apertium-get")
368 (commit "692d030e68008fc123089cf2446070fe8c6e3a3b")))
369 (sha256
370 (base32
371 "0kgp68azvds7yjwfz57z8sa5094fyk5yr0qxzblrw7bisrrihnav"))))
372 ("flex" ,flex)
373 ("pkg-config" ,pkg-config)
374 ;; python is only required for running the test suite
375 ("python" ,python)))
376 (arguments
377 `(#:phases
378 (modify-phases %standard-phases
379 ;; If apertium-get does not exist in the source tree, the build tries
380 ;; to download it using an svn checkout. To avoid this, copy
381 ;; apertium-get into the source tree.
382 (add-after 'unpack 'unpack-apertium-get
383 (lambda* (#:key inputs #:allow-other-keys)
384 (copy-recursively (assoc-ref inputs "apertium-get")
385 "apertium/apertium-get")
386 #t)))))
387 (home-page "https://www.apertium.org/")
388 (synopsis "Rule based machine translation system")
389 (description "Apertium is a rule based machine translation system
390 featuring a shallow-transfer machine translation engine. The design of the
391 system makes translations fast (translating tens of thousands of words per
392 second on ordinary desktop computers) and, in spite of the errors, reasonably
393 intelligible and easily correctable.")
394 (license (list license:gpl2 ; main license
395 license:expat)))) ; utf8/*