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 swig)
52 #:use-module (gnu packages texinfo)
53 #:use-module (gnu packages web)
54 #:use-module (gnu packages xml)
55 #:use-module (gnu packages xdisorg)
56 #:use-module (gnu packages xorg)
57 #:use-module (guix packages)
58 #:use-module (guix build-system cmake)
59 #:use-module (guix build-system glib-or-gtk)
60 #:use-module (guix build-system gnu)
61 #:use-module (guix build-system perl)
62 #:use-module (guix build-system python)
63 #:use-module (guix build-system qt)
64 #:use-module ((guix licenses) #:prefix license:)
65 #:use-module (guix download)
66 #:use-module (guix git-download)
67 #:use-module (guix utils))
78 (url "https://github.com/hamonikr/nimf.git")
80 (string-append "nimf-" version))))
82 (git-file-name name version))
84 (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
85 (build-system glib-or-gtk-build-system)
86 (outputs '("out" "gtk" "qt" "doc"))
89 (,@%glib-or-gtk-build-system-modules
90 (guix build cmake-build-system)
91 (guix build qt-build-system))
93 ((guix build glib-or-gtk-build-system)
94 ((guix build qt-build-system)
99 "--with-im-config-data"
100 "--with-imsettings-data"
101 (string-append "--with-html-dir="
102 (assoc-ref %outputs "doc")
103 "/share/gtk-doc/html"))
105 (modify-phases %standard-phases
106 (add-after 'unpack 'disable-qt4
108 (substitute* '("configure.ac" "modules/clients/Makefile.am")
114 (add-after 'disable-qt4 'patch-flags
115 (lambda* (#:key inputs #:allow-other-keys)
116 (substitute* "configure.ac"
120 (add-after 'patch-flags 'patch-docbook-xml
121 (lambda* (#:key inputs #:allow-other-keys)
122 (with-directory-excursion "docs"
123 (substitute* "nimf-docs.xml"
124 (("http://www.oasis-open.org/docbook/xml/4.3/")
125 (string-append (assoc-ref inputs "docbook-xml-4.3")
126 "/xml/dtd/docbook/"))))
128 (add-after 'patch-docbook-xml 'patch-paths
129 (lambda* (#:key inputs outputs #:allow-other-keys)
130 (substitute* "configure.ac"
131 (("/usr/share/anthy/anthy.dic")
132 (string-append (assoc-ref inputs "anthy")
133 "/share/anthy/anthy.dic")))
134 (substitute* "configure.ac"
135 (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
136 (string-append (assoc-ref inputs "gtk+:bin")
137 "/bin:$GTK3_LIBDIR/libgtk-3-0"))
138 (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
139 (string-append (assoc-ref inputs "gtk+-2:bin")
140 "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
141 (substitute* "modules/clients/gtk/Makefile.am"
142 (("\\$\\(GTK3_LIBDIR\\)")
143 (string-append (assoc-ref outputs "gtk")
145 (("\\$\\(GTK2_LIBDIR\\)")
146 (string-append (assoc-ref outputs "gtk")
148 (substitute* "modules/clients/qt5/Makefile.am"
149 (("\\$\\(QT5_IM_MODULE_DIR\\)")
150 (string-append (assoc-ref outputs "qt")
151 "/lib/qt5/plugins/inputmethods")))
152 (substitute* '("bin/nimf-settings/Makefile.am"
153 "data/apparmor-abstractions/Makefile.am"
154 "data/Makefile.am" "data/im-config/Makefile.am"
155 "data/imsettings/Makefile.am")
157 (string-append (assoc-ref outputs "out")
160 (string-append (assoc-ref outputs "out")
163 (add-after 'install 'qt-wrap
164 (assoc-ref qt:%standard-phases 'qt-wrap)))))
166 `(("autoconf" ,autoconf)
167 ("automake" ,automake)
168 ("docbook-xml-4.3" ,docbook-xml-4.3)
169 ("gettext" ,gettext-minimal)
170 ("gobject-introspection" ,gobject-introspection)
171 ("gtk+-2:bin" ,gtk+-2 "bin")
172 ("gtk+:bin" ,gtk+ "bin")
173 ("gtk-doc" ,gtk-doc/stable)
174 ("intltool" ,intltool)
177 ("pkg-config" ,pkg-config)
181 ("appindicator" ,libappindicator)
184 ("hangul" ,libhangul)
186 ("m17n-lib" ,m17n-lib)
191 ("wayland-protocols" ,wayland-protocols)
193 ("xkbcommon" ,libxkbcommon)
194 ("xklavier" ,libxklavier)))
197 (synopsis "Lightweight input method framework")
198 (description "Nimf is a lightweight, fast and extensible input method
199 framework. This package provides a fork of the original nimf project, that
200 focuses especially on Korean input (Hangul, Hanja, ...).")
201 (home-page "https://github.com/hamonikr/nimf/")
202 (license license:lgpl3+)))
213 (url "https://github.com/hime-ime/hime.git")
215 (string-append "v" version))))
217 (git-file-name name version))
219 (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
220 (build-system glib-or-gtk-build-system)
222 `(#:tests? #f ; No target
224 (,@%glib-or-gtk-build-system-modules
225 (guix build cmake-build-system)
226 (guix build qt-build-system))
228 ((guix build glib-or-gtk-build-system)
229 ((guix build qt-build-system)
235 ;; error: unknown type name ‘GtkStatusIcon’
236 "--disable-system-tray")
238 (modify-phases %standard-phases
239 (add-after 'unpack 'patch-std
241 (substitute* "configure"
247 (add-after 'install 'qt-wrap
248 (assoc-ref qt:%standard-phases 'qt-wrap)))))
250 `(("gettext" ,gettext-minimal)
251 ("pkg-config" ,pkg-config)
252 ("whereis" ,util-linux)))
255 ("appindicator" ,libappindicator)
256 ("chewing" ,libchewing)
260 (synopsis "HIME Input Method Editor")
261 (description "Hime is an extremely easy-to-use input method framework. It
262 is lightweight, stable, powerful and supports many commonly used input methods,
263 including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
264 Random Cage Fighting Birds, Cool Music etc.")
265 (home-page "http://hime-ime.github.io/")
266 (license (list license:gpl2+ license:lgpl2.1+
267 license:fdl1.2+)))) ; documentation
269 (define-public libchewing
278 (url "https://github.com/chewing/libchewing.git")
280 (string-append "v" version))))
282 (git-file-name name version))
284 (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
285 (build-system gnu-build-system)
287 `(;; test-easy-symbol and test-fullshape fail with multiple cores.
290 (modify-phases %standard-phases
291 (add-after 'unpack 'disable-failing-tests
293 (substitute* "test/Makefile.am"
302 ((" test-keyboardless ")
304 ((" test-special-symbol ")
308 ((" test-regression ")
310 ((" test-userphrase ")
314 `(("autoconf" ,autoconf)
315 ("automake" ,automake)
318 ("pkg-config" ,pkg-config)
319 ("python" ,python-wrapper)
320 ("texinfo" ,texinfo)))
322 `(("ncurses" ,ncurses)
324 (synopsis "Chinese phonetic input method")
325 (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
326 method, one of the most popular choices for Traditional Chinese users.")
327 (home-page "http://chewing.im/")
328 (license license:lgpl2.1+)))
330 (define-public liblouis
339 (url "https://github.com/liblouis/liblouis")
340 (commit (string-append "v" version))))
341 (file-name (git-file-name name version))
343 (base32 "1ljy5xsy7vf2r0ix0d7bqcr6qvr6897f8madsx9zlm1mrj31n5px"))))
344 (build-system gnu-build-system)
345 (outputs '("out" "bin" "doc" "python"))
352 (modify-phases %standard-phases
353 (add-after 'install 'install-python-extension
354 (lambda* (#:key outputs #:allow-other-keys)
355 (with-directory-excursion "python"
356 (invoke "python" "setup.py" "install"
357 (string-append "--prefix="
358 (assoc-ref outputs "python"))
361 `(("autoconf" ,autoconf)
362 ("automake" ,automake)
363 ("clang-format" ,clang)
364 ("help2man" ,help2man)
367 ("makeinfo" ,texinfo)
369 ("pkg-config" ,pkg-config)
370 ("python" ,python-wrapper)))
371 (synopsis "Braille translator and back-translator")
372 (description "Liblouis is a braille translator and back-translator named in
373 honor of Louis Braille. It features support for computer and literary braille,
374 supports contracted and uncontracted translation for many languages and has
375 support for hyphenation. New languages can easily be added through tables that
376 support a rule- or dictionary based approach. Tools for testing and debugging
377 tables are also included. Liblouis also supports math braille, Nemeth and
379 (home-page "http://liblouis.org/")
380 (license (list license:lgpl2.1+ ; library
381 license:gpl3+)))) ; tools
383 (define-public liblouisutdml
385 (name "liblouisutdml")
392 (url "https://github.com/liblouis/liblouisutdml")
393 (commit (string-append "v" version))))
394 (file-name (git-file-name name version))
396 (base32 "0c32cfcfp0lyfd655c9ihhh3p7lhrb9q3xbll7q5dw4km86gaq6w"))))
397 (build-system gnu-build-system)
398 (outputs '("out" "bin" "doc"))
401 (list "--disable-static")))
403 `(("autoconf" ,autoconf)
404 ("automake" ,automake)
405 ("help2man" ,help2man)
406 ("jdk" ,icedtea "jdk")
408 ("makeinfo" ,texinfo)
409 ("pkg-config" ,pkg-config)))
411 `(("libxml2" ,libxml2)))
413 `(("liblouis" ,liblouis)
414 ("liblouis:bin" ,liblouis "bin")))
415 (synopsis "Braille transcription services")
416 (description "Liblouisutdml is a library providing complete braille
417 transcription services for xml, html and text documents. It translates into
418 appropriate braille codes and formats according to its style sheet and the
419 specifications in the document.")
420 (home-page "http://liblouis.org/")
421 (license (list license:lgpl3+ ; library
422 license:gpl3+)))) ; tools
424 (define-public libstemmer
431 (uri "https://snowballstem.org/dist/libstemmer_c.tgz")
433 (base32 "1z2xvrjsaaypc04lwz7dg8mjm5cq1gzmn0l544pn6y2ll3r7ckh5"))))
434 (build-system gnu-build-system)
436 `(#:tests? #f ; No tests exist
439 (string-append "CC=" ,(cc-for-target))
442 (modify-phases %standard-phases
445 (lambda* (#:key outputs #:allow-other-keys)
446 (let* ((out (assoc-ref outputs "out"))
447 (out-bin (string-append out "/bin"))
448 (out-include (string-append out "/include"))
449 (out-lib (string-append out "/lib")))
450 (install-file "stemwords" out-bin)
451 (install-file "include/libstemmer.h" out-include)
452 (rename-file "libstemmer.o" "libstemmer.a")
453 (install-file "libstemmer.a" out-lib)
455 (synopsis "Stemming Library")
456 (description "LibStemmer provides stemming library, supporting several
458 (home-page "https://snowballstem.org/")
459 (license license:bsd-3)))
461 (define-public perl-lingua-en-findnumber
463 (name "perl-lingua-en-findnumber")
468 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
469 "Lingua-EN-FindNumber-" version ".tar.gz"))
472 "015ximzdp42v824llwlg2pd77vd0d172lb4xs55q9f9zhqf6s5qx"))))
473 (build-system perl-build-system)
475 `(("perl-lingua-en-words2nums" ,perl-lingua-en-words2nums)))
476 (home-page "https://metacpan.org/release/Lingua-EN-FindNumber")
477 (synopsis "Locate (written) numbers in English text ")
478 (description "This module provides a regular expression for finding
479 numbers in English text. It also provides functions for extracting and
480 manipulating such numbers.")
481 (license license:perl-license)))
483 (define-public perl-lingua-en-inflect
485 (name "perl-lingua-en-inflect")
490 (uri (string-append "mirror://cpan/authors/id/D/DC/DCONWAY/"
491 "Lingua-EN-Inflect-" version ".tar.gz"))
494 "0j8d1f1wvmgc11d71pc8xp8fv5a1nb2yfw1dgd19xhscn1klpvzw"))))
495 (build-system perl-build-system)
496 (native-inputs `(("perl-module-build" ,perl-module-build)))
497 (home-page "https://metacpan.org/release/Lingua-EN-Inflect")
498 (synopsis "Convert singular to plural")
499 (description "Lingua::EN::Inflect provides plural inflections,
500 \"a\"/\"an\" selection for English words, and manipulation of numbers as
501 words. Plural forms of all nouns, most verbs, and some adjectives are
502 provided. Where appropriate, \"classical\" variants (for example: \"brother\"
503 -> \"brethren\", \"dogma\" -> \"dogmata\", etc.) are also provided.")
504 (license license:perl-license)))
506 (define-public perl-lingua-en-inflect-number
508 (name "perl-lingua-en-inflect-number")
513 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
514 "Lingua-EN-Inflect-Number-" version ".tar.gz"))
517 "1gxccynkaqav43ww43jp4rzkyr36x97jd03yb5f6yx0jhn1k7yv6"))))
518 (build-system perl-build-system)
520 `(("perl-lingua-en-inflect" ,perl-lingua-en-inflect)))
521 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Number")
522 (synopsis "Force number of words to singular or plural")
523 (description "This module extends the functionality of Lingua::EN::Inflect
524 with three new functions for determining plurality of a word and forcefully
525 converting a word to singular or plural.")
526 (license license:perl-license)))
528 (define-public perl-lingua-en-inflect-phrase
530 (name "perl-lingua-en-inflect-phrase")
535 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
536 "Lingua-EN-Inflect-Phrase-" version ".tar.gz"))
539 "1a6y1l2pjim2242wcpgz066di4pbzfgsjjdl7vg5a5wzm48qj1am"))))
540 (build-system perl-build-system)
542 `(("perl-test-nowarnings" ,perl-test-nowarnings)))
544 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)
545 ("perl-lingua-en-inflect" ,perl-lingua-en-inflect)
546 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
547 ("perl-lingua-en-number-isordinal" ,perl-lingua-en-number-isordinal)
548 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)))
549 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Phrase")
550 (synopsis "Inflect short English phrases")
551 (description "This module attempts to pluralize or singularize short
553 (license license:perl-license)))
555 (define-public perl-lingua-en-number-isordinal
557 (name "perl-lingua-en-number-isordinal")
562 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
563 "Lingua-EN-Number-IsOrdinal-" version ".tar.gz"))
566 "1mhqjvh2ad30gjab5b3a6mbr4aysyrscp4wp42yy5x6001a6km98"))))
567 (build-system perl-build-system)
569 `(("perl-try-tiny" ,perl-try-tiny)
570 ("perl-test-fatal" ,perl-test-fatal)))
572 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)))
573 (home-page "https://metacpan.org/release/Lingua-EN-Number-IsOrdinal")
574 (synopsis "Detect if English number is ordinal or cardinal")
575 (description "This module will tell you if a number, either in words or as
576 digits, is a cardinal or ordinal number.")
577 (license license:perl-license)))
579 (define-public perl-lingua-en-tagger
581 (name "perl-lingua-en-tagger")
586 (uri (string-append "mirror://cpan/authors/id/A/AC/ACOBURN/"
587 "Lingua-EN-Tagger-" version ".tar.gz"))
590 "0nrnkvsf9f0a7lp82sanmy89ms2nqq1lvjqicvsagsvzp513bl5b"))))
591 (build-system perl-build-system)
593 `(("perl-memoize-expirelru" ,perl-memoize-expirelru)
594 ("perl-lingua-stem" ,perl-lingua-stem)
595 ("perl-html-parser" ,perl-html-parser)
596 ("perl-html-tagset" ,perl-html-tagset)))
597 (home-page "https://metacpan.org/release/Lingua-EN-Tagger")
598 (synopsis "Part-of-speech tagger for English natural language processing")
599 (description "This module is a probability based, corpus-trained tagger
600 that assigns part-of-speech tags to English text based on a lookup dictionary
601 and a set of probability values. The tagger assigns appropriate tags based on
602 conditional probabilities - it examines the preceding tag to determine the
603 appropriate tag for the current word. Unknown words are classified according
604 to word morphology or can be set to be treated as nouns or other parts of
605 speech. The tagger also extracts as many nouns and noun phrases as it can,
606 using a set of regular expressions.")
607 (license license:gpl3)))
609 (define-public perl-lingua-en-words2nums
611 (name "perl-lingua-en-words2nums")
616 (uri (string-append "mirror://cpan/authors/id/J/JO/JOEY/"
617 "Lingua-EN-Words2Nums-" version ".tar.gz"))
620 "118xx8qr1zbx30psv7ic55w65h15mc1vz6zicshfm96jgiwmcrb8"))))
621 (build-system perl-build-system)
622 (home-page "https://metacpan.org/release/Lingua-EN-Words2Nums")
623 (synopsis "Convert English text to numbers")
624 (description "This module converts English text into numbers. It supports
625 both ordinal and cardinal numbers, negative numbers, and very large numbers.")
626 (license license:perl-license)))
628 (define-public perl-lingua-pt-stemmer
630 (name "perl-lingua-pt-stemmer")
635 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
636 "Lingua-PT-Stemmer-" version ".tar.gz"))
639 "17c48sfbgwd2ivlgf59sr6jdhwa3aim8750f8pyzz7xpi8gz0var"))))
640 (build-system perl-build-system)
641 (home-page "https://metacpan.org/release/Lingua-PT-Stemmer")
642 (synopsis "Portuguese language stemming")
643 (description "This module implements a Portuguese stemming algorithm
644 proposed in the paper A Stemming Algorithm for the Portuguese Language by
645 Moreira, V. and Huyck, C.")
646 (license license:perl-license)))
648 (define-public perl-lingua-stem
650 (name "perl-lingua-stem")
655 (uri (string-append "mirror://cpan/authors/id/S/SN/SNOWHARE/"
656 "Lingua-Stem-" version ".tar.gz"))
659 "12avh2mnnc7llmmshrr5bgb473fvydxnlqrqbl2815mf2dp4pxcg"))))
660 (build-system perl-build-system)
662 `(("perl-module-build" ,perl-module-build)))
664 `(("perl-lingua-pt-stemmer" ,perl-lingua-pt-stemmer)
665 ("perl-lingua-stem-fr" ,perl-lingua-stem-fr)
666 ("perl-lingua-stem-it" ,perl-lingua-stem-it)
667 ("perl-lingua-stem-ru" ,perl-lingua-stem-ru)
668 ("perl-lingua-stem-snowball-da" ,perl-lingua-stem-snowball-da)
669 ("perl-snowball-norwegian" ,perl-snowball-norwegian)
670 ("perl-snowball-swedish" ,perl-snowball-swedish)
671 ("perl-text-german" ,perl-text-german)))
672 (home-page "https://metacpan.org/release/Lingua-Stem")
673 (synopsis "Stemming of words in various languages")
674 (description "This routine applies stemming algorithms to its parameters,
675 returning the stemmed words as appropriate to the selected locale.")
676 (license license:perl-license)))
678 (define-public perl-lingua-stem-fr
680 (name "perl-lingua-stem-fr")
685 (uri (string-append "mirror://cpan/authors/id/S/SD/SDP/"
686 "Lingua-Stem-Fr-" version ".tar.gz"))
689 "0vyrspwzaqjxm5mqshf4wvwa3938mkajd1918d9ii2l9m2rn8kwx"))))
690 (build-system perl-build-system)
691 (home-page "https://metacpan.org/release/Lingua-Stem-Fr")
692 (synopsis "Porter's stemming algorithm for French")
693 (description "This module uses a modified version of the Porter Stemming
694 Algorithm to return a stemmed French word.")
695 (license license:perl-license)))
697 (define-public perl-lingua-stem-it
699 (name "perl-lingua-stem-it")
704 (uri (string-append "mirror://cpan/authors/id/A/AC/ACALPINI/"
705 "Lingua-Stem-It-" version ".tar.gz"))
708 "1207r183s5hlh4mfwa6p46vzm0dhvrs2dnss5s41a0gyfkxp7riq"))))
709 (build-system perl-build-system)
710 (home-page "https://metacpan.org/release/Lingua-Stem-It")
711 (synopsis "Porter's stemming algorithm for Italian")
712 (description "This module applies the Porter Stemming Algorithm to its
713 parameters, returning the stemmed Italian word.")
714 (license license:perl-license)))
716 (define-public perl-lingua-stem-ru
718 (name "perl-lingua-stem-ru")
723 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
724 "Lingua-Stem-Ru-" version ".tar.gz"))
727 "0a2jmdz7jn32qj5hyiw5kbv8fvlpmws8i00a6xcbkzb48yvwww0j"))))
728 (build-system perl-build-system)
729 (home-page "https://metacpan.org/release/Lingua-Stem-Ru")
730 (synopsis "Porter's stemming algorithm for Russian")
731 (description "This module applies the Porter Stemming Algorithm to its
732 parameters, returning the stemmed Russian (KOI8-R only) word.")
733 (license license:perl-license)))
735 (define-public perl-lingua-stem-snowball-da
737 (name "perl-lingua-stem-snowball-da")
742 (uri (string-append "mirror://cpan/authors/id/C/CI/CINE/"
743 "Lingua-Stem-Snowball-Da-" version ".tar.gz"))
746 "0mm0m7glm1s6i9f6a78jslw6wh573208arxhq93yriqmw17bwf9f"))))
747 (build-system perl-build-system)
748 (home-page "https://metacpan.org/release/Lingua-Stem-Snowball-Da")
749 (synopsis "Porters stemming algorithm for Danish")
750 (description "Lingua::Stem::Snowball::Da is a perl port of the danish
751 stemmer at http://snowball.sourceforge.net, it was originally altered from the
752 Lingua::Stem::Snowball::Se.")
753 (license license:gpl2)))
755 (define-public perl-snowball-norwegian
757 (name "perl-snowball-norwegian")
762 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
763 "Snowball-Norwegian-" version ".tar.gz"))
766 "0675v45bbsh7vr7kpf36xs2q79g02iq1kmfw22h20xdk4rzqvkqx"))))
767 (build-system perl-build-system)
768 (native-inputs `(("perl-module-build" ,perl-module-build)))
769 (home-page "https://metacpan.org/release/Snowball-Norwegian")
770 (synopsis "Porters stemming algorithm for Norwegian")
771 (description "Lingua::Stem::Snowball::No is a perl port of the norwegian
772 stemmer at http://snowball.tartarus.org.")
773 (license license:perl-license)))
775 (define-public perl-snowball-swedish
777 (name "perl-snowball-swedish")
782 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
783 "Snowball-Swedish-" version ".tar.gz"))
786 "0agwc12jk5kmabnpsplw3wf4ii5w1zb159cpin44x3srb0sr5apg"))))
787 (build-system perl-build-system)
788 (native-inputs `(("perl-module-build" ,perl-module-build)))
789 (home-page "https://metacpan.org/release/Snowball-Swedish")
790 (synopsis "Porters stemming algorithm for Swedish")
791 (description "Lingua::Stem::Snowball::Se is a perl port of the swedish
792 stemmer at http://snowball.sourceforge.net.")
793 (license license:perl-license)))
795 (define-public perl-string-toidentifier-en
797 (name "perl-string-toidentifier-en")
802 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
803 "String-ToIdentifier-EN-" version ".tar.gz"))
806 "12nw7h2yiybhdw0vnnpc7bif8ylhsn6kqf6s39dsrf9h54iq9yrs"))))
807 (build-system perl-build-system)
809 `(("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
810 ("perl-text-unidecode" ,perl-text-unidecode)
811 ("perl-namespace-clean" ,perl-namespace-clean)))
812 (home-page "https://metacpan.org/release/String-ToIdentifier-EN")
813 (synopsis "Convert strings to English program identifiers")
814 (description "This module provides a utility method, \"to_identifier\" for
815 converting an arbitrary string into a readable representation using the ASCII
816 subset of \"\\w\" for use as an identifier in a computer program. The intent
817 is to make unique identifier names from which the content of the original
818 string can be easily inferred by a human just by reading the identifier.")
819 (license license:perl-license)))
821 (define-public perl-text-german
823 (name "perl-text-german")
828 (uri (string-append "mirror://cpan/authors/id/U/UL/ULPFR/"
829 "Text-German-" version ".tar.gz"))
832 "1p87pgap99lw0nv62i3ghvsi7yg90lhn8vsa3yqp75rd04clybcj"))))
833 (build-system perl-build-system)
834 (home-page "https://metacpan.org/release/Text-German")
835 (synopsis "German grundform reduction")
836 (description "This module is a rather incomplete implementation of work
837 done by Gudrun Putze-Meier.")
838 (license license:perl-license)))
840 (define* (tegaki-release-uri proj version
841 #:optional (ext "tar.gz"))
842 (string-append "https://github.com/tegaki/tegaki/releases/download"
843 "/v" version "/" proj "-" version "." ext))
845 (define remove-pre-compiled-files
847 "Return snippet for removing pre-compiled files matching one of the
849 `(begin (for-each delete-file
852 (any (cut string-suffix? <> name)
853 (map (cut string-append "." <>)
857 ;;; modules required for the above snippet
858 (define remove-pre-compiled-files-modules
863 (define-public python2-tegaki-wagomu
865 (name "python2-tegaki-wagomu")
870 (uri (tegaki-release-uri "tegaki-wagomu" version))
873 "1pzdiq4zy1nyylaj9i6v2h4h0r05klahskzpafpp367p4rysi1x9"))
874 (modules remove-pre-compiled-files-modules)
875 (snippet (remove-pre-compiled-files "pyc"))))
876 (build-system python-build-system)
878 `(#:python ,python-2 ; only Python 2 is supported
880 (modify-phases %standard-phases
881 (add-after 'unpack 'fix-recognizer
882 (lambda* (#:key inputs #:allow-other-keys)
883 ;; fix missing module and function
884 (substitute* "tegakiwagomu.py"
889 (("Results\\(candidates\\)")
895 `(("pkg-config" ,pkg-config)
897 (home-page "https://tegaki.github.io/")
899 "Chinese and Japanese Handwriting Recognition (Recognition engine)")
901 "Tegaki is an ongoing project which aims to develop a free and open-source
902 modern implementation of handwriting recognition software, specifically
903 designed for Chinese (simplified and traditional) and Japanese, and that is
904 suitable for both the desktop and mobile devices.")
905 (license license:gpl2+))) ; all files
907 (define-public python2-tegaki-python
909 (inherit python2-tegaki-wagomu)
910 (name "python2-tegaki-python")
915 (uri (tegaki-release-uri "tegaki-python" version))
918 "0x93k7pw9nh0ywd97pr8pm7jv3f94nw044i5k0zvzhdpsjqvak7p"))
919 (modules remove-pre-compiled-files-modules)
920 (snippet (remove-pre-compiled-files "pyc"))))
922 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
924 `(modify-phases %standard-phases
925 (add-after 'unpack 'pre-configure
926 (lambda* (#:key inputs #:allow-other-keys)
927 ;; Always convert string to unicode to avoid the following error
928 ;; when running "tegaki-build" in python2-tegaki-tools:
930 ;; sqlite3.ProgrammingError: You must not use 8-bit bytestrings
931 ;; unless you use a text_factory that can interpret 8-bit
932 ;; bytestrings (like text_factory = str).
933 ;; It is highly recommended that you instead just switch your
934 ;; application to Unicode strings.
935 (substitute* "tegaki/charcol.py"
936 (("sqlite3.OptimizedUnicode")
937 "lambda s: unicode(s, 'utf-8')"))
938 (substitute* "tegaki/engine.py"
940 (assoc-ref inputs "python2-tegaki-wagomu")))
942 ;; override inherited inputs
946 `(("python2-tegaki-wagomu" ,python2-tegaki-wagomu)
947 ("python2-zinnia" ,python2-zinnia)))
949 "Chinese and Japanese Handwriting Recognition (Base python library)")
950 (license (list license:gpl2+ ; all files except...
951 license:bsd-3 ; dictutils.py
952 license:zpl2.1)))) ; minjson.py
954 (define-public python2-tegaki-pygtk
956 (inherit python2-tegaki-wagomu)
957 (name "python2-tegaki-pygtk")
962 (uri (tegaki-release-uri "tegaki-pygtk" version))
965 "1cip0azxhjdj2dg2z85cp1z3lz4qwx3w1j7z4xmcm7npapmsaqs2"))
966 (modules remove-pre-compiled-files-modules)
967 (snippet (remove-pre-compiled-files "pyc"))))
969 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
971 `(modify-phases %standard-phases
972 (add-after 'unpack 'fix-paths
973 (lambda* (#:key inputs #:allow-other-keys)
974 (substitute* "tegakigtk/fakekey.py"
976 (string-append (assoc-ref inputs "libx11") "/lib/" so))
978 (string-append (assoc-ref inputs "libxtst") "/lib/" so)))
980 (inputs ; required for sending key strokes
982 ("libxtst" ,libxtst)))
983 (native-inputs '()) ; override inherited inputs
985 `(("python2-pygtk" ,python2-pygtk)
986 ("python2-tegaki-python" ,python2-tegaki-python)))
987 (synopsis "Chinese and Japanese Handwriting Recognition (Base UI library)")
988 (license license:gpl2+)))
990 (define-public python2-tegaki-tools
992 (inherit python2-tegaki-wagomu)
993 (name "python2-tegaki-tools")
998 (uri (tegaki-release-uri "tegaki-tools" version))
1001 "0xxv97ggh2jgldw3r7y59lv3fhz733r6l7mdn6nh4m0gvb0ja971"))
1002 (modules remove-pre-compiled-files-modules)
1003 (snippet (remove-pre-compiled-files "pyc"))))
1005 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
1006 ((#:phases _) '%standard-phases)))
1008 `(("python2-tegaki-pygtk" ,python2-tegaki-pygtk)))
1009 ;; override inherited inputs
1011 (propagated-inputs '())
1012 (synopsis "Chinese and Japanese Handwriting Recognition (Advanced tools)")
1013 ;; Files in gifenc/ are licensed under gpl3+ while other files are licensed
1014 ;; under gpl2+. Therefore, the combined work is licensed under gpl3+.
1015 (license license:gpl3+)))
1017 (define-public python2-tegaki-recognize
1018 (let ((commit "eceec69fe651d0733c8c8752dae569d2283d0f3c")
1021 (inherit python2-tegaki-tools)
1022 (name "python2-tegaki-recognize")
1023 ;; version copied from <https://github.com/tegaki/tegaki/releases>
1024 (version (git-version "0.3.1" revision commit))
1027 ;; We use GIT-FETCH because 'tegaki-recognize.desktop.in' and
1028 ;; 'tegaki-recognize.in' are missing in the tarball.
1031 (url "https://github.com/tegaki/tegaki")
1035 "09mw2if9p885phbgah5f95q3fwy7s5b46qlmpxqyzfcnj6g7afr5"))
1036 (file-name (git-file-name name version))
1037 (modules `((guix build utils)
1040 ,@remove-pre-compiled-files-modules))
1043 ;; remove unnecessary files with potentially different license
1044 (for-each delete-file-recursively
1046 (negate (cut member <> '("tegaki-recognize"
1048 ,(remove-pre-compiled-files "pyc")
1051 (substitute-keyword-arguments (package-arguments python2-tegaki-tools)
1053 `(modify-phases %standard-phases
1054 (add-after 'unpack 'chdir
1056 (chdir "tegaki-recognize")
1058 ;; 'setup.py' script does not support one of the Python build
1059 ;; system's default flags, "--single-version-externally-managed"
1061 (lambda* (#:key outputs #:allow-other-keys)
1062 (invoke "python" "setup.py" "install"
1063 (string-append "--prefix=" (assoc-ref outputs "out"))
1066 (synopsis "Chinese and Japanese Handwriting Recognition (Main program)")
1067 (license license:gpl2+))))
1069 (define-public tegaki-zinnia-japanese
1071 (inherit python2-tegaki-wagomu)
1072 (name "tegaki-zinnia-japanese")
1077 (uri (tegaki-release-uri name version "zip"))
1080 "1nmg9acxhcqly9gwkyb9m0hpy76fll91ywk4b1q4xms0ajxip1h7"))
1081 (modules remove-pre-compiled-files-modules)
1082 (snippet (remove-pre-compiled-files "model"))))
1083 (build-system gnu-build-system)
1085 `(#:tests? #f ; no tests
1087 (modify-phases %standard-phases
1089 (lambda* (#:key outputs #:allow-other-keys)
1090 (substitute* "Makefile"
1092 (assoc-ref outputs "out")))
1094 ;; override inherited inputs
1097 `(("python2-tegaki-tools" ,python2-tegaki-tools)))
1098 (propagated-inputs '())
1099 (native-search-paths
1100 (list (search-path-specification
1101 (variable "TEGAKI_MODEL_PATH")
1102 (files '("share/tegaki/models")))))
1103 (synopsis "Chinese and Japanese Handwriting Recognition (Model)")
1104 (license license:lgpl2.1)))
1106 (define-public tegaki-zinnia-japanese-light
1108 (inherit tegaki-zinnia-japanese)
1109 (name "tegaki-zinnia-japanese-light")
1114 (uri (tegaki-release-uri name version "zip"))
1117 "0x0fs29ylqzxd6xvg51h7rigpbisd7q8v11df425ib2j792yfyf8"))
1118 (modules remove-pre-compiled-files-modules)
1119 (snippet (remove-pre-compiled-files "model"))))
1120 (license license:lgpl2.1)))
1122 (define-public tegaki-zinnia-japanese-kyoiku
1124 (inherit tegaki-zinnia-japanese)
1125 (name "tegaki-zinnia-japanese-kyoiku")
1130 (uri (tegaki-release-uri name version "zip"))
1133 "0am94bcpmbzplxdnwn9gk15sgaizvcfhmv13mk14jjvx3419cvvx"))
1134 (modules remove-pre-compiled-files-modules)
1135 (snippet (remove-pre-compiled-files "model"))))
1136 (license license:lgpl2.1)))
1138 (define-public tegaki-zinnia-japanese-joyo
1140 (inherit tegaki-zinnia-japanese)
1141 (name "tegaki-zinnia-japanese-joyo")
1146 (uri (tegaki-release-uri name version "zip"))
1149 "1v0j40lzdyiz01ayws0b8r7fsdy2mr32658382kz4wyk883wzx2z"))
1150 (modules remove-pre-compiled-files-modules)
1151 (snippet (remove-pre-compiled-files "model"))))
1152 (license license:lgpl2.1)))
1154 (define-public tegaki-zinnia-simplified-chinese
1156 (inherit tegaki-zinnia-japanese)
1157 (name "tegaki-zinnia-simplified-chinese")
1162 (uri (tegaki-release-uri name version "zip"))
1165 "18wq0jccv7lpnrfnzspyc110d6pj2v1i21xcx4fmgzz1lnln3fs5"))
1166 (modules remove-pre-compiled-files-modules)
1167 (snippet (remove-pre-compiled-files "model"))))
1168 (license license:lgpl2.1)))
1170 (define-public tegaki-zinnia-simplified-chinese-light
1172 (inherit tegaki-zinnia-japanese)
1173 (name "tegaki-zinnia-simplified-chinese-light")
1178 (uri (tegaki-release-uri name version "zip"))
1181 "0v24yf0w0p03lb7fyx128a75mwzad166bigvlbrzqnad789qg1sr"))
1182 (modules remove-pre-compiled-files-modules)
1183 (snippet (remove-pre-compiled-files "model"))))
1184 (license license:lgpl2.1)))
1186 (define-public tegaki-zinnia-traditional-chinese
1188 (inherit tegaki-zinnia-japanese)
1189 (name "tegaki-zinnia-traditional-chinese")
1194 (uri (tegaki-release-uri name version "zip"))
1197 "140nlp6hynrai2svs5670jjfw1za6ayflhyj2dl0bzsfgbk3447l"))
1198 (modules remove-pre-compiled-files-modules)
1199 (snippet (remove-pre-compiled-files "model"))))
1200 (license license:lgpl2.1)))
1202 (define-public tegaki-zinnia-traditional-chinese-light
1204 (inherit tegaki-zinnia-japanese)
1205 (name "tegaki-zinnia-traditional-chinese-light")
1210 (uri (tegaki-release-uri name version "zip"))
1213 "1m6yk6a57vs9wg5y50qciwi1ahhmklp2mgsjysbj4mnyzv6yhcr2"))
1214 (modules remove-pre-compiled-files-modules)
1215 (snippet (remove-pre-compiled-files "model"))))
1216 (license license:lgpl2.1)))
1218 (define-public tegaki-wagomu-japanese
1220 (inherit tegaki-zinnia-japanese)
1221 (name "tegaki-wagomu-japanese")
1226 (uri (tegaki-release-uri name version "zip"))
1229 "0flj5id8xwsn7csrrzqz9prdikswnwm2wms0as2vzdpxzph1az4k"))
1230 (modules remove-pre-compiled-files-modules)
1231 (snippet (remove-pre-compiled-files "model"))))
1232 (license license:lgpl2.1)))
1234 (define-public tegaki-wagomu-japanese-kyoiku
1236 (inherit tegaki-zinnia-japanese)
1237 (name "tegaki-wagomu-japanese-kyoiku")
1242 (uri (tegaki-release-uri name version "zip"))
1245 "0v8crfh8rdf6ndp16g52s5jlrrlwh73xp38zjn5i9dlacx8kfqg1"))
1246 (modules remove-pre-compiled-files-modules)
1247 (snippet (remove-pre-compiled-files "model"))))
1248 (license license:lgpl2.1)))
1250 (define-public tegaki-wagomu-japanese-joyo
1252 (inherit tegaki-zinnia-japanese)
1253 (name "tegaki-wagomu-japanese-joyo")
1258 (uri (tegaki-release-uri name version "zip"))
1261 "0wk8shpr963zp328g991qs6abpnacq4242003m687z2d6yp7nph2"))
1262 (modules remove-pre-compiled-files-modules)
1263 (snippet (remove-pre-compiled-files "model"))))
1264 (license license:lgpl2.1)))
1266 (define-public tegaki-wagomu-simplified-chinese
1268 (inherit tegaki-zinnia-japanese)
1269 (name "tegaki-wagomu-simplified-chinese")
1274 (uri (tegaki-release-uri name version "zip"))
1277 "0wqprynigqxqxv128i1smh81gxvmjj056d9qpznxa3n9f5ymlbj6"))
1278 (modules remove-pre-compiled-files-modules)
1279 (snippet (remove-pre-compiled-files "model"))))
1280 (license license:lgpl2.1)))
1282 ;;; Upstream does not provide the source for tegaki-wagomu-traditional-chinese.
1283 ;;; Therefore, we use the source for tegaki-zinnia-traditional-chinese and
1284 ;;; patch the Makefile accordingly.
1285 (define-public tegaki-wagomu-traditional-chinese
1287 (inherit tegaki-zinnia-traditional-chinese)
1288 (name "tegaki-wagomu-traditional-chinese")
1290 (substitute-keyword-arguments
1291 (package-arguments tegaki-zinnia-traditional-chinese)
1292 ((#:phases phases '%standard-phases)
1293 `(modify-phases ,phases
1296 (let ((configure (assq-ref ,phases 'configure)))
1297 (apply configure args))
1298 (substitute* "Makefile"
1299 (("zinnia") "wagomu"))
1301 (license license:lgpl2.1)))
1303 (define-public link-grammar
1305 (name "link-grammar")
1309 (uri (string-append "https://www.abisource.com/downloads/"
1310 "link-grammar/" version
1311 "/link-grammar-" version ".tar.gz"))
1314 "0ak1v469k56v3511kxxkxvx1nw6zcxcl0f1kcvc82ffacqbr4y96"))))
1315 (build-system gnu-build-system)
1316 (home-page "https://www.abisource.com/projects/link-grammar/")
1317 (synopsis "Link grammar parser")
1318 (description "The Link Grammar Parser is a syntactic parser of English,
1319 Russian, Arabic and Persian (and other languages as well), based on Link
1320 Grammar, an original theory of syntax and morphology. Given a sentence, the
1321 system assigns to it a syntactic structure, which consists of a set of
1322 labelled links connecting pairs of words. The parser also produces a
1323 \"constituent\" (HPSG style phrase tree) representation of a sentence (showing
1324 noun phrases, verb phrases, etc.).")
1325 (license license:bsd-3)))
1327 (define-public praat
1334 (url "https://github.com/praat/praat")
1335 (commit (string-append "v" version))))
1336 (file-name (git-file-name name version))
1339 "1pjfifyv3wjn68l3i2dr83xm75nf2kxvfxrk9qqbmwz58p183jw4"))))
1340 (build-system gnu-build-system)
1342 `(#:tests? #f ; no test target
1344 (modify-phases %standard-phases
1347 (copy-file "makefiles/makefile.defs.linux.pulse" "makefile.defs")
1350 (lambda* (#:key outputs #:allow-other-keys)
1351 (let* ((out (assoc-ref outputs "out"))
1352 (bin (string-append out "/bin")))
1354 (copy-file "praat" (string-append bin "/praat")))
1357 `(("alsa-lib" ,alsa-lib)
1360 ("publesaudio" ,pulseaudio)))
1362 `(("pkg-config" ,pkg-config)))
1363 (home-page "https://www.fon.hum.uva.nl/praat/")
1364 (synopsis "Doing phonetics by computer")
1365 (description "Praat is a tool to perform phonetics tasks. It can do speech
1366 analysis (pitch, formant, intensity, ...), speech synthesis, labelling, segmenting
1368 (license license:gpl2+)))