1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2017, 2018, 2020 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 anthy)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages audio)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages docbook)
31 #:use-module (gnu packages emacs)
32 #:use-module (gnu packages freedesktop)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages gnome)
36 #:use-module (gnu packages gtk)
37 #:use-module (gnu packages ibus)
38 #:use-module (gnu packages java)
39 #:use-module (gnu packages linux)
40 #:use-module (gnu packages llvm)
41 #:use-module (gnu packages man)
42 #:use-module (gnu packages ncurses)
43 #:use-module (gnu packages ocr)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages pulseaudio)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages perl-check)
49 #:use-module (gnu packages qt)
50 #:use-module (gnu packages sqlite)
51 #:use-module (gnu packages serialization)
52 #:use-module (gnu packages swig)
53 #:use-module (gnu packages texinfo)
54 #:use-module (gnu packages web)
55 #:use-module (gnu packages xml)
56 #:use-module (gnu packages xdisorg)
57 #:use-module (gnu packages xorg)
58 #:use-module (guix packages)
59 #:use-module (guix build-system cmake)
60 #:use-module (guix build-system glib-or-gtk)
61 #:use-module (guix build-system gnu)
62 #:use-module (guix build-system perl)
63 #:use-module (guix build-system python)
64 #:use-module (guix build-system qt)
65 #:use-module ((guix licenses) #:prefix license:)
66 #:use-module (guix download)
67 #:use-module (guix git-download)
68 #:use-module (guix utils))
79 (url "https://github.com/hamonikr/nimf.git")
81 (string-append "nimf-" version))))
83 (git-file-name name version))
85 (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
86 (build-system glib-or-gtk-build-system)
87 (outputs '("out" "gtk" "qt" "doc"))
90 (,@%glib-or-gtk-build-system-modules
91 (guix build cmake-build-system)
92 (guix build qt-build-system)
93 (guix build qt-utils))
95 ((guix build glib-or-gtk-build-system)
96 ((guix build qt-build-system)
101 "--with-im-config-data"
102 "--with-imsettings-data"
103 (string-append "--with-html-dir="
104 (assoc-ref %outputs "doc")
105 "/share/gtk-doc/html"))
107 (modify-phases %standard-phases
108 (add-after 'unpack 'disable-qt4
110 (substitute* '("configure.ac" "modules/clients/Makefile.am")
116 (add-after 'disable-qt4 'patch-flags
117 (lambda* (#:key inputs #:allow-other-keys)
118 (substitute* "configure.ac"
122 (add-after 'patch-flags 'patch-docbook-xml
123 (lambda* (#:key inputs #:allow-other-keys)
124 (with-directory-excursion "docs"
125 (substitute* "nimf-docs.xml"
126 (("http://www.oasis-open.org/docbook/xml/4.3/")
127 (string-append (assoc-ref inputs "docbook-xml-4.3")
128 "/xml/dtd/docbook/"))))
130 (add-after 'patch-docbook-xml 'patch-paths
131 (lambda* (#:key inputs outputs #:allow-other-keys)
132 (substitute* "configure.ac"
133 (("/usr/share/anthy/anthy.dic")
134 (search-input-file inputs "/share/anthy/anthy.dic")))
135 (substitute* "configure.ac"
136 (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
137 (string-append (assoc-ref inputs "gtk+:bin")
138 "/bin:$GTK3_LIBDIR/libgtk-3-0"))
139 (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
140 (string-append (assoc-ref inputs "gtk+-2:bin")
141 "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
142 (substitute* "modules/clients/gtk/Makefile.am"
143 (("\\$\\(GTK3_LIBDIR\\)")
144 (string-append (assoc-ref outputs "gtk")
146 (("\\$\\(GTK2_LIBDIR\\)")
147 (string-append (assoc-ref outputs "gtk")
149 (substitute* "modules/clients/qt5/Makefile.am"
150 (("\\$\\(QT5_IM_MODULE_DIR\\)")
151 (string-append (assoc-ref outputs "qt")
152 "/lib/qt5/plugins/inputmethods")))
153 (substitute* '("bin/nimf-settings/Makefile.am"
154 "data/apparmor-abstractions/Makefile.am"
155 "data/Makefile.am" "data/im-config/Makefile.am"
156 "data/imsettings/Makefile.am")
158 (string-append (assoc-ref outputs "out")
161 (string-append (assoc-ref outputs "out")
164 (add-after 'install 'qt-wrap
165 (assoc-ref qt:%standard-phases 'qt-wrap)))))
167 `(("autoconf" ,autoconf)
168 ("automake" ,automake)
169 ("docbook-xml-4.3" ,docbook-xml-4.3)
170 ("gettext" ,gettext-minimal)
171 ("gobject-introspection" ,gobject-introspection)
172 ("gtk+-2:bin" ,gtk+-2 "bin")
173 ("gtk+:bin" ,gtk+ "bin")
174 ("gtk-doc" ,gtk-doc/stable)
175 ("intltool" ,intltool)
178 ("pkg-config" ,pkg-config)
182 ("appindicator" ,libappindicator)
185 ("hangul" ,libhangul)
187 ("m17n-lib" ,m17n-lib)
192 ("wayland-protocols" ,wayland-protocols)
194 ("xkbcommon" ,libxkbcommon)
195 ("xklavier" ,libxklavier)))
198 (synopsis "Lightweight input method framework")
199 (description "Nimf is a lightweight, fast and extensible input method
200 framework. This package provides a fork of the original nimf project, that
201 focuses especially on Korean input (Hangul, Hanja, ...).")
202 (home-page "https://github.com/hamonikr/nimf/")
203 (license license:lgpl3+)))
214 (url "https://github.com/hime-ime/hime.git")
216 (string-append "v" version))))
218 (git-file-name name version))
220 (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
221 (build-system glib-or-gtk-build-system)
223 `(#:tests? #f ; No target
225 (,@%glib-or-gtk-build-system-modules
226 (guix build cmake-build-system)
227 (guix build qt-build-system)
228 (guix build qt-utils))
230 ((guix build glib-or-gtk-build-system)
231 ((guix build qt-build-system)
237 ;; error: unknown type name ‘GtkStatusIcon’
238 "--disable-system-tray")
240 (modify-phases %standard-phases
241 (add-after 'unpack 'patch-std
243 (substitute* "configure"
249 (add-after 'install 'qt-wrap
250 (assoc-ref qt:%standard-phases 'qt-wrap)))))
252 `(("gettext" ,gettext-minimal)
253 ("pkg-config" ,pkg-config)
254 ("whereis" ,util-linux)))
257 ("appindicator" ,libappindicator)
258 ("chewing" ,libchewing)
262 (synopsis "HIME Input Method Editor")
263 (description "Hime is an extremely easy-to-use input method framework. It
264 is lightweight, stable, powerful and supports many commonly used input methods,
265 including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
266 Random Cage Fighting Birds, Cool Music etc.")
267 (home-page "http://hime-ime.github.io/")
268 (license (list license:gpl2+ license:lgpl2.1+
269 license:fdl1.2+)))) ; documentation
271 (define-public libchewing
280 (url "https://github.com/chewing/libchewing.git")
282 (string-append "v" version))))
284 (git-file-name name version))
286 (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
287 (build-system gnu-build-system)
289 `(;; test-easy-symbol and test-fullshape fail with multiple cores.
292 (modify-phases %standard-phases
293 (add-after 'unpack 'disable-failing-tests
295 (substitute* "test/Makefile.am"
304 ((" test-keyboardless ")
306 ((" test-special-symbol ")
310 ((" test-regression ")
312 ((" test-userphrase ")
316 `(("autoconf" ,autoconf)
317 ("automake" ,automake)
320 ("pkg-config" ,pkg-config)
321 ("python" ,python-wrapper)
322 ("texinfo" ,texinfo)))
324 (list ncurses sqlite))
325 (synopsis "Chinese phonetic input method")
326 (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
327 method, one of the most popular choices for Traditional Chinese users.")
328 (home-page "http://chewing.im/")
329 (license license:lgpl2.1+)))
331 (define-public liblouis
340 (url "https://github.com/liblouis/liblouis")
341 (commit (string-append "v" version))))
342 (file-name (git-file-name name version))
344 (base32 "1ljy5xsy7vf2r0ix0d7bqcr6qvr6897f8madsx9zlm1mrj31n5px"))))
345 (build-system gnu-build-system)
346 (outputs '("out" "bin" "doc" "python"))
353 (modify-phases %standard-phases
354 (add-after 'install 'install-python-extension
355 (lambda* (#:key outputs #:allow-other-keys)
356 (with-directory-excursion "python"
357 (invoke "python" "setup.py" "install"
358 (string-append "--prefix="
359 (assoc-ref outputs "python"))
362 `(("autoconf" ,autoconf)
363 ("automake" ,automake)
364 ("clang-format" ,clang)
365 ("help2man" ,help2man)
368 ("makeinfo" ,texinfo)
370 ("pkg-config" ,pkg-config)
371 ("python" ,python-wrapper)))
372 (synopsis "Braille translator and back-translator")
373 (description "Liblouis is a braille translator and back-translator named in
374 honor of Louis Braille. It features support for computer and literary braille,
375 supports contracted and uncontracted translation for many languages and has
376 support for hyphenation. New languages can easily be added through tables that
377 support a rule- or dictionary based approach. Tools for testing and debugging
378 tables are also included. Liblouis also supports math braille, Nemeth and
380 (home-page "http://liblouis.org/")
381 (license (list license:lgpl2.1+ ; library
382 license:gpl3+)))) ; tools
384 (define-public liblouisutdml
386 (name "liblouisutdml")
393 (url "https://github.com/liblouis/liblouisutdml")
394 (commit (string-append "v" version))))
395 (file-name (git-file-name name version))
397 (base32 "0c32cfcfp0lyfd655c9ihhh3p7lhrb9q3xbll7q5dw4km86gaq6w"))))
398 (build-system gnu-build-system)
399 (outputs '("out" "bin" "doc"))
402 (list "--disable-static")))
404 `(("autoconf" ,autoconf)
405 ("automake" ,automake)
406 ("help2man" ,help2man)
407 ("jdk" ,icedtea "jdk")
409 ("makeinfo" ,texinfo)
410 ("pkg-config" ,pkg-config)))
414 `(("liblouis" ,liblouis)
415 ("liblouis:bin" ,liblouis "bin")))
416 (synopsis "Braille transcription services")
417 (description "Liblouisutdml is a library providing complete braille
418 transcription services for xml, html and text documents. It translates into
419 appropriate braille codes and formats according to its style sheet and the
420 specifications in the document.")
421 (home-page "http://liblouis.org/")
422 (license (list license:lgpl3+ ; library
423 license:gpl3+)))) ; tools
425 (define-public libstemmer
432 (uri "https://snowballstem.org/dist/libstemmer_c.tgz")
434 (base32 "1z2xvrjsaaypc04lwz7dg8mjm5cq1gzmn0l544pn6y2ll3r7ckh5"))))
435 (build-system gnu-build-system)
437 `(#:tests? #f ; No tests exist
440 (string-append "CC=" ,(cc-for-target))
443 (modify-phases %standard-phases
446 (lambda* (#:key outputs #:allow-other-keys)
447 (let* ((out (assoc-ref outputs "out"))
448 (out-bin (string-append out "/bin"))
449 (out-include (string-append out "/include"))
450 (out-lib (string-append out "/lib")))
451 (install-file "stemwords" out-bin)
452 (install-file "include/libstemmer.h" out-include)
453 (rename-file "libstemmer.o" "libstemmer.a")
454 (install-file "libstemmer.a" out-lib)
456 (synopsis "Stemming Library")
457 (description "LibStemmer provides stemming library, supporting several
459 (home-page "https://snowballstem.org/")
460 (license license:bsd-3)))
462 (define-public perl-lingua-en-findnumber
464 (name "perl-lingua-en-findnumber")
469 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
470 "Lingua-EN-FindNumber-" version ".tar.gz"))
473 "015ximzdp42v824llwlg2pd77vd0d172lb4xs55q9f9zhqf6s5qx"))))
474 (build-system perl-build-system)
476 (list perl-lingua-en-words2nums))
477 (home-page "https://metacpan.org/release/Lingua-EN-FindNumber")
478 (synopsis "Locate (written) numbers in English text")
479 (description "This module provides a regular expression for finding
480 numbers in English text. It also provides functions for extracting and
481 manipulating such numbers.")
482 (license license:perl-license)))
484 (define-public perl-lingua-en-inflect
486 (name "perl-lingua-en-inflect")
491 (uri (string-append "mirror://cpan/authors/id/D/DC/DCONWAY/"
492 "Lingua-EN-Inflect-" version ".tar.gz"))
495 "0j8d1f1wvmgc11d71pc8xp8fv5a1nb2yfw1dgd19xhscn1klpvzw"))))
496 (build-system perl-build-system)
497 (native-inputs (list perl-module-build))
498 (home-page "https://metacpan.org/release/Lingua-EN-Inflect")
499 (synopsis "Convert singular to plural")
500 (description "Lingua::EN::Inflect provides plural inflections,
501 \"a\"/\"an\" selection for English words, and manipulation of numbers as
502 words. Plural forms of all nouns, most verbs, and some adjectives are
503 provided. Where appropriate, \"classical\" variants (for example: \"brother\"
504 -> \"brethren\", \"dogma\" -> \"dogmata\", etc.) are also provided.")
505 (license license:perl-license)))
507 (define-public perl-lingua-en-inflect-number
509 (name "perl-lingua-en-inflect-number")
514 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
515 "Lingua-EN-Inflect-Number-" version ".tar.gz"))
518 "1gxccynkaqav43ww43jp4rzkyr36x97jd03yb5f6yx0jhn1k7yv6"))))
519 (build-system perl-build-system)
521 (list perl-lingua-en-inflect))
522 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Number")
523 (synopsis "Force number of words to singular or plural")
524 (description "This module extends the functionality of Lingua::EN::Inflect
525 with three new functions for determining plurality of a word and forcefully
526 converting a word to singular or plural.")
527 (license license:perl-license)))
529 (define-public perl-lingua-en-inflect-phrase
531 (name "perl-lingua-en-inflect-phrase")
536 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
537 "Lingua-EN-Inflect-Phrase-" version ".tar.gz"))
540 "1a6y1l2pjim2242wcpgz066di4pbzfgsjjdl7vg5a5wzm48qj1am"))))
541 (build-system perl-build-system)
543 (list perl-test-nowarnings))
545 (list perl-lingua-en-findnumber perl-lingua-en-inflect
546 perl-lingua-en-inflect-number perl-lingua-en-number-isordinal
547 perl-lingua-en-tagger))
548 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Phrase")
549 (synopsis "Inflect short English phrases")
550 (description "This module attempts to pluralize or singularize short
552 (license license:perl-license)))
554 (define-public perl-lingua-en-number-isordinal
556 (name "perl-lingua-en-number-isordinal")
561 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
562 "Lingua-EN-Number-IsOrdinal-" version ".tar.gz"))
565 "1mhqjvh2ad30gjab5b3a6mbr4aysyrscp4wp42yy5x6001a6km98"))))
566 (build-system perl-build-system)
568 (list perl-try-tiny perl-test-fatal))
570 (list perl-lingua-en-findnumber))
571 (home-page "https://metacpan.org/release/Lingua-EN-Number-IsOrdinal")
572 (synopsis "Detect if English number is ordinal or cardinal")
573 (description "This module will tell you if a number, either in words or as
574 digits, is a cardinal or ordinal number.")
575 (license license:perl-license)))
577 (define-public perl-lingua-en-tagger
579 (name "perl-lingua-en-tagger")
584 (uri (string-append "mirror://cpan/authors/id/A/AC/ACOBURN/"
585 "Lingua-EN-Tagger-" version ".tar.gz"))
588 "0nrnkvsf9f0a7lp82sanmy89ms2nqq1lvjqicvsagsvzp513bl5b"))))
589 (build-system perl-build-system)
591 (list perl-memoize-expirelru perl-lingua-stem perl-html-parser
593 (home-page "https://metacpan.org/release/Lingua-EN-Tagger")
594 (synopsis "Part-of-speech tagger for English natural language processing")
595 (description "This module is a probability based, corpus-trained tagger
596 that assigns part-of-speech tags to English text based on a lookup dictionary
597 and a set of probability values. The tagger assigns appropriate tags based on
598 conditional probabilities - it examines the preceding tag to determine the
599 appropriate tag for the current word. Unknown words are classified according
600 to word morphology or can be set to be treated as nouns or other parts of
601 speech. The tagger also extracts as many nouns and noun phrases as it can,
602 using a set of regular expressions.")
603 (license license:gpl3)))
605 (define-public perl-lingua-en-words2nums
607 (name "perl-lingua-en-words2nums")
612 (uri (string-append "mirror://cpan/authors/id/J/JO/JOEY/"
613 "Lingua-EN-Words2Nums-" version ".tar.gz"))
616 "118xx8qr1zbx30psv7ic55w65h15mc1vz6zicshfm96jgiwmcrb8"))))
617 (build-system perl-build-system)
618 (home-page "https://metacpan.org/release/Lingua-EN-Words2Nums")
619 (synopsis "Convert English text to numbers")
620 (description "This module converts English text into numbers. It supports
621 both ordinal and cardinal numbers, negative numbers, and very large numbers.")
622 (license license:perl-license)))
624 (define-public perl-lingua-pt-stemmer
626 (name "perl-lingua-pt-stemmer")
631 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
632 "Lingua-PT-Stemmer-" version ".tar.gz"))
635 "17c48sfbgwd2ivlgf59sr6jdhwa3aim8750f8pyzz7xpi8gz0var"))))
636 (build-system perl-build-system)
637 (home-page "https://metacpan.org/release/Lingua-PT-Stemmer")
638 (synopsis "Portuguese language stemming")
639 (description "This module implements a Portuguese stemming algorithm
640 proposed in the paper A Stemming Algorithm for the Portuguese Language by
641 Moreira, V. and Huyck, C.")
642 (license license:perl-license)))
644 (define-public perl-lingua-stem
646 (name "perl-lingua-stem")
651 (uri (string-append "mirror://cpan/authors/id/S/SN/SNOWHARE/"
652 "Lingua-Stem-" version ".tar.gz"))
655 "12avh2mnnc7llmmshrr5bgb473fvydxnlqrqbl2815mf2dp4pxcg"))))
656 (build-system perl-build-system)
658 (list perl-module-build))
660 (list perl-lingua-pt-stemmer
664 perl-lingua-stem-snowball-da
665 perl-snowball-norwegian
666 perl-snowball-swedish
668 (home-page "https://metacpan.org/release/Lingua-Stem")
669 (synopsis "Stemming of words in various languages")
670 (description "This routine applies stemming algorithms to its parameters,
671 returning the stemmed words as appropriate to the selected locale.")
672 (license license:perl-license)))
674 (define-public perl-lingua-stem-fr
676 (name "perl-lingua-stem-fr")
681 (uri (string-append "mirror://cpan/authors/id/S/SD/SDP/"
682 "Lingua-Stem-Fr-" version ".tar.gz"))
685 "0vyrspwzaqjxm5mqshf4wvwa3938mkajd1918d9ii2l9m2rn8kwx"))))
686 (build-system perl-build-system)
687 (home-page "https://metacpan.org/release/Lingua-Stem-Fr")
688 (synopsis "Porter's stemming algorithm for French")
689 (description "This module uses a modified version of the Porter Stemming
690 Algorithm to return a stemmed French word.")
691 (license license:perl-license)))
693 (define-public perl-lingua-stem-it
695 (name "perl-lingua-stem-it")
700 (uri (string-append "mirror://cpan/authors/id/A/AC/ACALPINI/"
701 "Lingua-Stem-It-" version ".tar.gz"))
704 "1207r183s5hlh4mfwa6p46vzm0dhvrs2dnss5s41a0gyfkxp7riq"))))
705 (build-system perl-build-system)
706 (home-page "https://metacpan.org/release/Lingua-Stem-It")
707 (synopsis "Porter's stemming algorithm for Italian")
708 (description "This module applies the Porter Stemming Algorithm to its
709 parameters, returning the stemmed Italian word.")
710 (license license:perl-license)))
712 (define-public perl-lingua-stem-ru
714 (name "perl-lingua-stem-ru")
719 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
720 "Lingua-Stem-Ru-" version ".tar.gz"))
723 "0a2jmdz7jn32qj5hyiw5kbv8fvlpmws8i00a6xcbkzb48yvwww0j"))))
724 (build-system perl-build-system)
725 (home-page "https://metacpan.org/release/Lingua-Stem-Ru")
726 (synopsis "Porter's stemming algorithm for Russian")
727 (description "This module applies the Porter Stemming Algorithm to its
728 parameters, returning the stemmed Russian (KOI8-R only) word.")
729 (license license:perl-license)))
731 (define-public perl-lingua-stem-snowball-da
733 (name "perl-lingua-stem-snowball-da")
738 (uri (string-append "mirror://cpan/authors/id/C/CI/CINE/"
739 "Lingua-Stem-Snowball-Da-" version ".tar.gz"))
742 "0mm0m7glm1s6i9f6a78jslw6wh573208arxhq93yriqmw17bwf9f"))))
743 (build-system perl-build-system)
744 (home-page "https://metacpan.org/release/Lingua-Stem-Snowball-Da")
745 (synopsis "Porters stemming algorithm for Danish")
746 (description "Lingua::Stem::Snowball::Da is a perl port of the danish
747 stemmer at http://snowball.sourceforge.net, it was originally altered from the
748 Lingua::Stem::Snowball::Se.")
749 (license license:gpl2)))
751 (define-public perl-snowball-norwegian
753 (name "perl-snowball-norwegian")
758 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
759 "Snowball-Norwegian-" version ".tar.gz"))
762 "0675v45bbsh7vr7kpf36xs2q79g02iq1kmfw22h20xdk4rzqvkqx"))))
763 (build-system perl-build-system)
764 (native-inputs (list perl-module-build))
765 (home-page "https://metacpan.org/release/Snowball-Norwegian")
766 (synopsis "Porters stemming algorithm for Norwegian")
767 (description "Lingua::Stem::Snowball::No is a perl port of the norwegian
768 stemmer at http://snowball.tartarus.org.")
769 (license license:perl-license)))
771 (define-public perl-snowball-swedish
773 (name "perl-snowball-swedish")
778 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
779 "Snowball-Swedish-" version ".tar.gz"))
782 "0agwc12jk5kmabnpsplw3wf4ii5w1zb159cpin44x3srb0sr5apg"))))
783 (build-system perl-build-system)
784 (native-inputs (list perl-module-build))
785 (home-page "https://metacpan.org/release/Snowball-Swedish")
786 (synopsis "Porters stemming algorithm for Swedish")
787 (description "Lingua::Stem::Snowball::Se is a perl port of the swedish
788 stemmer at http://snowball.sourceforge.net.")
789 (license license:perl-license)))
791 (define-public perl-string-toidentifier-en
793 (name "perl-string-toidentifier-en")
798 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
799 "String-ToIdentifier-EN-" version ".tar.gz"))
802 "12nw7h2yiybhdw0vnnpc7bif8ylhsn6kqf6s39dsrf9h54iq9yrs"))))
803 (build-system perl-build-system)
805 (list perl-lingua-en-inflect-phrase perl-text-unidecode
806 perl-namespace-clean))
807 (home-page "https://metacpan.org/release/String-ToIdentifier-EN")
808 (synopsis "Convert strings to English program identifiers")
809 (description "This module provides a utility method, \"to_identifier\" for
810 converting an arbitrary string into a readable representation using the ASCII
811 subset of \"\\w\" for use as an identifier in a computer program. The intent
812 is to make unique identifier names from which the content of the original
813 string can be easily inferred by a human just by reading the identifier.")
814 (license license:perl-license)))
816 (define-public perl-text-german
818 (name "perl-text-german")
823 (uri (string-append "mirror://cpan/authors/id/U/UL/ULPFR/"
824 "Text-German-" version ".tar.gz"))
827 "1p87pgap99lw0nv62i3ghvsi7yg90lhn8vsa3yqp75rd04clybcj"))))
828 (build-system perl-build-system)
829 (home-page "https://metacpan.org/release/Text-German")
830 (synopsis "German grundform reduction")
831 (description "This module is a rather incomplete implementation of work
832 done by Gudrun Putze-Meier.")
833 (license license:perl-license)))
835 (define* (tegaki-release-uri proj version
836 #:optional (ext "tar.gz"))
837 (string-append "https://github.com/tegaki/tegaki/releases/download"
838 "/v" version "/" proj "-" version "." ext))
840 (define remove-pre-compiled-files
842 "Return snippet for removing pre-compiled files matching one of the
844 `(begin (for-each delete-file
847 (any (cut string-suffix? <> name)
848 (map (cut string-append "." <>)
852 ;;; modules required for the above snippet
853 (define remove-pre-compiled-files-modules
858 (define-public python2-tegaki-wagomu
860 (name "python2-tegaki-wagomu")
865 (uri (tegaki-release-uri "tegaki-wagomu" version))
868 "1pzdiq4zy1nyylaj9i6v2h4h0r05klahskzpafpp367p4rysi1x9"))
869 (modules remove-pre-compiled-files-modules)
870 (snippet (remove-pre-compiled-files "pyc"))))
871 (build-system python-build-system)
873 `(#:python ,python-2 ; only Python 2 is supported
875 (modify-phases %standard-phases
876 (add-after 'unpack 'fix-recognizer
877 (lambda* (#:key inputs #:allow-other-keys)
878 ;; fix missing module and function
879 (substitute* "tegakiwagomu.py"
884 (("Results\\(candidates\\)")
890 (list pkg-config swig))
891 (home-page "https://tegaki.github.io/")
893 "Chinese and Japanese Handwriting Recognition (Recognition engine)")
895 "Tegaki is an ongoing project which aims to develop a free and open-source
896 modern implementation of handwriting recognition software, specifically
897 designed for Chinese (simplified and traditional) and Japanese, and that is
898 suitable for both the desktop and mobile devices.")
899 (license license:gpl2+))) ; all files
901 (define-public python2-tegaki-python
903 (inherit python2-tegaki-wagomu)
904 (name "python2-tegaki-python")
909 (uri (tegaki-release-uri "tegaki-python" version))
912 "0x93k7pw9nh0ywd97pr8pm7jv3f94nw044i5k0zvzhdpsjqvak7p"))
913 (modules remove-pre-compiled-files-modules)
914 (snippet (remove-pre-compiled-files "pyc"))))
916 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
918 `(modify-phases %standard-phases
919 (add-after 'unpack 'pre-configure
920 (lambda* (#:key inputs #:allow-other-keys)
921 ;; Always convert string to unicode to avoid the following error
922 ;; when running "tegaki-build" in python2-tegaki-tools:
924 ;; sqlite3.ProgrammingError: You must not use 8-bit bytestrings
925 ;; unless you use a text_factory that can interpret 8-bit
926 ;; bytestrings (like text_factory = str).
927 ;; It is highly recommended that you instead just switch your
928 ;; application to Unicode strings.
929 (substitute* "tegaki/charcol.py"
930 (("sqlite3.OptimizedUnicode")
931 "lambda s: unicode(s, 'utf-8')"))
932 (substitute* "tegaki/engine.py"
934 (assoc-ref inputs "python2-tegaki-wagomu")))
936 ;; override inherited inputs
940 (list python2-tegaki-wagomu python2-zinnia))
942 "Chinese and Japanese Handwriting Recognition (Base python library)")
943 (license (list license:gpl2+ ; all files except...
944 license:bsd-3 ; dictutils.py
945 license:zpl2.1)))) ; minjson.py
947 (define-public python2-tegaki-pygtk
949 (inherit python2-tegaki-wagomu)
950 (name "python2-tegaki-pygtk")
955 (uri (tegaki-release-uri "tegaki-pygtk" version))
958 "1cip0azxhjdj2dg2z85cp1z3lz4qwx3w1j7z4xmcm7npapmsaqs2"))
959 (modules remove-pre-compiled-files-modules)
960 (snippet (remove-pre-compiled-files "pyc"))))
962 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
964 `(modify-phases %standard-phases
965 (add-after 'unpack 'fix-paths
966 (lambda* (#:key inputs #:allow-other-keys)
967 (substitute* "tegakigtk/fakekey.py"
969 (search-input-file inputs
970 (string-append "/lib/" so)))
972 (search-input-file inputs
973 (string-append "/lib/" so))))))))))
974 (inputs ; required for sending key strokes
975 (list libx11 libxtst))
976 (native-inputs '()) ; override inherited inputs
978 (list python2-pygtk python2-tegaki-python))
979 (synopsis "Chinese and Japanese Handwriting Recognition (Base UI library)")
980 (license license:gpl2+)))
982 (define-public python2-tegaki-tools
984 (inherit python2-tegaki-wagomu)
985 (name "python2-tegaki-tools")
990 (uri (tegaki-release-uri "tegaki-tools" version))
993 "0xxv97ggh2jgldw3r7y59lv3fhz733r6l7mdn6nh4m0gvb0ja971"))
994 (modules remove-pre-compiled-files-modules)
995 (snippet (remove-pre-compiled-files "pyc"))))
997 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
998 ((#:phases _) '%standard-phases)))
1000 (list python2-tegaki-pygtk))
1001 ;; override inherited inputs
1003 (propagated-inputs '())
1004 (synopsis "Chinese and Japanese Handwriting Recognition (Advanced tools)")
1005 ;; Files in gifenc/ are licensed under gpl3+ while other files are licensed
1006 ;; under gpl2+. Therefore, the combined work is licensed under gpl3+.
1007 (license license:gpl3+)))
1009 (define-public python2-tegaki-recognize
1010 (let ((commit "eceec69fe651d0733c8c8752dae569d2283d0f3c")
1013 (inherit python2-tegaki-tools)
1014 (name "python2-tegaki-recognize")
1015 ;; version copied from <https://github.com/tegaki/tegaki/releases>
1016 (version (git-version "0.3.1" revision commit))
1019 ;; We use GIT-FETCH because 'tegaki-recognize.desktop.in' and
1020 ;; 'tegaki-recognize.in' are missing in the tarball.
1023 (url "https://github.com/tegaki/tegaki")
1027 "09mw2if9p885phbgah5f95q3fwy7s5b46qlmpxqyzfcnj6g7afr5"))
1028 (file-name (git-file-name name version))
1029 (modules `((guix build utils)
1032 ,@remove-pre-compiled-files-modules))
1035 ;; remove unnecessary files with potentially different license
1036 (for-each delete-file-recursively
1038 (negate (cut member <> '("tegaki-recognize"
1040 ,(remove-pre-compiled-files "pyc")
1043 (substitute-keyword-arguments (package-arguments python2-tegaki-tools)
1045 `(modify-phases %standard-phases
1046 (add-after 'unpack 'chdir
1048 (chdir "tegaki-recognize")
1050 ;; 'setup.py' script does not support one of the Python build
1051 ;; system's default flags, "--single-version-externally-managed"
1053 (lambda* (#:key outputs #:allow-other-keys)
1054 (invoke "python" "setup.py" "install"
1055 (string-append "--prefix=" (assoc-ref outputs "out"))
1058 (synopsis "Chinese and Japanese Handwriting Recognition (Main program)")
1059 (license license:gpl2+))))
1061 (define-public tegaki-zinnia-japanese
1063 (inherit python2-tegaki-wagomu)
1064 (name "tegaki-zinnia-japanese")
1069 (uri (tegaki-release-uri name version "zip"))
1072 "1nmg9acxhcqly9gwkyb9m0hpy76fll91ywk4b1q4xms0ajxip1h7"))
1073 (modules remove-pre-compiled-files-modules)
1074 (snippet (remove-pre-compiled-files "model"))))
1075 (build-system gnu-build-system)
1077 `(#:tests? #f ; no tests
1079 (modify-phases %standard-phases
1081 (lambda* (#:key outputs #:allow-other-keys)
1082 (substitute* "Makefile"
1084 (assoc-ref outputs "out")))
1086 ;; override inherited inputs
1089 (list python2-tegaki-tools))
1090 (propagated-inputs '())
1091 (native-search-paths
1092 (list (search-path-specification
1093 (variable "TEGAKI_MODEL_PATH")
1094 (files '("share/tegaki/models")))))
1095 (synopsis "Chinese and Japanese Handwriting Recognition (Model)")
1096 (license license:lgpl2.1)))
1098 (define-public tegaki-zinnia-japanese-light
1100 (inherit tegaki-zinnia-japanese)
1101 (name "tegaki-zinnia-japanese-light")
1106 (uri (tegaki-release-uri name version "zip"))
1109 "0x0fs29ylqzxd6xvg51h7rigpbisd7q8v11df425ib2j792yfyf8"))
1110 (modules remove-pre-compiled-files-modules)
1111 (snippet (remove-pre-compiled-files "model"))))
1112 (license license:lgpl2.1)))
1114 (define-public tegaki-zinnia-japanese-kyoiku
1116 (inherit tegaki-zinnia-japanese)
1117 (name "tegaki-zinnia-japanese-kyoiku")
1122 (uri (tegaki-release-uri name version "zip"))
1125 "0am94bcpmbzplxdnwn9gk15sgaizvcfhmv13mk14jjvx3419cvvx"))
1126 (modules remove-pre-compiled-files-modules)
1127 (snippet (remove-pre-compiled-files "model"))))
1128 (license license:lgpl2.1)))
1130 (define-public tegaki-zinnia-japanese-joyo
1132 (inherit tegaki-zinnia-japanese)
1133 (name "tegaki-zinnia-japanese-joyo")
1138 (uri (tegaki-release-uri name version "zip"))
1141 "1v0j40lzdyiz01ayws0b8r7fsdy2mr32658382kz4wyk883wzx2z"))
1142 (modules remove-pre-compiled-files-modules)
1143 (snippet (remove-pre-compiled-files "model"))))
1144 (license license:lgpl2.1)))
1146 (define-public tegaki-zinnia-simplified-chinese
1148 (inherit tegaki-zinnia-japanese)
1149 (name "tegaki-zinnia-simplified-chinese")
1154 (uri (tegaki-release-uri name version "zip"))
1157 "18wq0jccv7lpnrfnzspyc110d6pj2v1i21xcx4fmgzz1lnln3fs5"))
1158 (modules remove-pre-compiled-files-modules)
1159 (snippet (remove-pre-compiled-files "model"))))
1160 (license license:lgpl2.1)))
1162 (define-public tegaki-zinnia-simplified-chinese-light
1164 (inherit tegaki-zinnia-japanese)
1165 (name "tegaki-zinnia-simplified-chinese-light")
1170 (uri (tegaki-release-uri name version "zip"))
1173 "0v24yf0w0p03lb7fyx128a75mwzad166bigvlbrzqnad789qg1sr"))
1174 (modules remove-pre-compiled-files-modules)
1175 (snippet (remove-pre-compiled-files "model"))))
1176 (license license:lgpl2.1)))
1178 (define-public tegaki-zinnia-traditional-chinese
1180 (inherit tegaki-zinnia-japanese)
1181 (name "tegaki-zinnia-traditional-chinese")
1186 (uri (tegaki-release-uri name version "zip"))
1189 "140nlp6hynrai2svs5670jjfw1za6ayflhyj2dl0bzsfgbk3447l"))
1190 (modules remove-pre-compiled-files-modules)
1191 (snippet (remove-pre-compiled-files "model"))))
1192 (license license:lgpl2.1)))
1194 (define-public tegaki-zinnia-traditional-chinese-light
1196 (inherit tegaki-zinnia-japanese)
1197 (name "tegaki-zinnia-traditional-chinese-light")
1202 (uri (tegaki-release-uri name version "zip"))
1205 "1m6yk6a57vs9wg5y50qciwi1ahhmklp2mgsjysbj4mnyzv6yhcr2"))
1206 (modules remove-pre-compiled-files-modules)
1207 (snippet (remove-pre-compiled-files "model"))))
1208 (license license:lgpl2.1)))
1210 (define-public tegaki-wagomu-japanese
1212 (inherit tegaki-zinnia-japanese)
1213 (name "tegaki-wagomu-japanese")
1218 (uri (tegaki-release-uri name version "zip"))
1221 "0flj5id8xwsn7csrrzqz9prdikswnwm2wms0as2vzdpxzph1az4k"))
1222 (modules remove-pre-compiled-files-modules)
1223 (snippet (remove-pre-compiled-files "model"))))
1224 (license license:lgpl2.1)))
1226 (define-public tegaki-wagomu-japanese-kyoiku
1228 (inherit tegaki-zinnia-japanese)
1229 (name "tegaki-wagomu-japanese-kyoiku")
1234 (uri (tegaki-release-uri name version "zip"))
1237 "0v8crfh8rdf6ndp16g52s5jlrrlwh73xp38zjn5i9dlacx8kfqg1"))
1238 (modules remove-pre-compiled-files-modules)
1239 (snippet (remove-pre-compiled-files "model"))))
1240 (license license:lgpl2.1)))
1242 (define-public tegaki-wagomu-japanese-joyo
1244 (inherit tegaki-zinnia-japanese)
1245 (name "tegaki-wagomu-japanese-joyo")
1250 (uri (tegaki-release-uri name version "zip"))
1253 "0wk8shpr963zp328g991qs6abpnacq4242003m687z2d6yp7nph2"))
1254 (modules remove-pre-compiled-files-modules)
1255 (snippet (remove-pre-compiled-files "model"))))
1256 (license license:lgpl2.1)))
1258 (define-public tegaki-wagomu-simplified-chinese
1260 (inherit tegaki-zinnia-japanese)
1261 (name "tegaki-wagomu-simplified-chinese")
1266 (uri (tegaki-release-uri name version "zip"))
1269 "0wqprynigqxqxv128i1smh81gxvmjj056d9qpznxa3n9f5ymlbj6"))
1270 (modules remove-pre-compiled-files-modules)
1271 (snippet (remove-pre-compiled-files "model"))))
1272 (license license:lgpl2.1)))
1274 ;;; Upstream does not provide the source for tegaki-wagomu-traditional-chinese.
1275 ;;; Therefore, we use the source for tegaki-zinnia-traditional-chinese and
1276 ;;; patch the Makefile accordingly.
1277 (define-public tegaki-wagomu-traditional-chinese
1279 (inherit tegaki-zinnia-traditional-chinese)
1280 (name "tegaki-wagomu-traditional-chinese")
1282 (substitute-keyword-arguments
1283 (package-arguments tegaki-zinnia-traditional-chinese)
1284 ((#:phases phases '%standard-phases)
1285 `(modify-phases ,phases
1288 (let ((configure (assq-ref ,phases 'configure)))
1289 (apply configure args))
1290 (substitute* "Makefile"
1291 (("zinnia") "wagomu"))
1293 (license license:lgpl2.1)))
1295 (define-public link-grammar
1297 (name "link-grammar")
1301 (uri (string-append "https://www.abisource.com/downloads/"
1302 "link-grammar/" version
1303 "/link-grammar-" version ".tar.gz"))
1306 "0ak1v469k56v3511kxxkxvx1nw6zcxcl0f1kcvc82ffacqbr4y96"))))
1307 (build-system gnu-build-system)
1308 (home-page "https://www.abisource.com/projects/link-grammar/")
1309 (synopsis "Link grammar parser")
1310 (description "The Link Grammar Parser is a syntactic parser of English,
1311 Russian, Arabic and Persian (and other languages as well), based on Link
1312 Grammar, an original theory of syntax and morphology. Given a sentence, the
1313 system assigns to it a syntactic structure, which consists of a set of
1314 labelled links connecting pairs of words. The parser also produces a
1315 \"constituent\" (HPSG style phrase tree) representation of a sentence (showing
1316 noun phrases, verb phrases, etc.).")
1317 (license license:bsd-3)))
1319 (define-public praat
1326 (url "https://github.com/praat/praat")
1327 (commit (string-append "v" version))))
1328 (file-name (git-file-name name version))
1331 "1pjfifyv3wjn68l3i2dr83xm75nf2kxvfxrk9qqbmwz58p183jw4"))))
1332 (build-system gnu-build-system)
1334 `(#:tests? #f ; no test target
1336 (modify-phases %standard-phases
1339 (copy-file "makefiles/makefile.defs.linux.pulse" "makefile.defs")
1342 (lambda* (#:key outputs #:allow-other-keys)
1343 (let* ((out (assoc-ref outputs "out"))
1344 (bin (string-append out "/bin")))
1346 (copy-file "praat" (string-append bin "/praat")))
1349 `(("alsa-lib" ,alsa-lib)
1352 ("publesaudio" ,pulseaudio)))
1355 (home-page "https://www.fon.hum.uva.nl/praat/")
1356 (synopsis "Doing phonetics by computer")
1357 (description "Praat is a tool to perform phonetics tasks. It can do speech
1358 analysis (pitch, formant, intensity, ...), speech synthesis, labelling, segmenting
1360 (license license:gpl2+)))