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>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages language)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages autotools)
26 #:use-module (gnu packages glib)
27 #:use-module (gnu packages gtk)
28 #:use-module (gnu packages java)
29 #:use-module (gnu packages llvm)
30 #:use-module (gnu packages man)
31 #:use-module (gnu packages ocr)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages perl-check)
36 #:use-module (gnu packages swig)
37 #:use-module (gnu packages texinfo)
38 #:use-module (gnu packages web)
39 #:use-module (gnu packages xml)
40 #:use-module (gnu packages xorg)
41 #:use-module (guix packages)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system perl)
44 #:use-module (guix build-system python)
45 #:use-module ((guix licenses)
47 (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1))
48 #:use-module (guix download)
49 #:use-module (guix git-download)
50 #:use-module (guix utils))
52 (define-public liblouis
61 (url "https://github.com/liblouis/liblouis.git")
62 (commit (string-append "v" version))))
63 (file-name (git-file-name name version))
65 (base32 "0v6w8b9r994mkkbm2gqgd7k5yfmdhgbabh0j1gmn375nyvhy4qqh"))))
66 (build-system gnu-build-system)
67 (outputs '("out" "bin" "doc" "python"))
74 (modify-phases %standard-phases
75 ;; To install the sub-package "python".
76 (add-after 'install 'install-python-extension
77 (lambda* (#:key outputs #:allow-other-keys)
78 (with-directory-excursion "python"
79 (invoke "python" "setup.py" "install"
80 (string-append "--prefix="
81 (assoc-ref outputs "python"))
84 `(("autoconf" ,autoconf)
85 ("automake" ,automake)
86 ("clang-format" ,clang)
87 ("help2man" ,help2man)
92 ("pkg-config" ,pkg-config)
93 ("python" ,python-wrapper)))
94 (synopsis "Braille translator and back-translator")
95 (description "Liblouis is a braille translator and back-translator named in
96 honor of Louis Braille. It features support for computer and literary braille,
97 supports contracted and uncontracted translation for many languages and has
98 support for hyphenation. New languages can easily be added through tables that
99 support a rule- or dictionary based approach. Tools for testing and debugging
100 tables are also included. Liblouis also supports math braille, Nemeth and
102 (home-page "http://liblouis.org/")
110 (define-public liblouisutdml
112 (name "liblouisutdml")
119 (url "https://github.com/liblouis/liblouisutdml.git")
120 (commit (string-append "v" version))))
121 (file-name (git-file-name name version))
123 (base32 "11xxky3crjm8bidfljzpqaz1m1i1m1yskmdpavf9b4jpf87nzjj2"))
125 (search-patches "liblouisutdml-fix-tests.patch"))))
126 (build-system gnu-build-system)
127 (outputs '("out" "bin" "doc"))
131 "--disable-static")))
133 `(("autoconf" ,autoconf)
134 ("automake" ,automake)
135 ("help2man" ,help2man)
136 ("jdk" ,icedtea "jdk")
138 ("makeinfo" ,texinfo)
139 ("pkg-config" ,pkg-config)))
141 `(("libxml2" ,libxml2)))
143 `(("liblouis" ,liblouis)
144 ("liblouis:bin" ,liblouis "bin")))
145 (synopsis "Braille transcription services")
146 (description "Liblouisutdml is a library providing complete braille
147 transcription services for xml, html and text documents. It translates into
148 appropriate braille codes and formats according to its style sheet and the
149 specifications in the document.")
150 (home-page "http://liblouis.org/")
158 (define-public libstemmer
165 (uri "https://snowballstem.org/dist/libstemmer_c.tgz")
167 (base32 "1z2xvrjsaaypc04lwz7dg8mjm5cq1gzmn0l544pn6y2ll3r7ckh5"))))
168 (build-system gnu-build-system)
170 `(#:tests? #f ; No tests exist
173 (string-append "CC=" ,(cc-for-target))
176 (modify-phases %standard-phases
179 (lambda* (#:key outputs #:allow-other-keys)
180 (let* ((out (assoc-ref outputs "out"))
181 (out-bin (string-append out "/bin"))
182 (out-include (string-append out "/include"))
183 (out-lib (string-append out "/lib")))
184 (install-file "stemwords" out-bin)
185 (install-file "include/libstemmer.h" out-include)
186 (rename-file "libstemmer.o" "libstemmer.a")
187 (install-file "libstemmer.a" out-lib)
189 (synopsis "Stemming Library")
190 (description "LibStemmer provides stemming library, supporting several
192 (home-page "https://snowballstem.org/")
195 (define-public perl-lingua-en-findnumber
197 (name "perl-lingua-en-findnumber")
202 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
203 "Lingua-EN-FindNumber-" version ".tar.gz"))
206 "015ximzdp42v824llwlg2pd77vd0d172lb4xs55q9f9zhqf6s5qx"))))
207 (build-system perl-build-system)
209 `(("perl-lingua-en-words2nums" ,perl-lingua-en-words2nums)))
210 (home-page "https://metacpan.org/release/Lingua-EN-FindNumber")
211 (synopsis "Locate (written) numbers in English text ")
212 (description "This module provides a regular expression for finding
213 numbers in English text. It also provides functions for extracting and
214 manipulating such numbers.")
215 (license perl-license)))
217 (define-public perl-lingua-en-inflect
219 (name "perl-lingua-en-inflect")
224 (uri (string-append "mirror://cpan/authors/id/D/DC/DCONWAY/"
225 "Lingua-EN-Inflect-" version ".tar.gz"))
228 "0j8d1f1wvmgc11d71pc8xp8fv5a1nb2yfw1dgd19xhscn1klpvzw"))))
229 (build-system perl-build-system)
230 (native-inputs `(("perl-module-build" ,perl-module-build)))
231 (home-page "https://metacpan.org/release/Lingua-EN-Inflect")
232 (synopsis "Convert singular to plural")
233 (description "Lingua::EN::Inflect provides plural inflections,
234 \"a\"/\"an\" selection for English words, and manipulation of numbers as
235 words. Plural forms of all nouns, most verbs, and some adjectives are
236 provided. Where appropriate, \"classical\" variants (for example: \"brother\"
237 -> \"brethren\", \"dogma\" -> \"dogmata\", etc.) are also provided.")
238 (license perl-license)))
240 (define-public perl-lingua-en-inflect-number
242 (name "perl-lingua-en-inflect-number")
247 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
248 "Lingua-EN-Inflect-Number-" version ".tar.gz"))
251 "1gxccynkaqav43ww43jp4rzkyr36x97jd03yb5f6yx0jhn1k7yv6"))))
252 (build-system perl-build-system)
254 `(("perl-lingua-en-inflect" ,perl-lingua-en-inflect)))
255 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Number")
256 (synopsis "Force number of words to singular or plural")
257 (description "This module extends the functionality of Lingua::EN::Inflect
258 with three new functions for determining plurality of a word and forcefully
259 converting a word to singular or plural.")
260 (license perl-license)))
262 (define-public perl-lingua-en-inflect-phrase
264 (name "perl-lingua-en-inflect-phrase")
269 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
270 "Lingua-EN-Inflect-Phrase-" version ".tar.gz"))
273 "1a6y1l2pjim2242wcpgz066di4pbzfgsjjdl7vg5a5wzm48qj1am"))))
274 (build-system perl-build-system)
276 `(("perl-test-nowarnings" ,perl-test-nowarnings)))
278 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)
279 ("perl-lingua-en-inflect" ,perl-lingua-en-inflect)
280 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
281 ("perl-lingua-en-number-isordinal" ,perl-lingua-en-number-isordinal)
282 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)))
283 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Phrase")
284 (synopsis "Inflect short English phrases")
285 (description "This module attempts to pluralize or singularize short
287 (license perl-license)))
289 (define-public perl-lingua-en-number-isordinal
291 (name "perl-lingua-en-number-isordinal")
296 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
297 "Lingua-EN-Number-IsOrdinal-" version ".tar.gz"))
300 "1mhqjvh2ad30gjab5b3a6mbr4aysyrscp4wp42yy5x6001a6km98"))))
301 (build-system perl-build-system)
303 `(("perl-try-tiny" ,perl-try-tiny)
304 ("perl-test-fatal" ,perl-test-fatal)))
306 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)))
307 (home-page "https://metacpan.org/release/Lingua-EN-Number-IsOrdinal")
308 (synopsis "Detect if English number is ordinal or cardinal")
309 (description "This module will tell you if a number, either in words or as
310 digits, is a cardinal or ordinal number.")
311 (license perl-license)))
313 (define-public perl-lingua-en-tagger
315 (name "perl-lingua-en-tagger")
320 (uri (string-append "mirror://cpan/authors/id/A/AC/ACOBURN/"
321 "Lingua-EN-Tagger-" version ".tar.gz"))
324 "0nrnkvsf9f0a7lp82sanmy89ms2nqq1lvjqicvsagsvzp513bl5b"))))
325 (build-system perl-build-system)
327 `(("perl-memoize-expirelru" ,perl-memoize-expirelru)
328 ("perl-lingua-stem" ,perl-lingua-stem)
329 ("perl-html-parser" ,perl-html-parser)
330 ("perl-html-tagset" ,perl-html-tagset)))
331 (home-page "https://metacpan.org/release/Lingua-EN-Tagger")
332 (synopsis "Part-of-speech tagger for English natural language processing")
333 (description "This module is a probability based, corpus-trained tagger
334 that assigns part-of-speech tags to English text based on a lookup dictionary
335 and a set of probability values. The tagger assigns appropriate tags based on
336 conditional probabilities - it examines the preceding tag to determine the
337 appropriate tag for the current word. Unknown words are classified according
338 to word morphology or can be set to be treated as nouns or other parts of
339 speech. The tagger also extracts as many nouns and noun phrases as it can,
340 using a set of regular expressions.")
343 (define-public perl-lingua-en-words2nums
345 (name "perl-lingua-en-words2nums")
350 (uri (string-append "mirror://cpan/authors/id/J/JO/JOEY/"
351 "Lingua-EN-Words2Nums-" version ".tar.gz"))
354 "118xx8qr1zbx30psv7ic55w65h15mc1vz6zicshfm96jgiwmcrb8"))))
355 (build-system perl-build-system)
356 (home-page "https://metacpan.org/release/Lingua-EN-Words2Nums")
357 (synopsis "Convert English text to numbers")
358 (description "This module converts English text into numbers. It supports
359 both ordinal and cardinal numbers, negative numbers, and very large numbers.")
360 (license perl-license)))
362 (define-public perl-lingua-pt-stemmer
364 (name "perl-lingua-pt-stemmer")
369 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
370 "Lingua-PT-Stemmer-" version ".tar.gz"))
373 "17c48sfbgwd2ivlgf59sr6jdhwa3aim8750f8pyzz7xpi8gz0var"))))
374 (build-system perl-build-system)
375 (home-page "https://metacpan.org/release/Lingua-PT-Stemmer")
376 (synopsis "Portuguese language stemming")
377 (description "This module implements a Portuguese stemming algorithm
378 proposed in the paper A Stemming Algorithm for the Portuguese Language by
379 Moreira, V. and Huyck, C.")
380 (license perl-license)))
382 (define-public perl-lingua-stem
384 (name "perl-lingua-stem")
389 (uri (string-append "mirror://cpan/authors/id/S/SN/SNOWHARE/"
390 "Lingua-Stem-" version ".tar.gz"))
393 "12avh2mnnc7llmmshrr5bgb473fvydxnlqrqbl2815mf2dp4pxcg"))))
394 (build-system perl-build-system)
396 `(("perl-module-build" ,perl-module-build)))
398 `(("perl-lingua-pt-stemmer" ,perl-lingua-pt-stemmer)
399 ("perl-lingua-stem-fr" ,perl-lingua-stem-fr)
400 ("perl-lingua-stem-it" ,perl-lingua-stem-it)
401 ("perl-lingua-stem-ru" ,perl-lingua-stem-ru)
402 ("perl-lingua-stem-snowball-da" ,perl-lingua-stem-snowball-da)
403 ("perl-snowball-norwegian" ,perl-snowball-norwegian)
404 ("perl-snowball-swedish" ,perl-snowball-swedish)
405 ("perl-text-german" ,perl-text-german)))
406 (home-page "https://metacpan.org/release/Lingua-Stem")
407 (synopsis "Stemming of words in various languages")
408 (description "This routine applies stemming algorithms to its parameters,
409 returning the stemmed words as appropriate to the selected locale.")
410 (license perl-license)))
412 (define-public perl-lingua-stem-fr
414 (name "perl-lingua-stem-fr")
419 (uri (string-append "mirror://cpan/authors/id/S/SD/SDP/"
420 "Lingua-Stem-Fr-" version ".tar.gz"))
423 "0vyrspwzaqjxm5mqshf4wvwa3938mkajd1918d9ii2l9m2rn8kwx"))))
424 (build-system perl-build-system)
425 (home-page "https://metacpan.org/release/Lingua-Stem-Fr")
426 (synopsis "Porter's stemming algorithm for French")
427 (description "This module uses a modified version of the Porter Stemming
428 Algorithm to return a stemmed French word.")
429 (license perl-license)))
431 (define-public perl-lingua-stem-it
433 (name "perl-lingua-stem-it")
438 (uri (string-append "mirror://cpan/authors/id/A/AC/ACALPINI/"
439 "Lingua-Stem-It-" version ".tar.gz"))
442 "1207r183s5hlh4mfwa6p46vzm0dhvrs2dnss5s41a0gyfkxp7riq"))))
443 (build-system perl-build-system)
444 (home-page "https://metacpan.org/release/Lingua-Stem-It")
445 (synopsis "Porter's stemming algorithm for Italian")
446 (description "This module applies the Porter Stemming Algorithm to its
447 parameters, returning the stemmed Italian word.")
448 (license perl-license)))
450 (define-public perl-lingua-stem-ru
452 (name "perl-lingua-stem-ru")
457 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
458 "Lingua-Stem-Ru-" version ".tar.gz"))
461 "0a2jmdz7jn32qj5hyiw5kbv8fvlpmws8i00a6xcbkzb48yvwww0j"))))
462 (build-system perl-build-system)
463 (home-page "https://metacpan.org/release/Lingua-Stem-Ru")
464 (synopsis "Porter's stemming algorithm for Russian")
465 (description "This module applies the Porter Stemming Algorithm to its
466 parameters, returning the stemmed Russian (KOI8-R only) word.")
467 (license perl-license)))
469 (define-public perl-lingua-stem-snowball-da
471 (name "perl-lingua-stem-snowball-da")
476 (uri (string-append "mirror://cpan/authors/id/C/CI/CINE/"
477 "Lingua-Stem-Snowball-Da-" version ".tar.gz"))
480 "0mm0m7glm1s6i9f6a78jslw6wh573208arxhq93yriqmw17bwf9f"))))
481 (build-system perl-build-system)
482 (home-page "https://metacpan.org/release/Lingua-Stem-Snowball-Da")
483 (synopsis "Porters stemming algorithm for Danish")
484 (description "Lingua::Stem::Snowball::Da is a perl port of the danish
485 stemmer at http://snowball.sourceforge.net, it was originally altered from the
486 Lingua::Stem::Snowball::Se.")
489 (define-public perl-snowball-norwegian
491 (name "perl-snowball-norwegian")
496 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
497 "Snowball-Norwegian-" version ".tar.gz"))
500 "0675v45bbsh7vr7kpf36xs2q79g02iq1kmfw22h20xdk4rzqvkqx"))))
501 (build-system perl-build-system)
502 (native-inputs `(("perl-module-build" ,perl-module-build)))
503 (home-page "https://metacpan.org/release/Snowball-Norwegian")
504 (synopsis "Porters stemming algorithm for Norwegian")
505 (description "Lingua::Stem::Snowball::No is a perl port of the norwegian
506 stemmer at http://snowball.tartarus.org.")
507 (license perl-license)))
509 (define-public perl-snowball-swedish
511 (name "perl-snowball-swedish")
516 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
517 "Snowball-Swedish-" version ".tar.gz"))
520 "0agwc12jk5kmabnpsplw3wf4ii5w1zb159cpin44x3srb0sr5apg"))))
521 (build-system perl-build-system)
522 (native-inputs `(("perl-module-build" ,perl-module-build)))
523 (home-page "https://metacpan.org/release/Snowball-Swedish")
524 (synopsis "Porters stemming algorithm for Swedish")
525 (description "Lingua::Stem::Snowball::Se is a perl port of the swedish
526 stemmer at http://snowball.sourceforge.net.")
527 (license perl-license)))
529 (define-public perl-string-toidentifier-en
531 (name "perl-string-toidentifier-en")
536 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
537 "String-ToIdentifier-EN-" version ".tar.gz"))
540 "12nw7h2yiybhdw0vnnpc7bif8ylhsn6kqf6s39dsrf9h54iq9yrs"))))
541 (build-system perl-build-system)
543 `(("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
544 ("perl-text-unidecode" ,perl-text-unidecode)
545 ("perl-namespace-clean" ,perl-namespace-clean)))
546 (home-page "https://metacpan.org/release/String-ToIdentifier-EN")
547 (synopsis "Convert strings to English program identifiers")
548 (description "This module provides a utility method, \"to_identifier\" for
549 converting an arbitrary string into a readable representation using the ASCII
550 subset of \"\\w\" for use as an identifier in a computer program. The intent
551 is to make unique identifier names from which the content of the original
552 string can be easily inferred by a human just by reading the identifier.")
553 (license perl-license)))
555 (define-public perl-text-german
557 (name "perl-text-german")
562 (uri (string-append "mirror://cpan/authors/id/U/UL/ULPFR/"
563 "Text-German-" version ".tar.gz"))
566 "1p87pgap99lw0nv62i3ghvsi7yg90lhn8vsa3yqp75rd04clybcj"))))
567 (build-system perl-build-system)
568 (home-page "https://metacpan.org/release/Text-German")
569 (synopsis "German grundform reduction")
570 (description "This module is a rather incomplete implementation of work
571 done by Gudrun Putze-Meier.")
572 (license perl-license)))
574 (define* (tegaki-release-uri proj version
575 #:optional (ext "tar.gz"))
576 (string-append "https://github.com/tegaki/tegaki/releases/download"
577 "/v" version "/" proj "-" version "." ext))
579 (define remove-pre-compiled-files
581 "Return snippet for removing pre-compiled files matching one of the
583 `(begin (for-each delete-file
586 (any (cut string-suffix? <> name)
587 (map (cut string-append "." <>)
591 ;;; modules required for the above snippet
592 (define remove-pre-compiled-files-modules
597 (define-public python2-tegaki-wagomu
599 (name "python2-tegaki-wagomu")
604 (uri (tegaki-release-uri "tegaki-wagomu" version))
607 "1pzdiq4zy1nyylaj9i6v2h4h0r05klahskzpafpp367p4rysi1x9"))
608 (modules remove-pre-compiled-files-modules)
609 (snippet (remove-pre-compiled-files "pyc"))))
610 (build-system python-build-system)
612 `(#:python ,python-2 ; only Python 2 is supported
614 (modify-phases %standard-phases
615 (add-after 'unpack 'fix-recognizer
616 (lambda* (#:key inputs #:allow-other-keys)
617 ;; fix missing module and function
618 (substitute* "tegakiwagomu.py"
623 (("Results\\(candidates\\)")
629 `(("pkg-config" ,pkg-config)
631 (home-page "https://tegaki.github.io/")
633 "Chinese and Japanese Handwriting Recognition (Recognition engine)")
635 "Tegaki is an ongoing project which aims to develop a free and open-source
636 modern implementation of handwriting recognition software, specifically
637 designed for Chinese (simplified and traditional) and Japanese, and that is
638 suitable for both the desktop and mobile devices.")
639 (license gpl2+))) ; all files
641 (define-public python2-tegaki-python
643 (inherit python2-tegaki-wagomu)
644 (name "python2-tegaki-python")
649 (uri (tegaki-release-uri "tegaki-python" version))
652 "0x93k7pw9nh0ywd97pr8pm7jv3f94nw044i5k0zvzhdpsjqvak7p"))
653 (modules remove-pre-compiled-files-modules)
654 (snippet (remove-pre-compiled-files "pyc"))))
656 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
658 `(modify-phases %standard-phases
659 (add-after 'unpack 'pre-configure
660 (lambda* (#:key inputs #:allow-other-keys)
661 ;; Always convert string to unicode to avoid the following error
662 ;; when running "tegaki-build" in python2-tegaki-tools:
664 ;; sqlite3.ProgrammingError: You must not use 8-bit bytestrings
665 ;; unless you use a text_factory that can interpret 8-bit
666 ;; bytestrings (like text_factory = str).
667 ;; It is highly recommended that you instead just switch your
668 ;; application to Unicode strings.
669 (substitute* "tegaki/charcol.py"
670 (("sqlite3.OptimizedUnicode")
671 "lambda s: unicode(s, 'utf-8')"))
672 (substitute* "tegaki/engine.py"
674 (assoc-ref inputs "python2-tegaki-wagomu")))
676 ;; override inherited inputs
680 `(("python2-tegaki-wagomu" ,python2-tegaki-wagomu)
681 ("python2-zinnia" ,python2-zinnia)))
683 "Chinese and Japanese Handwriting Recognition (Base python library)")
684 (license (list gpl2+ ; all files except...
686 zpl2.1)))) ; minjson.py
688 (define-public python2-tegaki-pygtk
690 (inherit python2-tegaki-wagomu)
691 (name "python2-tegaki-pygtk")
696 (uri (tegaki-release-uri "tegaki-pygtk" version))
699 "1cip0azxhjdj2dg2z85cp1z3lz4qwx3w1j7z4xmcm7npapmsaqs2"))
700 (modules remove-pre-compiled-files-modules)
701 (snippet (remove-pre-compiled-files "pyc"))))
703 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
705 `(modify-phases %standard-phases
706 (add-after 'unpack 'fix-paths
707 (lambda* (#:key inputs #:allow-other-keys)
708 (substitute* "tegakigtk/fakekey.py"
710 (string-append (assoc-ref inputs "libx11") "/lib/" so))
712 (string-append (assoc-ref inputs "libxtst") "/lib/" so)))
714 (inputs ; required for sending key strokes
716 ("libxtst" ,libxtst)))
717 (native-inputs '()) ; override inherited inputs
719 `(("python2-pygtk" ,python2-pygtk)
720 ("python2-tegaki-python" ,python2-tegaki-python)))
721 (synopsis "Chinese and Japanese Handwriting Recognition (Base UI library)")
722 (license gpl2+))) ; all files
724 (define-public python2-tegaki-tools
726 (inherit python2-tegaki-wagomu)
727 (name "python2-tegaki-tools")
732 (uri (tegaki-release-uri "tegaki-tools" version))
735 "0xxv97ggh2jgldw3r7y59lv3fhz733r6l7mdn6nh4m0gvb0ja971"))
736 (modules remove-pre-compiled-files-modules)
737 (snippet (remove-pre-compiled-files "pyc"))))
739 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
740 ((#:phases _) '%standard-phases)))
742 `(("python2-tegaki-pygtk" ,python2-tegaki-pygtk)))
743 ;; override inherited inputs
745 (propagated-inputs '())
746 (synopsis "Chinese and Japanese Handwriting Recognition (Advanced tools)")
747 ;; Files in gifenc/ are licensed under gpl3+ while other files are licensed
748 ;; under gpl2+. Therefore, the combined work is licensed under gpl3+.
751 (define-public python2-tegaki-recognize
752 (let ((commit "eceec69fe651d0733c8c8752dae569d2283d0f3c")
755 (inherit python2-tegaki-tools)
756 (name "python2-tegaki-recognize")
757 ;; version copied from <https://github.com/tegaki/tegaki/releases>
758 (version (git-version "0.3.1" revision commit))
761 ;; We use GIT-FETCH because 'tegaki-recognize.desktop.in' and
762 ;; 'tegaki-recognize.in' are missing in the tarball.
765 (url "https://github.com/tegaki/tegaki")
769 "09mw2if9p885phbgah5f95q3fwy7s5b46qlmpxqyzfcnj6g7afr5"))
770 (file-name (git-file-name name version))
771 (modules `((guix build utils)
774 ,@remove-pre-compiled-files-modules))
777 ;; remove unnecessary files with potentially different license
778 (for-each delete-file-recursively
780 (negate (cut member <> '("tegaki-recognize"
782 ,(remove-pre-compiled-files "pyc")
785 (substitute-keyword-arguments (package-arguments python2-tegaki-tools)
787 `(modify-phases %standard-phases
788 (add-after 'unpack 'chdir
790 (chdir "tegaki-recognize")
792 ;; 'setup.py' script does not support one of the Python build
793 ;; system's default flags, "--single-version-externally-managed"
795 (lambda* (#:key outputs #:allow-other-keys)
796 (invoke "python" "setup.py" "install"
797 (string-append "--prefix=" (assoc-ref outputs "out"))
800 (synopsis "Chinese and Japanese Handwriting Recognition (Main program)")
801 (license gpl2+)))) ; all files
803 (define-public tegaki-zinnia-japanese
805 (inherit python2-tegaki-wagomu)
806 (name "tegaki-zinnia-japanese")
811 (uri (tegaki-release-uri name version "zip"))
814 "1nmg9acxhcqly9gwkyb9m0hpy76fll91ywk4b1q4xms0ajxip1h7"))
815 (modules remove-pre-compiled-files-modules)
816 (snippet (remove-pre-compiled-files "model"))))
817 (build-system gnu-build-system)
819 `(#:tests? #f ; no tests
821 (modify-phases %standard-phases
823 (lambda* (#:key outputs #:allow-other-keys)
824 (substitute* "Makefile"
826 (assoc-ref outputs "out")))
828 ;; override inherited inputs
831 `(("python2-tegaki-tools" ,python2-tegaki-tools)))
832 (propagated-inputs '())
834 (list (search-path-specification
835 (variable "TEGAKI_MODEL_PATH")
836 (files '("share/tegaki/models")))))
837 (synopsis "Chinese and Japanese Handwriting Recognition (Model)")
838 (license lgpl2.1))) ; all files
840 (define-public tegaki-zinnia-japanese-light
842 (inherit tegaki-zinnia-japanese)
843 (name "tegaki-zinnia-japanese-light")
848 (uri (tegaki-release-uri name version "zip"))
851 "0x0fs29ylqzxd6xvg51h7rigpbisd7q8v11df425ib2j792yfyf8"))
852 (modules remove-pre-compiled-files-modules)
853 (snippet (remove-pre-compiled-files "model"))))
854 (license lgpl2.1))) ; all files
856 (define-public tegaki-zinnia-japanese-kyoiku
858 (inherit tegaki-zinnia-japanese)
859 (name "tegaki-zinnia-japanese-kyoiku")
864 (uri (tegaki-release-uri name version "zip"))
867 "0am94bcpmbzplxdnwn9gk15sgaizvcfhmv13mk14jjvx3419cvvx"))
868 (modules remove-pre-compiled-files-modules)
869 (snippet (remove-pre-compiled-files "model"))))
870 (license lgpl2.1))) ; all files
872 (define-public tegaki-zinnia-japanese-joyo
874 (inherit tegaki-zinnia-japanese)
875 (name "tegaki-zinnia-japanese-joyo")
880 (uri (tegaki-release-uri name version "zip"))
883 "1v0j40lzdyiz01ayws0b8r7fsdy2mr32658382kz4wyk883wzx2z"))
884 (modules remove-pre-compiled-files-modules)
885 (snippet (remove-pre-compiled-files "model"))))
886 (license lgpl2.1))) ; all files
888 (define-public tegaki-zinnia-simplified-chinese
890 (inherit tegaki-zinnia-japanese)
891 (name "tegaki-zinnia-simplified-chinese")
896 (uri (tegaki-release-uri name version "zip"))
899 "18wq0jccv7lpnrfnzspyc110d6pj2v1i21xcx4fmgzz1lnln3fs5"))
900 (modules remove-pre-compiled-files-modules)
901 (snippet (remove-pre-compiled-files "model"))))
902 (license lgpl2.1))) ; all files
904 (define-public tegaki-zinnia-simplified-chinese-light
906 (inherit tegaki-zinnia-japanese)
907 (name "tegaki-zinnia-simplified-chinese-light")
912 (uri (tegaki-release-uri name version "zip"))
915 "0v24yf0w0p03lb7fyx128a75mwzad166bigvlbrzqnad789qg1sr"))
916 (modules remove-pre-compiled-files-modules)
917 (snippet (remove-pre-compiled-files "model"))))
918 (license lgpl2.1))) ; all files
920 (define-public tegaki-zinnia-traditional-chinese
922 (inherit tegaki-zinnia-japanese)
923 (name "tegaki-zinnia-traditional-chinese")
928 (uri (tegaki-release-uri name version "zip"))
931 "140nlp6hynrai2svs5670jjfw1za6ayflhyj2dl0bzsfgbk3447l"))
932 (modules remove-pre-compiled-files-modules)
933 (snippet (remove-pre-compiled-files "model"))))
934 (license lgpl2.1))) ; all files
936 (define-public tegaki-zinnia-traditional-chinese-light
938 (inherit tegaki-zinnia-japanese)
939 (name "tegaki-zinnia-traditional-chinese-light")
944 (uri (tegaki-release-uri name version "zip"))
947 "1m6yk6a57vs9wg5y50qciwi1ahhmklp2mgsjysbj4mnyzv6yhcr2"))
948 (modules remove-pre-compiled-files-modules)
949 (snippet (remove-pre-compiled-files "model"))))
950 (license lgpl2.1))) ; all files
952 (define-public tegaki-wagomu-japanese
954 (inherit tegaki-zinnia-japanese)
955 (name "tegaki-wagomu-japanese")
960 (uri (tegaki-release-uri name version "zip"))
963 "0flj5id8xwsn7csrrzqz9prdikswnwm2wms0as2vzdpxzph1az4k"))
964 (modules remove-pre-compiled-files-modules)
965 (snippet (remove-pre-compiled-files "model"))))
966 (license lgpl2.1))) ; all files
968 (define-public tegaki-wagomu-japanese-kyoiku
970 (inherit tegaki-zinnia-japanese)
971 (name "tegaki-wagomu-japanese-kyoiku")
976 (uri (tegaki-release-uri name version "zip"))
979 "0v8crfh8rdf6ndp16g52s5jlrrlwh73xp38zjn5i9dlacx8kfqg1"))
980 (modules remove-pre-compiled-files-modules)
981 (snippet (remove-pre-compiled-files "model"))))
982 (license lgpl2.1))) ; all files
984 (define-public tegaki-wagomu-japanese-joyo
986 (inherit tegaki-zinnia-japanese)
987 (name "tegaki-wagomu-japanese-joyo")
992 (uri (tegaki-release-uri name version "zip"))
995 "0wk8shpr963zp328g991qs6abpnacq4242003m687z2d6yp7nph2"))
996 (modules remove-pre-compiled-files-modules)
997 (snippet (remove-pre-compiled-files "model"))))
998 (license lgpl2.1))) ; all files
1000 (define-public tegaki-wagomu-simplified-chinese
1002 (inherit tegaki-zinnia-japanese)
1003 (name "tegaki-wagomu-simplified-chinese")
1008 (uri (tegaki-release-uri name version "zip"))
1011 "0wqprynigqxqxv128i1smh81gxvmjj056d9qpznxa3n9f5ymlbj6"))
1012 (modules remove-pre-compiled-files-modules)
1013 (snippet (remove-pre-compiled-files "model"))))
1014 (license lgpl2.1))) ; all files
1016 ;;; Upstream does not provide the source for tegaki-wagomu-traditional-chinese.
1017 ;;; Therefore, we use the source for tegaki-zinnia-traditional-chinese and
1018 ;;; patch the Makefile accordingly.
1019 (define-public tegaki-wagomu-traditional-chinese
1021 (inherit tegaki-zinnia-traditional-chinese)
1022 (name "tegaki-wagomu-traditional-chinese")
1024 (substitute-keyword-arguments
1025 (package-arguments tegaki-zinnia-traditional-chinese)
1026 ((#:phases phases '%standard-phases)
1027 `(modify-phases ,phases
1030 (let ((configure (assq-ref ,phases 'configure)))
1031 (apply configure args))
1032 (substitute* "Makefile"
1033 (("zinnia") "wagomu"))
1035 (license lgpl2.1))) ; all files
1037 (define-public link-grammar
1039 (name "link-grammar")
1043 (uri (string-append "https://www.abisource.com/downloads/"
1044 "link-grammar/" version
1045 "/link-grammar-" version ".tar.gz"))
1048 "0ak1v469k56v3511kxxkxvx1nw6zcxcl0f1kcvc82ffacqbr4y96"))))
1049 (build-system gnu-build-system)
1050 (home-page "https://www.abisource.com/projects/link-grammar/")
1051 (synopsis "Link grammar parser")
1052 (description "The Link Grammar Parser is a syntactic parser of English,
1053 Russian, Arabic and Persian (and other languages as well), based on Link
1054 Grammar, an original theory of syntax and morphology. Given a sentence, the
1055 system assigns to it a syntactic structure, which consists of a set of
1056 labelled links connecting pairs of words. The parser also produces a
1057 \"constituent\" (HPSG style phrase tree) representation of a sentence (showing
1058 noun phrases, verb phrases, etc.).")