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