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 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages language)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages audio)
28 #:use-module (gnu packages glib)
29 #:use-module (gnu packages gtk)
30 #:use-module (gnu packages java)
31 #:use-module (gnu packages linux)
32 #:use-module (gnu packages llvm)
33 #:use-module (gnu packages man)
34 #:use-module (gnu packages ocr)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages pulseaudio)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages perl-check)
40 #:use-module (gnu packages swig)
41 #:use-module (gnu packages texinfo)
42 #:use-module (gnu packages web)
43 #:use-module (gnu packages xml)
44 #:use-module (gnu packages xorg)
45 #:use-module (guix packages)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system perl)
48 #:use-module (guix build-system python)
49 #:use-module ((guix licenses)
51 (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
52 #:use-module (guix download)
53 #:use-module (guix git-download)
54 #:use-module (guix utils))
56 (define-public liblouis
65 (url "https://github.com/liblouis/liblouis.git")
66 (commit (string-append "v" version))))
67 (file-name (git-file-name name version))
69 (base32 "0v6w8b9r994mkkbm2gqgd7k5yfmdhgbabh0j1gmn375nyvhy4qqh"))))
70 (build-system gnu-build-system)
71 (outputs '("out" "bin" "doc" "python"))
78 (modify-phases %standard-phases
79 ;; To install the sub-package "python".
80 (add-after 'install 'install-python-extension
81 (lambda* (#:key outputs #:allow-other-keys)
82 (with-directory-excursion "python"
83 (invoke "python" "setup.py" "install"
84 (string-append "--prefix="
85 (assoc-ref outputs "python"))
88 `(("autoconf" ,autoconf)
89 ("automake" ,automake)
90 ("clang-format" ,clang)
91 ("help2man" ,help2man)
96 ("pkg-config" ,pkg-config)
97 ("python" ,python-wrapper)))
98 (synopsis "Braille translator and back-translator")
99 (description "Liblouis is a braille translator and back-translator named in
100 honor of Louis Braille. It features support for computer and literary braille,
101 supports contracted and uncontracted translation for many languages and has
102 support for hyphenation. New languages can easily be added through tables that
103 support a rule- or dictionary based approach. Tools for testing and debugging
104 tables are also included. Liblouis also supports math braille, Nemeth and
106 (home-page "http://liblouis.org/")
114 (define-public liblouisutdml
116 (name "liblouisutdml")
123 (url "https://github.com/liblouis/liblouisutdml.git")
124 (commit (string-append "v" version))))
125 (file-name (git-file-name name version))
127 (base32 "11xxky3crjm8bidfljzpqaz1m1i1m1yskmdpavf9b4jpf87nzjj2"))
129 (search-patches "liblouisutdml-fix-tests.patch"))))
130 (build-system gnu-build-system)
131 (outputs '("out" "bin" "doc"))
135 "--disable-static")))
137 `(("autoconf" ,autoconf)
138 ("automake" ,automake)
139 ("help2man" ,help2man)
140 ("jdk" ,icedtea "jdk")
142 ("makeinfo" ,texinfo)
143 ("pkg-config" ,pkg-config)))
145 `(("libxml2" ,libxml2)))
147 `(("liblouis" ,liblouis)
148 ("liblouis:bin" ,liblouis "bin")))
149 (synopsis "Braille transcription services")
150 (description "Liblouisutdml is a library providing complete braille
151 transcription services for xml, html and text documents. It translates into
152 appropriate braille codes and formats according to its style sheet and the
153 specifications in the document.")
154 (home-page "http://liblouis.org/")
162 (define-public libstemmer
169 (uri "https://snowballstem.org/dist/libstemmer_c.tgz")
171 (base32 "1z2xvrjsaaypc04lwz7dg8mjm5cq1gzmn0l544pn6y2ll3r7ckh5"))))
172 (build-system gnu-build-system)
174 `(#:tests? #f ; No tests exist
177 (string-append "CC=" ,(cc-for-target))
180 (modify-phases %standard-phases
183 (lambda* (#:key outputs #:allow-other-keys)
184 (let* ((out (assoc-ref outputs "out"))
185 (out-bin (string-append out "/bin"))
186 (out-include (string-append out "/include"))
187 (out-lib (string-append out "/lib")))
188 (install-file "stemwords" out-bin)
189 (install-file "include/libstemmer.h" out-include)
190 (rename-file "libstemmer.o" "libstemmer.a")
191 (install-file "libstemmer.a" out-lib)
193 (synopsis "Stemming Library")
194 (description "LibStemmer provides stemming library, supporting several
196 (home-page "https://snowballstem.org/")
199 (define-public perl-lingua-en-findnumber
201 (name "perl-lingua-en-findnumber")
206 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
207 "Lingua-EN-FindNumber-" version ".tar.gz"))
210 "015ximzdp42v824llwlg2pd77vd0d172lb4xs55q9f9zhqf6s5qx"))))
211 (build-system perl-build-system)
213 `(("perl-lingua-en-words2nums" ,perl-lingua-en-words2nums)))
214 (home-page "https://metacpan.org/release/Lingua-EN-FindNumber")
215 (synopsis "Locate (written) numbers in English text ")
216 (description "This module provides a regular expression for finding
217 numbers in English text. It also provides functions for extracting and
218 manipulating such numbers.")
219 (license perl-license)))
221 (define-public perl-lingua-en-inflect
223 (name "perl-lingua-en-inflect")
228 (uri (string-append "mirror://cpan/authors/id/D/DC/DCONWAY/"
229 "Lingua-EN-Inflect-" version ".tar.gz"))
232 "0j8d1f1wvmgc11d71pc8xp8fv5a1nb2yfw1dgd19xhscn1klpvzw"))))
233 (build-system perl-build-system)
234 (native-inputs `(("perl-module-build" ,perl-module-build)))
235 (home-page "https://metacpan.org/release/Lingua-EN-Inflect")
236 (synopsis "Convert singular to plural")
237 (description "Lingua::EN::Inflect provides plural inflections,
238 \"a\"/\"an\" selection for English words, and manipulation of numbers as
239 words. Plural forms of all nouns, most verbs, and some adjectives are
240 provided. Where appropriate, \"classical\" variants (for example: \"brother\"
241 -> \"brethren\", \"dogma\" -> \"dogmata\", etc.) are also provided.")
242 (license perl-license)))
244 (define-public perl-lingua-en-inflect-number
246 (name "perl-lingua-en-inflect-number")
251 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
252 "Lingua-EN-Inflect-Number-" version ".tar.gz"))
255 "1gxccynkaqav43ww43jp4rzkyr36x97jd03yb5f6yx0jhn1k7yv6"))))
256 (build-system perl-build-system)
258 `(("perl-lingua-en-inflect" ,perl-lingua-en-inflect)))
259 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Number")
260 (synopsis "Force number of words to singular or plural")
261 (description "This module extends the functionality of Lingua::EN::Inflect
262 with three new functions for determining plurality of a word and forcefully
263 converting a word to singular or plural.")
264 (license perl-license)))
266 (define-public perl-lingua-en-inflect-phrase
268 (name "perl-lingua-en-inflect-phrase")
273 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
274 "Lingua-EN-Inflect-Phrase-" version ".tar.gz"))
277 "1a6y1l2pjim2242wcpgz066di4pbzfgsjjdl7vg5a5wzm48qj1am"))))
278 (build-system perl-build-system)
280 `(("perl-test-nowarnings" ,perl-test-nowarnings)))
282 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)
283 ("perl-lingua-en-inflect" ,perl-lingua-en-inflect)
284 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
285 ("perl-lingua-en-number-isordinal" ,perl-lingua-en-number-isordinal)
286 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)))
287 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Phrase")
288 (synopsis "Inflect short English phrases")
289 (description "This module attempts to pluralize or singularize short
291 (license perl-license)))
293 (define-public perl-lingua-en-number-isordinal
295 (name "perl-lingua-en-number-isordinal")
300 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
301 "Lingua-EN-Number-IsOrdinal-" version ".tar.gz"))
304 "1mhqjvh2ad30gjab5b3a6mbr4aysyrscp4wp42yy5x6001a6km98"))))
305 (build-system perl-build-system)
307 `(("perl-try-tiny" ,perl-try-tiny)
308 ("perl-test-fatal" ,perl-test-fatal)))
310 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)))
311 (home-page "https://metacpan.org/release/Lingua-EN-Number-IsOrdinal")
312 (synopsis "Detect if English number is ordinal or cardinal")
313 (description "This module will tell you if a number, either in words or as
314 digits, is a cardinal or ordinal number.")
315 (license perl-license)))
317 (define-public perl-lingua-en-tagger
319 (name "perl-lingua-en-tagger")
324 (uri (string-append "mirror://cpan/authors/id/A/AC/ACOBURN/"
325 "Lingua-EN-Tagger-" version ".tar.gz"))
328 "0nrnkvsf9f0a7lp82sanmy89ms2nqq1lvjqicvsagsvzp513bl5b"))))
329 (build-system perl-build-system)
331 `(("perl-memoize-expirelru" ,perl-memoize-expirelru)
332 ("perl-lingua-stem" ,perl-lingua-stem)
333 ("perl-html-parser" ,perl-html-parser)
334 ("perl-html-tagset" ,perl-html-tagset)))
335 (home-page "https://metacpan.org/release/Lingua-EN-Tagger")
336 (synopsis "Part-of-speech tagger for English natural language processing")
337 (description "This module is a probability based, corpus-trained tagger
338 that assigns part-of-speech tags to English text based on a lookup dictionary
339 and a set of probability values. The tagger assigns appropriate tags based on
340 conditional probabilities - it examines the preceding tag to determine the
341 appropriate tag for the current word. Unknown words are classified according
342 to word morphology or can be set to be treated as nouns or other parts of
343 speech. The tagger also extracts as many nouns and noun phrases as it can,
344 using a set of regular expressions.")
347 (define-public perl-lingua-en-words2nums
349 (name "perl-lingua-en-words2nums")
354 (uri (string-append "mirror://cpan/authors/id/J/JO/JOEY/"
355 "Lingua-EN-Words2Nums-" version ".tar.gz"))
358 "118xx8qr1zbx30psv7ic55w65h15mc1vz6zicshfm96jgiwmcrb8"))))
359 (build-system perl-build-system)
360 (home-page "https://metacpan.org/release/Lingua-EN-Words2Nums")
361 (synopsis "Convert English text to numbers")
362 (description "This module converts English text into numbers. It supports
363 both ordinal and cardinal numbers, negative numbers, and very large numbers.")
364 (license perl-license)))
366 (define-public perl-lingua-pt-stemmer
368 (name "perl-lingua-pt-stemmer")
373 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
374 "Lingua-PT-Stemmer-" version ".tar.gz"))
377 "17c48sfbgwd2ivlgf59sr6jdhwa3aim8750f8pyzz7xpi8gz0var"))))
378 (build-system perl-build-system)
379 (home-page "https://metacpan.org/release/Lingua-PT-Stemmer")
380 (synopsis "Portuguese language stemming")
381 (description "This module implements a Portuguese stemming algorithm
382 proposed in the paper A Stemming Algorithm for the Portuguese Language by
383 Moreira, V. and Huyck, C.")
384 (license perl-license)))
386 (define-public perl-lingua-stem
388 (name "perl-lingua-stem")
393 (uri (string-append "mirror://cpan/authors/id/S/SN/SNOWHARE/"
394 "Lingua-Stem-" version ".tar.gz"))
397 "12avh2mnnc7llmmshrr5bgb473fvydxnlqrqbl2815mf2dp4pxcg"))))
398 (build-system perl-build-system)
400 `(("perl-module-build" ,perl-module-build)))
402 `(("perl-lingua-pt-stemmer" ,perl-lingua-pt-stemmer)
403 ("perl-lingua-stem-fr" ,perl-lingua-stem-fr)
404 ("perl-lingua-stem-it" ,perl-lingua-stem-it)
405 ("perl-lingua-stem-ru" ,perl-lingua-stem-ru)
406 ("perl-lingua-stem-snowball-da" ,perl-lingua-stem-snowball-da)
407 ("perl-snowball-norwegian" ,perl-snowball-norwegian)
408 ("perl-snowball-swedish" ,perl-snowball-swedish)
409 ("perl-text-german" ,perl-text-german)))
410 (home-page "https://metacpan.org/release/Lingua-Stem")
411 (synopsis "Stemming of words in various languages")
412 (description "This routine applies stemming algorithms to its parameters,
413 returning the stemmed words as appropriate to the selected locale.")
414 (license perl-license)))
416 (define-public perl-lingua-stem-fr
418 (name "perl-lingua-stem-fr")
423 (uri (string-append "mirror://cpan/authors/id/S/SD/SDP/"
424 "Lingua-Stem-Fr-" version ".tar.gz"))
427 "0vyrspwzaqjxm5mqshf4wvwa3938mkajd1918d9ii2l9m2rn8kwx"))))
428 (build-system perl-build-system)
429 (home-page "https://metacpan.org/release/Lingua-Stem-Fr")
430 (synopsis "Porter's stemming algorithm for French")
431 (description "This module uses a modified version of the Porter Stemming
432 Algorithm to return a stemmed French word.")
433 (license perl-license)))
435 (define-public perl-lingua-stem-it
437 (name "perl-lingua-stem-it")
442 (uri (string-append "mirror://cpan/authors/id/A/AC/ACALPINI/"
443 "Lingua-Stem-It-" version ".tar.gz"))
446 "1207r183s5hlh4mfwa6p46vzm0dhvrs2dnss5s41a0gyfkxp7riq"))))
447 (build-system perl-build-system)
448 (home-page "https://metacpan.org/release/Lingua-Stem-It")
449 (synopsis "Porter's stemming algorithm for Italian")
450 (description "This module applies the Porter Stemming Algorithm to its
451 parameters, returning the stemmed Italian word.")
452 (license perl-license)))
454 (define-public perl-lingua-stem-ru
456 (name "perl-lingua-stem-ru")
461 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
462 "Lingua-Stem-Ru-" version ".tar.gz"))
465 "0a2jmdz7jn32qj5hyiw5kbv8fvlpmws8i00a6xcbkzb48yvwww0j"))))
466 (build-system perl-build-system)
467 (home-page "https://metacpan.org/release/Lingua-Stem-Ru")
468 (synopsis "Porter's stemming algorithm for Russian")
469 (description "This module applies the Porter Stemming Algorithm to its
470 parameters, returning the stemmed Russian (KOI8-R only) word.")
471 (license perl-license)))
473 (define-public perl-lingua-stem-snowball-da
475 (name "perl-lingua-stem-snowball-da")
480 (uri (string-append "mirror://cpan/authors/id/C/CI/CINE/"
481 "Lingua-Stem-Snowball-Da-" version ".tar.gz"))
484 "0mm0m7glm1s6i9f6a78jslw6wh573208arxhq93yriqmw17bwf9f"))))
485 (build-system perl-build-system)
486 (home-page "https://metacpan.org/release/Lingua-Stem-Snowball-Da")
487 (synopsis "Porters stemming algorithm for Danish")
488 (description "Lingua::Stem::Snowball::Da is a perl port of the danish
489 stemmer at http://snowball.sourceforge.net, it was originally altered from the
490 Lingua::Stem::Snowball::Se.")
493 (define-public perl-snowball-norwegian
495 (name "perl-snowball-norwegian")
500 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
501 "Snowball-Norwegian-" version ".tar.gz"))
504 "0675v45bbsh7vr7kpf36xs2q79g02iq1kmfw22h20xdk4rzqvkqx"))))
505 (build-system perl-build-system)
506 (native-inputs `(("perl-module-build" ,perl-module-build)))
507 (home-page "https://metacpan.org/release/Snowball-Norwegian")
508 (synopsis "Porters stemming algorithm for Norwegian")
509 (description "Lingua::Stem::Snowball::No is a perl port of the norwegian
510 stemmer at http://snowball.tartarus.org.")
511 (license perl-license)))
513 (define-public perl-snowball-swedish
515 (name "perl-snowball-swedish")
520 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
521 "Snowball-Swedish-" version ".tar.gz"))
524 "0agwc12jk5kmabnpsplw3wf4ii5w1zb159cpin44x3srb0sr5apg"))))
525 (build-system perl-build-system)
526 (native-inputs `(("perl-module-build" ,perl-module-build)))
527 (home-page "https://metacpan.org/release/Snowball-Swedish")
528 (synopsis "Porters stemming algorithm for Swedish")
529 (description "Lingua::Stem::Snowball::Se is a perl port of the swedish
530 stemmer at http://snowball.sourceforge.net.")
531 (license perl-license)))
533 (define-public perl-string-toidentifier-en
535 (name "perl-string-toidentifier-en")
540 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
541 "String-ToIdentifier-EN-" version ".tar.gz"))
544 "12nw7h2yiybhdw0vnnpc7bif8ylhsn6kqf6s39dsrf9h54iq9yrs"))))
545 (build-system perl-build-system)
547 `(("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
548 ("perl-text-unidecode" ,perl-text-unidecode)
549 ("perl-namespace-clean" ,perl-namespace-clean)))
550 (home-page "https://metacpan.org/release/String-ToIdentifier-EN")
551 (synopsis "Convert strings to English program identifiers")
552 (description "This module provides a utility method, \"to_identifier\" for
553 converting an arbitrary string into a readable representation using the ASCII
554 subset of \"\\w\" for use as an identifier in a computer program. The intent
555 is to make unique identifier names from which the content of the original
556 string can be easily inferred by a human just by reading the identifier.")
557 (license perl-license)))
559 (define-public perl-text-german
561 (name "perl-text-german")
566 (uri (string-append "mirror://cpan/authors/id/U/UL/ULPFR/"
567 "Text-German-" version ".tar.gz"))
570 "1p87pgap99lw0nv62i3ghvsi7yg90lhn8vsa3yqp75rd04clybcj"))))
571 (build-system perl-build-system)
572 (home-page "https://metacpan.org/release/Text-German")
573 (synopsis "German grundform reduction")
574 (description "This module is a rather incomplete implementation of work
575 done by Gudrun Putze-Meier.")
576 (license perl-license)))
578 (define* (tegaki-release-uri proj version
579 #:optional (ext "tar.gz"))
580 (string-append "https://github.com/tegaki/tegaki/releases/download"
581 "/v" version "/" proj "-" version "." ext))
583 (define remove-pre-compiled-files
585 "Return snippet for removing pre-compiled files matching one of the
587 `(begin (for-each delete-file
590 (any (cut string-suffix? <> name)
591 (map (cut string-append "." <>)
595 ;;; modules required for the above snippet
596 (define remove-pre-compiled-files-modules
601 (define-public python2-tegaki-wagomu
603 (name "python2-tegaki-wagomu")
608 (uri (tegaki-release-uri "tegaki-wagomu" version))
611 "1pzdiq4zy1nyylaj9i6v2h4h0r05klahskzpafpp367p4rysi1x9"))
612 (modules remove-pre-compiled-files-modules)
613 (snippet (remove-pre-compiled-files "pyc"))))
614 (build-system python-build-system)
616 `(#:python ,python-2 ; only Python 2 is supported
618 (modify-phases %standard-phases
619 (add-after 'unpack 'fix-recognizer
620 (lambda* (#:key inputs #:allow-other-keys)
621 ;; fix missing module and function
622 (substitute* "tegakiwagomu.py"
627 (("Results\\(candidates\\)")
633 `(("pkg-config" ,pkg-config)
635 (home-page "https://tegaki.github.io/")
637 "Chinese and Japanese Handwriting Recognition (Recognition engine)")
639 "Tegaki is an ongoing project which aims to develop a free and open-source
640 modern implementation of handwriting recognition software, specifically
641 designed for Chinese (simplified and traditional) and Japanese, and that is
642 suitable for both the desktop and mobile devices.")
643 (license gpl2+))) ; all files
645 (define-public python2-tegaki-python
647 (inherit python2-tegaki-wagomu)
648 (name "python2-tegaki-python")
653 (uri (tegaki-release-uri "tegaki-python" version))
656 "0x93k7pw9nh0ywd97pr8pm7jv3f94nw044i5k0zvzhdpsjqvak7p"))
657 (modules remove-pre-compiled-files-modules)
658 (snippet (remove-pre-compiled-files "pyc"))))
660 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
662 `(modify-phases %standard-phases
663 (add-after 'unpack 'pre-configure
664 (lambda* (#:key inputs #:allow-other-keys)
665 ;; Always convert string to unicode to avoid the following error
666 ;; when running "tegaki-build" in python2-tegaki-tools:
668 ;; sqlite3.ProgrammingError: You must not use 8-bit bytestrings
669 ;; unless you use a text_factory that can interpret 8-bit
670 ;; bytestrings (like text_factory = str).
671 ;; It is highly recommended that you instead just switch your
672 ;; application to Unicode strings.
673 (substitute* "tegaki/charcol.py"
674 (("sqlite3.OptimizedUnicode")
675 "lambda s: unicode(s, 'utf-8')"))
676 (substitute* "tegaki/engine.py"
678 (assoc-ref inputs "python2-tegaki-wagomu")))
680 ;; override inherited inputs
684 `(("python2-tegaki-wagomu" ,python2-tegaki-wagomu)
685 ("python2-zinnia" ,python2-zinnia)))
687 "Chinese and Japanese Handwriting Recognition (Base python library)")
688 (license (list gpl2+ ; all files except...
690 zpl2.1)))) ; minjson.py
692 (define-public python2-tegaki-pygtk
694 (inherit python2-tegaki-wagomu)
695 (name "python2-tegaki-pygtk")
700 (uri (tegaki-release-uri "tegaki-pygtk" version))
703 "1cip0azxhjdj2dg2z85cp1z3lz4qwx3w1j7z4xmcm7npapmsaqs2"))
704 (modules remove-pre-compiled-files-modules)
705 (snippet (remove-pre-compiled-files "pyc"))))
707 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
709 `(modify-phases %standard-phases
710 (add-after 'unpack 'fix-paths
711 (lambda* (#:key inputs #:allow-other-keys)
712 (substitute* "tegakigtk/fakekey.py"
714 (string-append (assoc-ref inputs "libx11") "/lib/" so))
716 (string-append (assoc-ref inputs "libxtst") "/lib/" so)))
718 (inputs ; required for sending key strokes
720 ("libxtst" ,libxtst)))
721 (native-inputs '()) ; override inherited inputs
723 `(("python2-pygtk" ,python2-pygtk)
724 ("python2-tegaki-python" ,python2-tegaki-python)))
725 (synopsis "Chinese and Japanese Handwriting Recognition (Base UI library)")
726 (license gpl2+))) ; all files
728 (define-public python2-tegaki-tools
730 (inherit python2-tegaki-wagomu)
731 (name "python2-tegaki-tools")
736 (uri (tegaki-release-uri "tegaki-tools" version))
739 "0xxv97ggh2jgldw3r7y59lv3fhz733r6l7mdn6nh4m0gvb0ja971"))
740 (modules remove-pre-compiled-files-modules)
741 (snippet (remove-pre-compiled-files "pyc"))))
743 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
744 ((#:phases _) '%standard-phases)))
746 `(("python2-tegaki-pygtk" ,python2-tegaki-pygtk)))
747 ;; override inherited inputs
749 (propagated-inputs '())
750 (synopsis "Chinese and Japanese Handwriting Recognition (Advanced tools)")
751 ;; Files in gifenc/ are licensed under gpl3+ while other files are licensed
752 ;; under gpl2+. Therefore, the combined work is licensed under gpl3+.
755 (define-public python2-tegaki-recognize
756 (let ((commit "eceec69fe651d0733c8c8752dae569d2283d0f3c")
759 (inherit python2-tegaki-tools)
760 (name "python2-tegaki-recognize")
761 ;; version copied from <https://github.com/tegaki/tegaki/releases>
762 (version (git-version "0.3.1" revision commit))
765 ;; We use GIT-FETCH because 'tegaki-recognize.desktop.in' and
766 ;; 'tegaki-recognize.in' are missing in the tarball.
769 (url "https://github.com/tegaki/tegaki")
773 "09mw2if9p885phbgah5f95q3fwy7s5b46qlmpxqyzfcnj6g7afr5"))
774 (file-name (git-file-name name version))
775 (modules `((guix build utils)
778 ,@remove-pre-compiled-files-modules))
781 ;; remove unnecessary files with potentially different license
782 (for-each delete-file-recursively
784 (negate (cut member <> '("tegaki-recognize"
786 ,(remove-pre-compiled-files "pyc")
789 (substitute-keyword-arguments (package-arguments python2-tegaki-tools)
791 `(modify-phases %standard-phases
792 (add-after 'unpack 'chdir
794 (chdir "tegaki-recognize")
796 ;; 'setup.py' script does not support one of the Python build
797 ;; system's default flags, "--single-version-externally-managed"
799 (lambda* (#:key outputs #:allow-other-keys)
800 (invoke "python" "setup.py" "install"
801 (string-append "--prefix=" (assoc-ref outputs "out"))
804 (synopsis "Chinese and Japanese Handwriting Recognition (Main program)")
805 (license gpl2+)))) ; all files
807 (define-public tegaki-zinnia-japanese
809 (inherit python2-tegaki-wagomu)
810 (name "tegaki-zinnia-japanese")
815 (uri (tegaki-release-uri name version "zip"))
818 "1nmg9acxhcqly9gwkyb9m0hpy76fll91ywk4b1q4xms0ajxip1h7"))
819 (modules remove-pre-compiled-files-modules)
820 (snippet (remove-pre-compiled-files "model"))))
821 (build-system gnu-build-system)
823 `(#:tests? #f ; no tests
825 (modify-phases %standard-phases
827 (lambda* (#:key outputs #:allow-other-keys)
828 (substitute* "Makefile"
830 (assoc-ref outputs "out")))
832 ;; override inherited inputs
835 `(("python2-tegaki-tools" ,python2-tegaki-tools)))
836 (propagated-inputs '())
838 (list (search-path-specification
839 (variable "TEGAKI_MODEL_PATH")
840 (files '("share/tegaki/models")))))
841 (synopsis "Chinese and Japanese Handwriting Recognition (Model)")
842 (license lgpl2.1))) ; all files
844 (define-public tegaki-zinnia-japanese-light
846 (inherit tegaki-zinnia-japanese)
847 (name "tegaki-zinnia-japanese-light")
852 (uri (tegaki-release-uri name version "zip"))
855 "0x0fs29ylqzxd6xvg51h7rigpbisd7q8v11df425ib2j792yfyf8"))
856 (modules remove-pre-compiled-files-modules)
857 (snippet (remove-pre-compiled-files "model"))))
858 (license lgpl2.1))) ; all files
860 (define-public tegaki-zinnia-japanese-kyoiku
862 (inherit tegaki-zinnia-japanese)
863 (name "tegaki-zinnia-japanese-kyoiku")
868 (uri (tegaki-release-uri name version "zip"))
871 "0am94bcpmbzplxdnwn9gk15sgaizvcfhmv13mk14jjvx3419cvvx"))
872 (modules remove-pre-compiled-files-modules)
873 (snippet (remove-pre-compiled-files "model"))))
874 (license lgpl2.1))) ; all files
876 (define-public tegaki-zinnia-japanese-joyo
878 (inherit tegaki-zinnia-japanese)
879 (name "tegaki-zinnia-japanese-joyo")
884 (uri (tegaki-release-uri name version "zip"))
887 "1v0j40lzdyiz01ayws0b8r7fsdy2mr32658382kz4wyk883wzx2z"))
888 (modules remove-pre-compiled-files-modules)
889 (snippet (remove-pre-compiled-files "model"))))
890 (license lgpl2.1))) ; all files
892 (define-public tegaki-zinnia-simplified-chinese
894 (inherit tegaki-zinnia-japanese)
895 (name "tegaki-zinnia-simplified-chinese")
900 (uri (tegaki-release-uri name version "zip"))
903 "18wq0jccv7lpnrfnzspyc110d6pj2v1i21xcx4fmgzz1lnln3fs5"))
904 (modules remove-pre-compiled-files-modules)
905 (snippet (remove-pre-compiled-files "model"))))
906 (license lgpl2.1))) ; all files
908 (define-public tegaki-zinnia-simplified-chinese-light
910 (inherit tegaki-zinnia-japanese)
911 (name "tegaki-zinnia-simplified-chinese-light")
916 (uri (tegaki-release-uri name version "zip"))
919 "0v24yf0w0p03lb7fyx128a75mwzad166bigvlbrzqnad789qg1sr"))
920 (modules remove-pre-compiled-files-modules)
921 (snippet (remove-pre-compiled-files "model"))))
922 (license lgpl2.1))) ; all files
924 (define-public tegaki-zinnia-traditional-chinese
926 (inherit tegaki-zinnia-japanese)
927 (name "tegaki-zinnia-traditional-chinese")
932 (uri (tegaki-release-uri name version "zip"))
935 "140nlp6hynrai2svs5670jjfw1za6ayflhyj2dl0bzsfgbk3447l"))
936 (modules remove-pre-compiled-files-modules)
937 (snippet (remove-pre-compiled-files "model"))))
938 (license lgpl2.1))) ; all files
940 (define-public tegaki-zinnia-traditional-chinese-light
942 (inherit tegaki-zinnia-japanese)
943 (name "tegaki-zinnia-traditional-chinese-light")
948 (uri (tegaki-release-uri name version "zip"))
951 "1m6yk6a57vs9wg5y50qciwi1ahhmklp2mgsjysbj4mnyzv6yhcr2"))
952 (modules remove-pre-compiled-files-modules)
953 (snippet (remove-pre-compiled-files "model"))))
954 (license lgpl2.1))) ; all files
956 (define-public tegaki-wagomu-japanese
958 (inherit tegaki-zinnia-japanese)
959 (name "tegaki-wagomu-japanese")
964 (uri (tegaki-release-uri name version "zip"))
967 "0flj5id8xwsn7csrrzqz9prdikswnwm2wms0as2vzdpxzph1az4k"))
968 (modules remove-pre-compiled-files-modules)
969 (snippet (remove-pre-compiled-files "model"))))
970 (license lgpl2.1))) ; all files
972 (define-public tegaki-wagomu-japanese-kyoiku
974 (inherit tegaki-zinnia-japanese)
975 (name "tegaki-wagomu-japanese-kyoiku")
980 (uri (tegaki-release-uri name version "zip"))
983 "0v8crfh8rdf6ndp16g52s5jlrrlwh73xp38zjn5i9dlacx8kfqg1"))
984 (modules remove-pre-compiled-files-modules)
985 (snippet (remove-pre-compiled-files "model"))))
986 (license lgpl2.1))) ; all files
988 (define-public tegaki-wagomu-japanese-joyo
990 (inherit tegaki-zinnia-japanese)
991 (name "tegaki-wagomu-japanese-joyo")
996 (uri (tegaki-release-uri name version "zip"))
999 "0wk8shpr963zp328g991qs6abpnacq4242003m687z2d6yp7nph2"))
1000 (modules remove-pre-compiled-files-modules)
1001 (snippet (remove-pre-compiled-files "model"))))
1002 (license lgpl2.1))) ; all files
1004 (define-public tegaki-wagomu-simplified-chinese
1006 (inherit tegaki-zinnia-japanese)
1007 (name "tegaki-wagomu-simplified-chinese")
1012 (uri (tegaki-release-uri name version "zip"))
1015 "0wqprynigqxqxv128i1smh81gxvmjj056d9qpznxa3n9f5ymlbj6"))
1016 (modules remove-pre-compiled-files-modules)
1017 (snippet (remove-pre-compiled-files "model"))))
1018 (license lgpl2.1))) ; all files
1020 ;;; Upstream does not provide the source for tegaki-wagomu-traditional-chinese.
1021 ;;; Therefore, we use the source for tegaki-zinnia-traditional-chinese and
1022 ;;; patch the Makefile accordingly.
1023 (define-public tegaki-wagomu-traditional-chinese
1025 (inherit tegaki-zinnia-traditional-chinese)
1026 (name "tegaki-wagomu-traditional-chinese")
1028 (substitute-keyword-arguments
1029 (package-arguments tegaki-zinnia-traditional-chinese)
1030 ((#:phases phases '%standard-phases)
1031 `(modify-phases ,phases
1034 (let ((configure (assq-ref ,phases 'configure)))
1035 (apply configure args))
1036 (substitute* "Makefile"
1037 (("zinnia") "wagomu"))
1039 (license lgpl2.1))) ; all files
1041 (define-public link-grammar
1043 (name "link-grammar")
1047 (uri (string-append "https://www.abisource.com/downloads/"
1048 "link-grammar/" version
1049 "/link-grammar-" version ".tar.gz"))
1052 "0ak1v469k56v3511kxxkxvx1nw6zcxcl0f1kcvc82ffacqbr4y96"))))
1053 (build-system gnu-build-system)
1054 (home-page "https://www.abisource.com/projects/link-grammar/")
1055 (synopsis "Link grammar parser")
1056 (description "The Link Grammar Parser is a syntactic parser of English,
1057 Russian, Arabic and Persian (and other languages as well), based on Link
1058 Grammar, an original theory of syntax and morphology. Given a sentence, the
1059 system assigns to it a syntactic structure, which consists of a set of
1060 labelled links connecting pairs of words. The parser also produces a
1061 \"constituent\" (HPSG style phrase tree) representation of a sentence (showing
1062 noun phrases, verb phrases, etc.).")
1065 (define-public praat
1072 (url "https://github.com/praat/praat")
1073 (commit (string-append "v" version))))
1074 (file-name (git-file-name name version))
1077 "1rx4qvl0dd85x0r6pl0zk4bysx9ykxl05kywjr4pyvv6dvpswkrm"))))
1078 (build-system gnu-build-system)
1080 `(#:tests? #f; no test target
1082 (modify-phases %standard-phases
1085 (copy-file "makefiles/makefile.defs.linux.pulse" "makefile.defs")
1088 (lambda* (#:key outputs #:allow-other-keys)
1089 (let* ((out (assoc-ref outputs "out"))
1090 (bin (string-append out "/bin")))
1092 (copy-file "praat" (string-append bin "/praat")))
1095 `(("alsa-lib" ,alsa-lib)
1098 ("publesaudio" ,pulseaudio)))
1100 `(("pkg-config" ,pkg-config)))
1101 (home-page "http://www.fon.hum.uva.nl/praat/")
1102 (synopsis "Doing phonetics by computer")
1103 (description "Praat is a tool to perform phonetics tasks. It can do speach
1104 analysis (pitch, formant, intensity, ...), speach synthesis, labeling, segmenting