gnu: calibre: Wrap QTWEBENGINEPROCESS_PATH.
[jackhill/guix/guix.git] / gnu / packages / language.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2018 Nikita <nikita@n0.is>
5 ;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
6 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages language)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages autotools)
26 #:use-module (gnu packages glib)
27 #:use-module (gnu packages gtk)
28 #:use-module (gnu packages java)
29 #:use-module (gnu packages llvm)
30 #:use-module (gnu packages man)
31 #:use-module (gnu packages ocr)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages perl-check)
36 #:use-module (gnu packages swig)
37 #:use-module (gnu packages texinfo)
38 #:use-module (gnu packages web)
39 #:use-module (gnu packages xml)
40 #:use-module (gnu packages xorg)
41 #:use-module (guix packages)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system perl)
44 #:use-module (guix build-system python)
45 #:use-module ((guix licenses)
46 #:select
47 (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
48 #:use-module (guix download)
49 #:use-module (guix git-download)
50 #:use-module (guix utils))
51
52 (define-public liblouis
53 (package
54 (name "liblouis")
55 (version "3.14.0")
56 (source
57 (origin
58 (method git-fetch)
59 (uri
60 (git-reference
61 (url "https://github.com/liblouis/liblouis.git")
62 (commit (string-append "v" version))))
63 (file-name (git-file-name name version))
64 (sha256
65 (base32 "0v6w8b9r994mkkbm2gqgd7k5yfmdhgbabh0j1gmn375nyvhy4qqh"))))
66 (build-system gnu-build-system)
67 (outputs '("out" "bin" "doc" "python"))
68 (arguments
69 `(#:configure-flags
70 (list
71 "--disable-static"
72 "--enable-ucs4")
73 #:phases
74 (modify-phases %standard-phases
75 ;; To install the sub-package "python".
76 (add-after 'install 'install-python-extension
77 (lambda* (#:key outputs #:allow-other-keys)
78 (with-directory-excursion "python"
79 (invoke "python" "setup.py" "install"
80 (string-append "--prefix="
81 (assoc-ref outputs "python"))
82 "--root=/")))))))
83 (native-inputs
84 `(("autoconf" ,autoconf)
85 ("automake" ,automake)
86 ("clang-format" ,clang)
87 ("help2man" ,help2man)
88 ("libtool" ,libtool)
89 ("libyaml" ,libyaml)
90 ("makeinfo" ,texinfo)
91 ("perl" ,perl)
92 ("pkg-config" ,pkg-config)
93 ("python" ,python-wrapper)))
94 (synopsis "Braille translator and back-translator")
95 (description "Liblouis is a braille translator and back-translator named in
96 honor of Louis Braille. It features support for computer and literary braille,
97 supports contracted and uncontracted translation for many languages and has
98 support for hyphenation. New languages can easily be added through tables that
99 support a rule- or dictionary based approach. Tools for testing and debugging
100 tables are also included. Liblouis also supports math braille, Nemeth and
101 Marburg.")
102 (home-page "http://liblouis.org/")
103 (license
104 (list
105 ;; Library
106 lgpl2.1+
107 ;; Tools
108 gpl3+))))
109
110 (define-public liblouisutdml
111 (package
112 (name "liblouisutdml")
113 (version "2.8.0")
114 (source
115 (origin
116 (method git-fetch)
117 (uri
118 (git-reference
119 (url "https://github.com/liblouis/liblouisutdml.git")
120 (commit (string-append "v" version))))
121 (file-name (git-file-name name version))
122 (sha256
123 (base32 "11xxky3crjm8bidfljzpqaz1m1i1m1yskmdpavf9b4jpf87nzjj2"))
124 (patches
125 (search-patches "liblouisutdml-fix-tests.patch"))))
126 (build-system gnu-build-system)
127 (outputs '("out" "bin" "doc"))
128 (arguments
129 `(#:configure-flags
130 (list
131 "--disable-static")))
132 (native-inputs
133 `(("autoconf" ,autoconf)
134 ("automake" ,automake)
135 ("help2man" ,help2man)
136 ("jdk" ,icedtea "jdk")
137 ("libtool" ,libtool)
138 ("makeinfo" ,texinfo)
139 ("pkg-config" ,pkg-config)))
140 (inputs
141 `(("libxml2" ,libxml2)))
142 (propagated-inputs
143 `(("liblouis" ,liblouis)
144 ("liblouis:bin" ,liblouis "bin")))
145 (synopsis "Braille transcription services")
146 (description "Liblouisutdml is a library providing complete braille
147 transcription services for xml, html and text documents. It translates into
148 appropriate braille codes and formats according to its style sheet and the
149 specifications in the document.")
150 (home-page "http://liblouis.org/")
151 (license
152 (list
153 ;; Library
154 lgpl3+
155 ;; Tools
156 gpl3+))))
157
158 (define-public libstemmer
159 (package
160 (name "libstemmer")
161 (version "2.0.0")
162 (source
163 (origin
164 (method url-fetch)
165 (uri "https://snowballstem.org/dist/libstemmer_c.tgz")
166 (sha256
167 (base32 "1z2xvrjsaaypc04lwz7dg8mjm5cq1gzmn0l544pn6y2ll3r7ckh5"))))
168 (build-system gnu-build-system)
169 (arguments
170 `(#:tests? #f ; No tests exist
171 #:make-flags
172 (list
173 (string-append "CC=" ,(cc-for-target))
174 "CFLAGS=-fPIC")
175 #:phases
176 (modify-phases %standard-phases
177 (delete 'configure)
178 (replace 'install
179 (lambda* (#:key outputs #:allow-other-keys)
180 (let* ((out (assoc-ref outputs "out"))
181 (out-bin (string-append out "/bin"))
182 (out-include (string-append out "/include"))
183 (out-lib (string-append out "/lib")))
184 (install-file "stemwords" out-bin)
185 (install-file "include/libstemmer.h" out-include)
186 (rename-file "libstemmer.o" "libstemmer.a")
187 (install-file "libstemmer.a" out-lib)
188 #t))))))
189 (synopsis "Stemming Library")
190 (description "LibStemmer provides stemming library, supporting several
191 languages.")
192 (home-page "https://snowballstem.org/")
193 (license bsd-3)))
194
195 (define-public perl-lingua-en-findnumber
196 (package
197 (name "perl-lingua-en-findnumber")
198 (version "1.32")
199 (source
200 (origin
201 (method url-fetch)
202 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
203 "Lingua-EN-FindNumber-" version ".tar.gz"))
204 (sha256
205 (base32
206 "015ximzdp42v824llwlg2pd77vd0d172lb4xs55q9f9zhqf6s5qx"))))
207 (build-system perl-build-system)
208 (propagated-inputs
209 `(("perl-lingua-en-words2nums" ,perl-lingua-en-words2nums)))
210 (home-page "https://metacpan.org/release/Lingua-EN-FindNumber")
211 (synopsis "Locate (written) numbers in English text ")
212 (description "This module provides a regular expression for finding
213 numbers in English text. It also provides functions for extracting and
214 manipulating such numbers.")
215 (license perl-license)))
216
217 (define-public perl-lingua-en-inflect
218 (package
219 (name "perl-lingua-en-inflect")
220 (version "1.903")
221 (source
222 (origin
223 (method url-fetch)
224 (uri (string-append "mirror://cpan/authors/id/D/DC/DCONWAY/"
225 "Lingua-EN-Inflect-" version ".tar.gz"))
226 (sha256
227 (base32
228 "0j8d1f1wvmgc11d71pc8xp8fv5a1nb2yfw1dgd19xhscn1klpvzw"))))
229 (build-system perl-build-system)
230 (native-inputs `(("perl-module-build" ,perl-module-build)))
231 (home-page "https://metacpan.org/release/Lingua-EN-Inflect")
232 (synopsis "Convert singular to plural")
233 (description "Lingua::EN::Inflect provides plural inflections,
234 \"a\"/\"an\" selection for English words, and manipulation of numbers as
235 words. Plural forms of all nouns, most verbs, and some adjectives are
236 provided. Where appropriate, \"classical\" variants (for example: \"brother\"
237 -> \"brethren\", \"dogma\" -> \"dogmata\", etc.) are also provided.")
238 (license perl-license)))
239
240 (define-public perl-lingua-en-inflect-number
241 (package
242 (name "perl-lingua-en-inflect-number")
243 (version "1.12")
244 (source
245 (origin
246 (method url-fetch)
247 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
248 "Lingua-EN-Inflect-Number-" version ".tar.gz"))
249 (sha256
250 (base32
251 "1gxccynkaqav43ww43jp4rzkyr36x97jd03yb5f6yx0jhn1k7yv6"))))
252 (build-system perl-build-system)
253 (propagated-inputs
254 `(("perl-lingua-en-inflect" ,perl-lingua-en-inflect)))
255 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Number")
256 (synopsis "Force number of words to singular or plural")
257 (description "This module extends the functionality of Lingua::EN::Inflect
258 with three new functions for determining plurality of a word and forcefully
259 converting a word to singular or plural.")
260 (license perl-license)))
261
262 (define-public perl-lingua-en-inflect-phrase
263 (package
264 (name "perl-lingua-en-inflect-phrase")
265 (version "0.20")
266 (source
267 (origin
268 (method url-fetch)
269 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
270 "Lingua-EN-Inflect-Phrase-" version ".tar.gz"))
271 (sha256
272 (base32
273 "1a6y1l2pjim2242wcpgz066di4pbzfgsjjdl7vg5a5wzm48qj1am"))))
274 (build-system perl-build-system)
275 (native-inputs
276 `(("perl-test-nowarnings" ,perl-test-nowarnings)))
277 (propagated-inputs
278 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)
279 ("perl-lingua-en-inflect" ,perl-lingua-en-inflect)
280 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
281 ("perl-lingua-en-number-isordinal" ,perl-lingua-en-number-isordinal)
282 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)))
283 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Phrase")
284 (synopsis "Inflect short English phrases")
285 (description "This module attempts to pluralize or singularize short
286 English phrases.")
287 (license perl-license)))
288
289 (define-public perl-lingua-en-number-isordinal
290 (package
291 (name "perl-lingua-en-number-isordinal")
292 (version "0.05")
293 (source
294 (origin
295 (method url-fetch)
296 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
297 "Lingua-EN-Number-IsOrdinal-" version ".tar.gz"))
298 (sha256
299 (base32
300 "1mhqjvh2ad30gjab5b3a6mbr4aysyrscp4wp42yy5x6001a6km98"))))
301 (build-system perl-build-system)
302 (native-inputs
303 `(("perl-try-tiny" ,perl-try-tiny)
304 ("perl-test-fatal" ,perl-test-fatal)))
305 (propagated-inputs
306 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)))
307 (home-page "https://metacpan.org/release/Lingua-EN-Number-IsOrdinal")
308 (synopsis "Detect if English number is ordinal or cardinal")
309 (description "This module will tell you if a number, either in words or as
310 digits, is a cardinal or ordinal number.")
311 (license perl-license)))
312
313 (define-public perl-lingua-en-tagger
314 (package
315 (name "perl-lingua-en-tagger")
316 (version "0.30")
317 (source
318 (origin
319 (method url-fetch)
320 (uri (string-append "mirror://cpan/authors/id/A/AC/ACOBURN/"
321 "Lingua-EN-Tagger-" version ".tar.gz"))
322 (sha256
323 (base32
324 "0nrnkvsf9f0a7lp82sanmy89ms2nqq1lvjqicvsagsvzp513bl5b"))))
325 (build-system perl-build-system)
326 (propagated-inputs
327 `(("perl-memoize-expirelru" ,perl-memoize-expirelru)
328 ("perl-lingua-stem" ,perl-lingua-stem)
329 ("perl-html-parser" ,perl-html-parser)
330 ("perl-html-tagset" ,perl-html-tagset)))
331 (home-page "https://metacpan.org/release/Lingua-EN-Tagger")
332 (synopsis "Part-of-speech tagger for English natural language processing")
333 (description "This module is a probability based, corpus-trained tagger
334 that assigns part-of-speech tags to English text based on a lookup dictionary
335 and a set of probability values. The tagger assigns appropriate tags based on
336 conditional probabilities - it examines the preceding tag to determine the
337 appropriate tag for the current word. Unknown words are classified according
338 to word morphology or can be set to be treated as nouns or other parts of
339 speech. The tagger also extracts as many nouns and noun phrases as it can,
340 using a set of regular expressions.")
341 (license gpl3)))
342
343 (define-public perl-lingua-en-words2nums
344 (package
345 (name "perl-lingua-en-words2nums")
346 (version "0.18")
347 (source
348 (origin
349 (method url-fetch)
350 (uri (string-append "mirror://cpan/authors/id/J/JO/JOEY/"
351 "Lingua-EN-Words2Nums-" version ".tar.gz"))
352 (sha256
353 (base32
354 "118xx8qr1zbx30psv7ic55w65h15mc1vz6zicshfm96jgiwmcrb8"))))
355 (build-system perl-build-system)
356 (home-page "https://metacpan.org/release/Lingua-EN-Words2Nums")
357 (synopsis "Convert English text to numbers")
358 (description "This module converts English text into numbers. It supports
359 both ordinal and cardinal numbers, negative numbers, and very large numbers.")
360 (license perl-license)))
361
362 (define-public perl-lingua-pt-stemmer
363 (package
364 (name "perl-lingua-pt-stemmer")
365 (version "0.02")
366 (source
367 (origin
368 (method url-fetch)
369 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
370 "Lingua-PT-Stemmer-" version ".tar.gz"))
371 (sha256
372 (base32
373 "17c48sfbgwd2ivlgf59sr6jdhwa3aim8750f8pyzz7xpi8gz0var"))))
374 (build-system perl-build-system)
375 (home-page "https://metacpan.org/release/Lingua-PT-Stemmer")
376 (synopsis "Portuguese language stemming")
377 (description "This module implements a Portuguese stemming algorithm
378 proposed in the paper A Stemming Algorithm for the Portuguese Language by
379 Moreira, V. and Huyck, C.")
380 (license perl-license)))
381
382 (define-public perl-lingua-stem
383 (package
384 (name "perl-lingua-stem")
385 (version "0.84")
386 (source
387 (origin
388 (method url-fetch)
389 (uri (string-append "mirror://cpan/authors/id/S/SN/SNOWHARE/"
390 "Lingua-Stem-" version ".tar.gz"))
391 (sha256
392 (base32
393 "12avh2mnnc7llmmshrr5bgb473fvydxnlqrqbl2815mf2dp4pxcg"))))
394 (build-system perl-build-system)
395 (native-inputs
396 `(("perl-module-build" ,perl-module-build)))
397 (propagated-inputs
398 `(("perl-lingua-pt-stemmer" ,perl-lingua-pt-stemmer)
399 ("perl-lingua-stem-fr" ,perl-lingua-stem-fr)
400 ("perl-lingua-stem-it" ,perl-lingua-stem-it)
401 ("perl-lingua-stem-ru" ,perl-lingua-stem-ru)
402 ("perl-lingua-stem-snowball-da" ,perl-lingua-stem-snowball-da)
403 ("perl-snowball-norwegian" ,perl-snowball-norwegian)
404 ("perl-snowball-swedish" ,perl-snowball-swedish)
405 ("perl-text-german" ,perl-text-german)))
406 (home-page "https://metacpan.org/release/Lingua-Stem")
407 (synopsis "Stemming of words in various languages")
408 (description "This routine applies stemming algorithms to its parameters,
409 returning the stemmed words as appropriate to the selected locale.")
410 (license perl-license)))
411
412 (define-public perl-lingua-stem-fr
413 (package
414 (name "perl-lingua-stem-fr")
415 (version "0.02")
416 (source
417 (origin
418 (method url-fetch)
419 (uri (string-append "mirror://cpan/authors/id/S/SD/SDP/"
420 "Lingua-Stem-Fr-" version ".tar.gz"))
421 (sha256
422 (base32
423 "0vyrspwzaqjxm5mqshf4wvwa3938mkajd1918d9ii2l9m2rn8kwx"))))
424 (build-system perl-build-system)
425 (home-page "https://metacpan.org/release/Lingua-Stem-Fr")
426 (synopsis "Porter's stemming algorithm for French")
427 (description "This module uses a modified version of the Porter Stemming
428 Algorithm to return a stemmed French word.")
429 (license perl-license)))
430
431 (define-public perl-lingua-stem-it
432 (package
433 (name "perl-lingua-stem-it")
434 (version "0.02")
435 (source
436 (origin
437 (method url-fetch)
438 (uri (string-append "mirror://cpan/authors/id/A/AC/ACALPINI/"
439 "Lingua-Stem-It-" version ".tar.gz"))
440 (sha256
441 (base32
442 "1207r183s5hlh4mfwa6p46vzm0dhvrs2dnss5s41a0gyfkxp7riq"))))
443 (build-system perl-build-system)
444 (home-page "https://metacpan.org/release/Lingua-Stem-It")
445 (synopsis "Porter's stemming algorithm for Italian")
446 (description "This module applies the Porter Stemming Algorithm to its
447 parameters, returning the stemmed Italian word.")
448 (license perl-license)))
449
450 (define-public perl-lingua-stem-ru
451 (package
452 (name "perl-lingua-stem-ru")
453 (version "0.04")
454 (source
455 (origin
456 (method url-fetch)
457 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
458 "Lingua-Stem-Ru-" version ".tar.gz"))
459 (sha256
460 (base32
461 "0a2jmdz7jn32qj5hyiw5kbv8fvlpmws8i00a6xcbkzb48yvwww0j"))))
462 (build-system perl-build-system)
463 (home-page "https://metacpan.org/release/Lingua-Stem-Ru")
464 (synopsis "Porter's stemming algorithm for Russian")
465 (description "This module applies the Porter Stemming Algorithm to its
466 parameters, returning the stemmed Russian (KOI8-R only) word.")
467 (license perl-license)))
468
469 (define-public perl-lingua-stem-snowball-da
470 (package
471 (name "perl-lingua-stem-snowball-da")
472 (version "1.01")
473 (source
474 (origin
475 (method url-fetch)
476 (uri (string-append "mirror://cpan/authors/id/C/CI/CINE/"
477 "Lingua-Stem-Snowball-Da-" version ".tar.gz"))
478 (sha256
479 (base32
480 "0mm0m7glm1s6i9f6a78jslw6wh573208arxhq93yriqmw17bwf9f"))))
481 (build-system perl-build-system)
482 (home-page "https://metacpan.org/release/Lingua-Stem-Snowball-Da")
483 (synopsis "Porters stemming algorithm for Danish")
484 (description "Lingua::Stem::Snowball::Da is a perl port of the danish
485 stemmer at http://snowball.sourceforge.net, it was originally altered from the
486 Lingua::Stem::Snowball::Se.")
487 (license gpl2)))
488
489 (define-public perl-snowball-norwegian
490 (package
491 (name "perl-snowball-norwegian")
492 (version "1.2")
493 (source
494 (origin
495 (method url-fetch)
496 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
497 "Snowball-Norwegian-" version ".tar.gz"))
498 (sha256
499 (base32
500 "0675v45bbsh7vr7kpf36xs2q79g02iq1kmfw22h20xdk4rzqvkqx"))))
501 (build-system perl-build-system)
502 (native-inputs `(("perl-module-build" ,perl-module-build)))
503 (home-page "https://metacpan.org/release/Snowball-Norwegian")
504 (synopsis "Porters stemming algorithm for Norwegian")
505 (description "Lingua::Stem::Snowball::No is a perl port of the norwegian
506 stemmer at http://snowball.tartarus.org.")
507 (license perl-license)))
508
509 (define-public perl-snowball-swedish
510 (package
511 (name "perl-snowball-swedish")
512 (version "1.2")
513 (source
514 (origin
515 (method url-fetch)
516 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
517 "Snowball-Swedish-" version ".tar.gz"))
518 (sha256
519 (base32
520 "0agwc12jk5kmabnpsplw3wf4ii5w1zb159cpin44x3srb0sr5apg"))))
521 (build-system perl-build-system)
522 (native-inputs `(("perl-module-build" ,perl-module-build)))
523 (home-page "https://metacpan.org/release/Snowball-Swedish")
524 (synopsis "Porters stemming algorithm for Swedish")
525 (description "Lingua::Stem::Snowball::Se is a perl port of the swedish
526 stemmer at http://snowball.sourceforge.net.")
527 (license perl-license)))
528
529 (define-public perl-string-toidentifier-en
530 (package
531 (name "perl-string-toidentifier-en")
532 (version "0.12")
533 (source
534 (origin
535 (method url-fetch)
536 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
537 "String-ToIdentifier-EN-" version ".tar.gz"))
538 (sha256
539 (base32
540 "12nw7h2yiybhdw0vnnpc7bif8ylhsn6kqf6s39dsrf9h54iq9yrs"))))
541 (build-system perl-build-system)
542 (propagated-inputs
543 `(("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
544 ("perl-text-unidecode" ,perl-text-unidecode)
545 ("perl-namespace-clean" ,perl-namespace-clean)))
546 (home-page "https://metacpan.org/release/String-ToIdentifier-EN")
547 (synopsis "Convert strings to English program identifiers")
548 (description "This module provides a utility method, \"to_identifier\" for
549 converting an arbitrary string into a readable representation using the ASCII
550 subset of \"\\w\" for use as an identifier in a computer program. The intent
551 is to make unique identifier names from which the content of the original
552 string can be easily inferred by a human just by reading the identifier.")
553 (license perl-license)))
554
555 (define-public perl-text-german
556 (package
557 (name "perl-text-german")
558 (version "0.06")
559 (source
560 (origin
561 (method url-fetch)
562 (uri (string-append "mirror://cpan/authors/id/U/UL/ULPFR/"
563 "Text-German-" version ".tar.gz"))
564 (sha256
565 (base32
566 "1p87pgap99lw0nv62i3ghvsi7yg90lhn8vsa3yqp75rd04clybcj"))))
567 (build-system perl-build-system)
568 (home-page "https://metacpan.org/release/Text-German")
569 (synopsis "German grundform reduction")
570 (description "This module is a rather incomplete implementation of work
571 done by Gudrun Putze-Meier.")
572 (license perl-license)))
573
574 (define* (tegaki-release-uri proj version
575 #:optional (ext "tar.gz"))
576 (string-append "https://github.com/tegaki/tegaki/releases/download"
577 "/v" version "/" proj "-" version "." ext))
578
579 (define remove-pre-compiled-files
580 (lambda exts
581 "Return snippet for removing pre-compiled files matching one of the
582 extensions in EXTS."
583 `(begin (for-each delete-file
584 (find-files "."
585 (lambda (name _)
586 (any (cut string-suffix? <> name)
587 (map (cut string-append "." <>)
588 ',exts)))))
589 #t)))
590
591 ;;; modules required for the above snippet
592 (define remove-pre-compiled-files-modules
593 '((guix build utils)
594 (srfi srfi-1)
595 (srfi srfi-26)))
596
597 (define-public python2-tegaki-wagomu
598 (package
599 (name "python2-tegaki-wagomu")
600 (version "0.3.1")
601 (source
602 (origin
603 (method url-fetch)
604 (uri (tegaki-release-uri "tegaki-wagomu" version))
605 (sha256
606 (base32
607 "1pzdiq4zy1nyylaj9i6v2h4h0r05klahskzpafpp367p4rysi1x9"))
608 (modules remove-pre-compiled-files-modules)
609 (snippet (remove-pre-compiled-files "pyc"))))
610 (build-system python-build-system)
611 (arguments
612 `(#:python ,python-2 ; only Python 2 is supported
613 #:phases
614 (modify-phases %standard-phases
615 (add-after 'unpack 'fix-recognizer
616 (lambda* (#:key inputs #:allow-other-keys)
617 ;; fix missing module and function
618 (substitute* "tegakiwagomu.py"
619 (("import Results,")
620 "import ")
621 (("def _recognize")
622 "def recognize")
623 (("Results\\(candidates\\)")
624 "candidates"))
625 #t)))))
626 (inputs
627 `(("glib" ,glib)))
628 (native-inputs
629 `(("pkg-config" ,pkg-config)
630 ("swig" ,swig)))
631 (home-page "https://tegaki.github.io/")
632 (synopsis
633 "Chinese and Japanese Handwriting Recognition (Recognition engine)")
634 (description
635 "Tegaki is an ongoing project which aims to develop a free and open-source
636 modern implementation of handwriting recognition software, specifically
637 designed for Chinese (simplified and traditional) and Japanese, and that is
638 suitable for both the desktop and mobile devices.")
639 (license gpl2+))) ; all files
640
641 (define-public python2-tegaki-python
642 (package
643 (inherit python2-tegaki-wagomu)
644 (name "python2-tegaki-python")
645 (version "0.3.1")
646 (source
647 (origin
648 (method url-fetch)
649 (uri (tegaki-release-uri "tegaki-python" version))
650 (sha256
651 (base32
652 "0x93k7pw9nh0ywd97pr8pm7jv3f94nw044i5k0zvzhdpsjqvak7p"))
653 (modules remove-pre-compiled-files-modules)
654 (snippet (remove-pre-compiled-files "pyc"))))
655 (arguments
656 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
657 ((#:phases _)
658 `(modify-phases %standard-phases
659 (add-after 'unpack 'pre-configure
660 (lambda* (#:key inputs #:allow-other-keys)
661 ;; Always convert string to unicode to avoid the following error
662 ;; when running "tegaki-build" in python2-tegaki-tools:
663 ;;
664 ;; sqlite3.ProgrammingError: You must not use 8-bit bytestrings
665 ;; unless you use a text_factory that can interpret 8-bit
666 ;; bytestrings (like text_factory = str).
667 ;; It is highly recommended that you instead just switch your
668 ;; application to Unicode strings.
669 (substitute* "tegaki/charcol.py"
670 (("sqlite3.OptimizedUnicode")
671 "lambda s: unicode(s, 'utf-8')"))
672 (substitute* "tegaki/engine.py"
673 (("/usr(/local)?")
674 (assoc-ref inputs "python2-tegaki-wagomu")))
675 #t))))))
676 ;; override inherited inputs
677 (inputs '())
678 (native-inputs '())
679 (propagated-inputs
680 `(("python2-tegaki-wagomu" ,python2-tegaki-wagomu)
681 ("python2-zinnia" ,python2-zinnia)))
682 (synopsis
683 "Chinese and Japanese Handwriting Recognition (Base python library)")
684 (license (list gpl2+ ; all files except...
685 bsd-3 ; dictutils.py
686 zpl2.1)))) ; minjson.py
687
688 (define-public python2-tegaki-pygtk
689 (package
690 (inherit python2-tegaki-wagomu)
691 (name "python2-tegaki-pygtk")
692 (version "0.3.1")
693 (source
694 (origin
695 (method url-fetch)
696 (uri (tegaki-release-uri "tegaki-pygtk" version))
697 (sha256
698 (base32
699 "1cip0azxhjdj2dg2z85cp1z3lz4qwx3w1j7z4xmcm7npapmsaqs2"))
700 (modules remove-pre-compiled-files-modules)
701 (snippet (remove-pre-compiled-files "pyc"))))
702 (arguments
703 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
704 ((#:phases _)
705 `(modify-phases %standard-phases
706 (add-after 'unpack 'fix-paths
707 (lambda* (#:key inputs #:allow-other-keys)
708 (substitute* "tegakigtk/fakekey.py"
709 (("libX11.so.6" so)
710 (string-append (assoc-ref inputs "libx11") "/lib/" so))
711 (("libXtst.so.6" so)
712 (string-append (assoc-ref inputs "libxtst") "/lib/" so)))
713 #t))))))
714 (inputs ; required for sending key strokes
715 `(("libx11" ,libx11)
716 ("libxtst" ,libxtst)))
717 (native-inputs '()) ; override inherited inputs
718 (propagated-inputs
719 `(("python2-pygtk" ,python2-pygtk)
720 ("python2-tegaki-python" ,python2-tegaki-python)))
721 (synopsis "Chinese and Japanese Handwriting Recognition (Base UI library)")
722 (license gpl2+))) ; all files
723
724 (define-public python2-tegaki-tools
725 (package
726 (inherit python2-tegaki-wagomu)
727 (name "python2-tegaki-tools")
728 (version "0.3.1")
729 (source
730 (origin
731 (method url-fetch)
732 (uri (tegaki-release-uri "tegaki-tools" version))
733 (sha256
734 (base32
735 "0xxv97ggh2jgldw3r7y59lv3fhz733r6l7mdn6nh4m0gvb0ja971"))
736 (modules remove-pre-compiled-files-modules)
737 (snippet (remove-pre-compiled-files "pyc"))))
738 (arguments
739 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
740 ((#:phases _) '%standard-phases)))
741 (inputs
742 `(("python2-tegaki-pygtk" ,python2-tegaki-pygtk)))
743 ;; override inherited inputs
744 (native-inputs '())
745 (propagated-inputs '())
746 (synopsis "Chinese and Japanese Handwriting Recognition (Advanced tools)")
747 ;; Files in gifenc/ are licensed under gpl3+ while other files are licensed
748 ;; under gpl2+. Therefore, the combined work is licensed under gpl3+.
749 (license gpl3+)))
750
751 (define-public python2-tegaki-recognize
752 (let ((commit "eceec69fe651d0733c8c8752dae569d2283d0f3c")
753 (revision "1"))
754 (package
755 (inherit python2-tegaki-tools)
756 (name "python2-tegaki-recognize")
757 ;; version copied from <https://github.com/tegaki/tegaki/releases>
758 (version (git-version "0.3.1" revision commit))
759 (source
760 (origin
761 ;; We use GIT-FETCH because 'tegaki-recognize.desktop.in' and
762 ;; 'tegaki-recognize.in' are missing in the tarball.
763 (method git-fetch)
764 (uri (git-reference
765 (url "https://github.com/tegaki/tegaki")
766 (commit commit)))
767 (sha256
768 (base32
769 "09mw2if9p885phbgah5f95q3fwy7s5b46qlmpxqyzfcnj6g7afr5"))
770 (file-name (git-file-name name version))
771 (modules `((guix build utils)
772 (ice-9 ftw)
773 (srfi srfi-26)
774 ,@remove-pre-compiled-files-modules))
775 (snippet
776 `(begin
777 ;; remove unnecessary files with potentially different license
778 (for-each delete-file-recursively
779 (scandir "."
780 (negate (cut member <> '("tegaki-recognize"
781 "." "..")))))
782 ,(remove-pre-compiled-files "pyc")
783 #t))))
784 (arguments
785 (substitute-keyword-arguments (package-arguments python2-tegaki-tools)
786 ((#:phases _)
787 `(modify-phases %standard-phases
788 (add-after 'unpack 'chdir
789 (lambda _
790 (chdir "tegaki-recognize")
791 #t))
792 ;; 'setup.py' script does not support one of the Python build
793 ;; system's default flags, "--single-version-externally-managed"
794 (replace 'install
795 (lambda* (#:key outputs #:allow-other-keys)
796 (invoke "python" "setup.py" "install"
797 (string-append "--prefix=" (assoc-ref outputs "out"))
798 "--root=/")
799 #t))))))
800 (synopsis "Chinese and Japanese Handwriting Recognition (Main program)")
801 (license gpl2+)))) ; all files
802
803 (define-public tegaki-zinnia-japanese
804 (package
805 (inherit python2-tegaki-wagomu)
806 (name "tegaki-zinnia-japanese")
807 (version "0.3")
808 (source
809 (origin
810 (method url-fetch)
811 (uri (tegaki-release-uri name version "zip"))
812 (sha256
813 (base32
814 "1nmg9acxhcqly9gwkyb9m0hpy76fll91ywk4b1q4xms0ajxip1h7"))
815 (modules remove-pre-compiled-files-modules)
816 (snippet (remove-pre-compiled-files "model"))))
817 (build-system gnu-build-system)
818 (arguments
819 `(#:tests? #f ; no tests
820 #:phases
821 (modify-phases %standard-phases
822 (replace 'configure
823 (lambda* (#:key outputs #:allow-other-keys)
824 (substitute* "Makefile"
825 (("/usr/local")
826 (assoc-ref outputs "out")))
827 #t)))))
828 ;; override inherited inputs
829 (inputs '())
830 (native-inputs
831 `(("python2-tegaki-tools" ,python2-tegaki-tools)))
832 (propagated-inputs '())
833 (native-search-paths
834 (list (search-path-specification
835 (variable "TEGAKI_MODEL_PATH")
836 (files '("share/tegaki/models")))))
837 (synopsis "Chinese and Japanese Handwriting Recognition (Model)")
838 (license lgpl2.1))) ; all files
839
840 (define-public tegaki-zinnia-japanese-light
841 (package
842 (inherit tegaki-zinnia-japanese)
843 (name "tegaki-zinnia-japanese-light")
844 (version "0.3")
845 (source
846 (origin
847 (method url-fetch)
848 (uri (tegaki-release-uri name version "zip"))
849 (sha256
850 (base32
851 "0x0fs29ylqzxd6xvg51h7rigpbisd7q8v11df425ib2j792yfyf8"))
852 (modules remove-pre-compiled-files-modules)
853 (snippet (remove-pre-compiled-files "model"))))
854 (license lgpl2.1))) ; all files
855
856 (define-public tegaki-zinnia-japanese-kyoiku
857 (package
858 (inherit tegaki-zinnia-japanese)
859 (name "tegaki-zinnia-japanese-kyoiku")
860 (version "0.3")
861 (source
862 (origin
863 (method url-fetch)
864 (uri (tegaki-release-uri name version "zip"))
865 (sha256
866 (base32
867 "0am94bcpmbzplxdnwn9gk15sgaizvcfhmv13mk14jjvx3419cvvx"))
868 (modules remove-pre-compiled-files-modules)
869 (snippet (remove-pre-compiled-files "model"))))
870 (license lgpl2.1))) ; all files
871
872 (define-public tegaki-zinnia-japanese-joyo
873 (package
874 (inherit tegaki-zinnia-japanese)
875 (name "tegaki-zinnia-japanese-joyo")
876 (version "0.3")
877 (source
878 (origin
879 (method url-fetch)
880 (uri (tegaki-release-uri name version "zip"))
881 (sha256
882 (base32
883 "1v0j40lzdyiz01ayws0b8r7fsdy2mr32658382kz4wyk883wzx2z"))
884 (modules remove-pre-compiled-files-modules)
885 (snippet (remove-pre-compiled-files "model"))))
886 (license lgpl2.1))) ; all files
887
888 (define-public tegaki-zinnia-simplified-chinese
889 (package
890 (inherit tegaki-zinnia-japanese)
891 (name "tegaki-zinnia-simplified-chinese")
892 (version "0.3")
893 (source
894 (origin
895 (method url-fetch)
896 (uri (tegaki-release-uri name version "zip"))
897 (sha256
898 (base32
899 "18wq0jccv7lpnrfnzspyc110d6pj2v1i21xcx4fmgzz1lnln3fs5"))
900 (modules remove-pre-compiled-files-modules)
901 (snippet (remove-pre-compiled-files "model"))))
902 (license lgpl2.1))) ; all files
903
904 (define-public tegaki-zinnia-simplified-chinese-light
905 (package
906 (inherit tegaki-zinnia-japanese)
907 (name "tegaki-zinnia-simplified-chinese-light")
908 (version "0.3")
909 (source
910 (origin
911 (method url-fetch)
912 (uri (tegaki-release-uri name version "zip"))
913 (sha256
914 (base32
915 "0v24yf0w0p03lb7fyx128a75mwzad166bigvlbrzqnad789qg1sr"))
916 (modules remove-pre-compiled-files-modules)
917 (snippet (remove-pre-compiled-files "model"))))
918 (license lgpl2.1))) ; all files
919
920 (define-public tegaki-zinnia-traditional-chinese
921 (package
922 (inherit tegaki-zinnia-japanese)
923 (name "tegaki-zinnia-traditional-chinese")
924 (version "0.3")
925 (source
926 (origin
927 (method url-fetch)
928 (uri (tegaki-release-uri name version "zip"))
929 (sha256
930 (base32
931 "140nlp6hynrai2svs5670jjfw1za6ayflhyj2dl0bzsfgbk3447l"))
932 (modules remove-pre-compiled-files-modules)
933 (snippet (remove-pre-compiled-files "model"))))
934 (license lgpl2.1))) ; all files
935
936 (define-public tegaki-zinnia-traditional-chinese-light
937 (package
938 (inherit tegaki-zinnia-japanese)
939 (name "tegaki-zinnia-traditional-chinese-light")
940 (version "0.3")
941 (source
942 (origin
943 (method url-fetch)
944 (uri (tegaki-release-uri name version "zip"))
945 (sha256
946 (base32
947 "1m6yk6a57vs9wg5y50qciwi1ahhmklp2mgsjysbj4mnyzv6yhcr2"))
948 (modules remove-pre-compiled-files-modules)
949 (snippet (remove-pre-compiled-files "model"))))
950 (license lgpl2.1))) ; all files
951
952 (define-public tegaki-wagomu-japanese
953 (package
954 (inherit tegaki-zinnia-japanese)
955 (name "tegaki-wagomu-japanese")
956 (version "0.3")
957 (source
958 (origin
959 (method url-fetch)
960 (uri (tegaki-release-uri name version "zip"))
961 (sha256
962 (base32
963 "0flj5id8xwsn7csrrzqz9prdikswnwm2wms0as2vzdpxzph1az4k"))
964 (modules remove-pre-compiled-files-modules)
965 (snippet (remove-pre-compiled-files "model"))))
966 (license lgpl2.1))) ; all files
967
968 (define-public tegaki-wagomu-japanese-kyoiku
969 (package
970 (inherit tegaki-zinnia-japanese)
971 (name "tegaki-wagomu-japanese-kyoiku")
972 (version "0.3")
973 (source
974 (origin
975 (method url-fetch)
976 (uri (tegaki-release-uri name version "zip"))
977 (sha256
978 (base32
979 "0v8crfh8rdf6ndp16g52s5jlrrlwh73xp38zjn5i9dlacx8kfqg1"))
980 (modules remove-pre-compiled-files-modules)
981 (snippet (remove-pre-compiled-files "model"))))
982 (license lgpl2.1))) ; all files
983
984 (define-public tegaki-wagomu-japanese-joyo
985 (package
986 (inherit tegaki-zinnia-japanese)
987 (name "tegaki-wagomu-japanese-joyo")
988 (version "0.3")
989 (source
990 (origin
991 (method url-fetch)
992 (uri (tegaki-release-uri name version "zip"))
993 (sha256
994 (base32
995 "0wk8shpr963zp328g991qs6abpnacq4242003m687z2d6yp7nph2"))
996 (modules remove-pre-compiled-files-modules)
997 (snippet (remove-pre-compiled-files "model"))))
998 (license lgpl2.1))) ; all files
999
1000 (define-public tegaki-wagomu-simplified-chinese
1001 (package
1002 (inherit tegaki-zinnia-japanese)
1003 (name "tegaki-wagomu-simplified-chinese")
1004 (version "0.3")
1005 (source
1006 (origin
1007 (method url-fetch)
1008 (uri (tegaki-release-uri name version "zip"))
1009 (sha256
1010 (base32
1011 "0wqprynigqxqxv128i1smh81gxvmjj056d9qpznxa3n9f5ymlbj6"))
1012 (modules remove-pre-compiled-files-modules)
1013 (snippet (remove-pre-compiled-files "model"))))
1014 (license lgpl2.1))) ; all files
1015
1016 ;;; Upstream does not provide the source for tegaki-wagomu-traditional-chinese.
1017 ;;; Therefore, we use the source for tegaki-zinnia-traditional-chinese and
1018 ;;; patch the Makefile accordingly.
1019 (define-public tegaki-wagomu-traditional-chinese
1020 (package
1021 (inherit tegaki-zinnia-traditional-chinese)
1022 (name "tegaki-wagomu-traditional-chinese")
1023 (arguments
1024 (substitute-keyword-arguments
1025 (package-arguments tegaki-zinnia-traditional-chinese)
1026 ((#:phases phases '%standard-phases)
1027 `(modify-phases ,phases
1028 (replace 'configure
1029 (lambda args
1030 (let ((configure (assq-ref ,phases 'configure)))
1031 (apply configure args))
1032 (substitute* "Makefile"
1033 (("zinnia") "wagomu"))
1034 #t))))))
1035 (license lgpl2.1))) ; all files
1036
1037 (define-public link-grammar
1038 (package
1039 (name "link-grammar")
1040 (version "5.7.0")
1041 (source (origin
1042 (method url-fetch)
1043 (uri (string-append "https://www.abisource.com/downloads/"
1044 "link-grammar/" version
1045 "/link-grammar-" version ".tar.gz"))
1046 (sha256
1047 (base32
1048 "0ak1v469k56v3511kxxkxvx1nw6zcxcl0f1kcvc82ffacqbr4y96"))))
1049 (build-system gnu-build-system)
1050 (home-page "https://www.abisource.com/projects/link-grammar/")
1051 (synopsis "Link grammar parser")
1052 (description "The Link Grammar Parser is a syntactic parser of English,
1053 Russian, Arabic and Persian (and other languages as well), based on Link
1054 Grammar, an original theory of syntax and morphology. Given a sentence, the
1055 system assigns to it a syntactic structure, which consists of a set of
1056 labelled links connecting pairs of words. The parser also produces a
1057 \"constituent\" (HPSG style phrase tree) representation of a sentence (showing
1058 noun phrases, verb phrases, etc.).")
1059 (license bsd-3)))