gnu: nimf: Use separate outputs for gtk and qt modules.
[jackhill/guix/guix.git] / gnu / packages / language.scm
CommitLineData
fc436dba 1;;; GNU Guix --- Functional package management for GNU
a2190ccc 2;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
b4fb61f6 3;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
3c986a7d 4;;; Copyright © 2018 Nikita <nikita@n0.is>
410387ad 5;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
1f6f0b6b 6;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
fa76fb63 7;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
fc436dba
EB
8;;;
9;;; This file is part of GNU Guix.
10;;;
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.
15;;;
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.
20;;;
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/>.
23
24(define-module (gnu packages language)
25 #:use-module (gnu packages)
677cb21b 26 #:use-module (gnu packages anthy)
899784fb 27 #:use-module (gnu packages autotools)
fa76fb63 28 #:use-module (gnu packages audio)
83299e54
RG
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages docbook)
31 #:use-module (gnu packages emacs)
677cb21b
RG
32 #:use-module (gnu packages freedesktop)
33 #:use-module (gnu packages gettext)
410387ad 34 #:use-module (gnu packages glib)
83299e54 35 #:use-module (gnu packages gnome)
58ac9289 36 #:use-module (gnu packages gtk)
83299e54 37 #:use-module (gnu packages ibus)
8205fe44 38 #:use-module (gnu packages java)
fa76fb63 39 #:use-module (gnu packages linux)
899784fb
RG
40 #:use-module (gnu packages llvm)
41 #:use-module (gnu packages man)
823b27d9 42 #:use-module (gnu packages ncurses)
c2810523 43 #:use-module (gnu packages ocr)
fc436dba 44 #:use-module (gnu packages perl)
410387ad 45 #:use-module (gnu packages pkg-config)
fa76fb63 46 #:use-module (gnu packages pulseaudio)
410387ad 47 #:use-module (gnu packages python)
5ccde207 48 #:use-module (gnu packages perl-check)
677cb21b 49 #:use-module (gnu packages qt)
823b27d9 50 #:use-module (gnu packages sqlite)
410387ad 51 #:use-module (gnu packages swig)
899784fb 52 #:use-module (gnu packages texinfo)
d7de0883 53 #:use-module (gnu packages web)
8205fe44 54 #:use-module (gnu packages xml)
83299e54 55 #:use-module (gnu packages xdisorg)
58ac9289 56 #:use-module (gnu packages xorg)
fc436dba 57 #:use-module (guix packages)
677cb21b
RG
58 #:use-module (guix build-system cmake)
59 #:use-module (guix build-system glib-or-gtk)
3ed30b88 60 #:use-module (guix build-system gnu)
fc436dba 61 #:use-module (guix build-system perl)
410387ad 62 #:use-module (guix build-system python)
677cb21b 63 #:use-module (guix build-system qt)
cfcf9dea 64 #:use-module ((guix licenses) #:prefix license:)
c2810523 65 #:use-module (guix download)
e4f72a58 66 #:use-module (guix git-download)
c2810523 67 #:use-module (guix utils))
fc436dba 68
83299e54
RG
69(define-public nimf
70 (package
71 (name "nimf")
72 (version "1.2")
73 (source
74 (origin
75 (method git-fetch)
76 (uri
77 (git-reference
78 (url "https://github.com/hamonikr/nimf.git")
79 (commit
80 (string-append "nimf-" version))))
81 (file-name
82 (git-file-name name version))
83 (sha256
84 (base32 "01qi7flmaqrn2fk03sa42r0caks9d8lsv88s0bgxahhxwk1x76gc"))))
85 (build-system glib-or-gtk-build-system)
2e9fe98a 86 (outputs '("out" "gtk" "qt" "doc"))
83299e54
RG
87 (arguments
88 `(#:imported-modules
89 (,@%glib-or-gtk-build-system-modules
90 (guix build cmake-build-system)
91 (guix build qt-build-system))
92 #:modules
93 ((guix build glib-or-gtk-build-system)
94 ((guix build qt-build-system)
95 #:prefix qt:)
96 (guix build utils))
97 #:configure-flags
98 (list
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"))
104 #:phases
105 (modify-phases %standard-phases
106 (add-after 'unpack 'patch-flags
107 (lambda* (#:key inputs #:allow-other-keys)
108 (substitute* "configure.ac"
109 (("-Werror")
110 "-Wno-error"))
111 #t))
112 (add-after 'patch-flags 'patch-docbook-xml
113 (lambda* (#:key inputs #:allow-other-keys)
114 (with-directory-excursion "docs"
115 (substitute* "nimf-docs.xml"
116 (("http://www.oasis-open.org/docbook/xml/4.3/")
117 (string-append (assoc-ref inputs "docbook-xml-4.3")
118 "/xml/dtd/docbook/"))))
119 #t))
120 (add-after 'patch-docbook-xml 'patch-paths
121 (lambda* (#:key inputs outputs #:allow-other-keys)
122 (substitute* "configure.ac"
123 (("/usr/share/anthy/anthy.dic")
124 (string-append (assoc-ref inputs "anthy")
125 "/share/anthy/anthy.dic")))
126 (substitute* "configure.ac"
127 (("/usr/bin:\\$GTK3_LIBDIR/libgtk-3-0")
128 (string-append (assoc-ref inputs "gtk+:bin")
129 "/bin:$GTK3_LIBDIR/libgtk-3-0"))
130 (("/usr/bin:\\$GTK2_LIBDIR/libgtk2.0-0")
131 (string-append (assoc-ref inputs "gtk+-2:bin")
132 "/bin:$GTK2_LIBDIR/libgtk2.0-0")))
133 (substitute* "modules/clients/gtk/Makefile.am"
134 (("\\$\\(GTK3_LIBDIR\\)")
2e9fe98a 135 (string-append (assoc-ref outputs "gtk")
83299e54
RG
136 "/lib"))
137 (("\\$\\(GTK2_LIBDIR\\)")
2e9fe98a 138 (string-append (assoc-ref outputs "gtk")
83299e54
RG
139 "/lib")))
140 (substitute* "modules/clients/qt4/Makefile.am"
141 (("\\$\\(QT4_LIB_DIR\\)")
2e9fe98a 142 (string-append (assoc-ref outputs "qt")
83299e54
RG
143 "/lib")))
144 (substitute* "modules/clients/qt5/Makefile.am"
145 (("\\$\\(QT5_IM_MODULE_DIR\\)")
2e9fe98a 146 (string-append (assoc-ref outputs "qt")
83299e54
RG
147 "/lib/qt5/plugins/inputmethods")))
148 (substitute* '("bin/nimf-settings/Makefile.am"
149 "data/apparmor-abstractions/Makefile.am"
150 "data/Makefile.am" "data/im-config/Makefile.am"
151 "data/imsettings/Makefile.am")
152 (("/etc")
153 (string-append (assoc-ref outputs "out")
154 "/etc"))
155 (("/usr/share")
156 (string-append (assoc-ref outputs "out")
157 "/share")))
158 #t))
159 (add-after 'install 'qt-wrap
160 (assoc-ref qt:%standard-phases 'qt-wrap)))))
161 (native-inputs
162 `(("autoconf" ,autoconf)
163 ("automake" ,automake)
164 ("docbook-xml-4.3" ,docbook-xml-4.3)
165 ("gettext" ,gettext-minimal)
166 ("gobject-introspection" ,gobject-introspection)
167 ("gtk+-2:bin" ,gtk+-2 "bin")
168 ("gtk+:bin" ,gtk+ "bin")
169 ("gtk-doc" ,gtk-doc)
170 ("intltool" ,intltool)
171 ("libtool" ,libtool)
172 ("perl" ,perl)
173 ("pkg-config" ,pkg-config)
174 ("which" ,which)))
175 (inputs
176 `(("anthy" ,anthy)
177 ("appindicator" ,libappindicator)
178 ("gtk+-2" ,gtk+-2)
179 ("gtk+" ,gtk+)
180 ("hangul" ,libhangul)
181 ("m17n-db" ,m17n-db)
182 ("m17n-lib" ,m17n-lib)
183 ("qt-4" ,qt-4)
184 ("qtbase" ,qtbase)
185 ("rime" ,librime)
186 ("rsvg" ,librsvg)
187 ("wayland" ,wayland)
188 ("wayland-protocols" ,wayland-protocols)
189 ("x11" ,libx11)
190 ("xkbcommon" ,libxkbcommon)
191 ("xklavier" ,libxklavier)))
192 (propagated-inputs
193 `(("glib" ,glib)))
194 (synopsis "Lightweight input method framework")
195 (description "Nimf is a lightweight, fast and extensible input method
196framework. This package provides a fork of the original nimf project, that
197focusses especially on Korean input (Hangul, Hanja, ...).")
198 (home-page "https://github.com/hamonikr/nimf/")
cfcf9dea 199 (license license:lgpl3+)))
83299e54 200
677cb21b
RG
201(define-public hime
202 (package
203 (name "hime")
204 (version "0.9.11")
205 (source
206 (origin
207 (method git-fetch)
208 (uri
209 (git-reference
210 (url "https://github.com/hime-ime/hime.git")
211 (commit
212 (string-append "v" version))))
213 (file-name
214 (git-file-name name version))
215 (sha256
216 (base32 "1wn0ici78x5qh6hvv50bf76ld7ds42hzzl4l5qz34hp8wyvrwakw"))))
217 (build-system glib-or-gtk-build-system)
218 (arguments
219 `(#:tests? #f ; No target
220 #:imported-modules
221 (,@%glib-or-gtk-build-system-modules
222 (guix build cmake-build-system)
223 (guix build qt-build-system))
224 #:modules
225 ((guix build glib-or-gtk-build-system)
226 ((guix build qt-build-system)
227 #:prefix qt:)
228 (guix build utils))
229 #:configure-flags
230 (list
231 ;; FIXME
232 ;; error: unknown type name ‘GtkStatusIcon’
233 "--disable-system-tray")
234 #:phases
235 (modify-phases %standard-phases
236 (add-after 'unpack 'patch-std
237 (lambda _
238 (substitute* "configure"
239 (("gnu17")
240 "gnu11")
241 (("gnu++17")
242 "gnu++11"))
243 #t))
244 (add-after 'install 'qt-wrap
245 (assoc-ref qt:%standard-phases 'qt-wrap)))))
246 (native-inputs
247 `(("gettext" ,gettext-minimal)
248 ("pkg-config" ,pkg-config)
249 ("whereis" ,util-linux)))
250 (inputs
251 `(("anthy" ,anthy)
252 ("appindicator" ,libappindicator)
253 ("chewing" ,libchewing)
254 ("gtk+" ,gtk+)
255 ("qtbase" ,qtbase)
256 ("xtst" ,libxtst)))
257 (synopsis "HIME Input Method Editor")
258 (description "Hime is an extremely easy-to-use input method framework. It
259is lightweight, stable, powerful and supports many commonly used input methods,
260including Cangjie, Zhuyin, Dayi, Ranked, Shrimp, Greek, Anthy, Korean, Latin,
261Random Cage Fighting Birds, Cool Music etc.")
262 (home-page "http://hime-ime.github.io/")
cfcf9dea
TGR
263 (license (list license:gpl2+ license:lgpl2.1+
264 license:fdl1.2+)))) ; documentation
677cb21b 265
823b27d9
RG
266(define-public libchewing
267 (package
268 (name "libchewing")
269 (version "0.5.1")
270 (source
271 (origin
272 (method git-fetch)
273 (uri
274 (git-reference
275 (url "https://github.com/chewing/libchewing.git")
276 (commit
277 (string-append "v" version))))
278 (file-name
279 (git-file-name name version))
280 (sha256
281 (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
282 (build-system gnu-build-system)
283 (arguments
63c237d0
JB
284 `(;; test-easy-symbol and test-fullshape fail with multiple cores.
285 #:parallel-tests? #f
286 #:phases
823b27d9
RG
287 (modify-phases %standard-phases
288 (add-after 'unpack 'disable-failing-tests
289 (lambda _
290 (substitute* "test/Makefile.am"
291 ((" test-bopomofo ")
292 "")
293 ((" test-config ")
294 "")
295 ((" test-reset ")
296 "")
297 ((" test-symbol ")
298 "")
299 ((" test-keyboardless ")
300 "")
301 ((" test-special-symbol ")
302 "")
303 ((" test-keyboard ")
304 "")
305 ((" test-regression ")
306 "")
307 ((" test-userphrase ")
308 ""))
309 #t)))))
310 (native-inputs
311 `(("autoconf" ,autoconf)
312 ("automake" ,automake)
313 ("libtool" ,libtool)
314 ("perl" ,perl)
315 ("pkg-config" ,pkg-config)
316 ("python" ,python-wrapper)
317 ("texinfo" ,texinfo)))
318 (inputs
319 `(("ncurses" ,ncurses)
320 ("sqlite" ,sqlite)))
321 (synopsis "Chinese phonetic input method")
322 (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
323method, one of the most popular choices for Traditional Chinese users.")
324 (home-page "http://chewing.im/")
cfcf9dea 325 (license license:lgpl2.1+)))
823b27d9 326
899784fb
RG
327(define-public liblouis
328 (package
329 (name "liblouis")
b4fb61f6 330 (version "3.15.0")
899784fb
RG
331 (source
332 (origin
333 (method git-fetch)
334 (uri
335 (git-reference
8ed4c468 336 (url "https://github.com/liblouis/liblouis")
899784fb
RG
337 (commit (string-append "v" version))))
338 (file-name (git-file-name name version))
339 (sha256
b4fb61f6 340 (base32 "1ljy5xsy7vf2r0ix0d7bqcr6qvr6897f8madsx9zlm1mrj31n5px"))))
899784fb
RG
341 (build-system gnu-build-system)
342 (outputs '("out" "bin" "doc" "python"))
343 (arguments
344 `(#:configure-flags
345 (list
346 "--disable-static"
347 "--enable-ucs4")
348 #:phases
349 (modify-phases %standard-phases
899784fb
RG
350 (add-after 'install 'install-python-extension
351 (lambda* (#:key outputs #:allow-other-keys)
352 (with-directory-excursion "python"
353 (invoke "python" "setup.py" "install"
354 (string-append "--prefix="
355 (assoc-ref outputs "python"))
356 "--root=/")))))))
357 (native-inputs
358 `(("autoconf" ,autoconf)
359 ("automake" ,automake)
360 ("clang-format" ,clang)
361 ("help2man" ,help2man)
362 ("libtool" ,libtool)
363 ("libyaml" ,libyaml)
364 ("makeinfo" ,texinfo)
365 ("perl" ,perl)
366 ("pkg-config" ,pkg-config)
367 ("python" ,python-wrapper)))
368 (synopsis "Braille translator and back-translator")
369 (description "Liblouis is a braille translator and back-translator named in
370honor of Louis Braille. It features support for computer and literary braille,
371supports contracted and uncontracted translation for many languages and has
372support for hyphenation. New languages can easily be added through tables that
373support a rule- or dictionary based approach. Tools for testing and debugging
374tables are also included. Liblouis also supports math braille, Nemeth and
375Marburg.")
376 (home-page "http://liblouis.org/")
cfcf9dea
TGR
377 (license (list license:lgpl2.1+ ; library
378 license:gpl3+)))) ; tools
899784fb 379
8205fe44
RG
380(define-public liblouisutdml
381 (package
382 (name "liblouisutdml")
433b391f 383 (version "2.9.0")
8205fe44
RG
384 (source
385 (origin
386 (method git-fetch)
387 (uri
388 (git-reference
8ed4c468 389 (url "https://github.com/liblouis/liblouisutdml")
8205fe44
RG
390 (commit (string-append "v" version))))
391 (file-name (git-file-name name version))
392 (sha256
433b391f 393 (base32 "0c32cfcfp0lyfd655c9ihhh3p7lhrb9q3xbll7q5dw4km86gaq6w"))))
8205fe44
RG
394 (build-system gnu-build-system)
395 (outputs '("out" "bin" "doc"))
396 (arguments
397 `(#:configure-flags
433b391f 398 (list "--disable-static")))
8205fe44
RG
399 (native-inputs
400 `(("autoconf" ,autoconf)
401 ("automake" ,automake)
402 ("help2man" ,help2man)
403 ("jdk" ,icedtea "jdk")
404 ("libtool" ,libtool)
405 ("makeinfo" ,texinfo)
406 ("pkg-config" ,pkg-config)))
407 (inputs
408 `(("libxml2" ,libxml2)))
409 (propagated-inputs
410 `(("liblouis" ,liblouis)
411 ("liblouis:bin" ,liblouis "bin")))
412 (synopsis "Braille transcription services")
413 (description "Liblouisutdml is a library providing complete braille
414transcription services for xml, html and text documents. It translates into
415appropriate braille codes and formats according to its style sheet and the
416specifications in the document.")
417 (home-page "http://liblouis.org/")
cfcf9dea
TGR
418 (license (list license:lgpl3+ ; library
419 license:gpl3+)))) ; tools
8205fe44 420
a29eb739
RG
421(define-public libstemmer
422 (package
423 (name "libstemmer")
424 (version "2.0.0")
425 (source
426 (origin
427 (method url-fetch)
428 (uri "https://snowballstem.org/dist/libstemmer_c.tgz")
429 (sha256
430 (base32 "1z2xvrjsaaypc04lwz7dg8mjm5cq1gzmn0l544pn6y2ll3r7ckh5"))))
431 (build-system gnu-build-system)
432 (arguments
433 `(#:tests? #f ; No tests exist
434 #:make-flags
435 (list
436 (string-append "CC=" ,(cc-for-target))
437 "CFLAGS=-fPIC")
438 #:phases
439 (modify-phases %standard-phases
440 (delete 'configure)
441 (replace 'install
442 (lambda* (#:key outputs #:allow-other-keys)
443 (let* ((out (assoc-ref outputs "out"))
444 (out-bin (string-append out "/bin"))
445 (out-include (string-append out "/include"))
446 (out-lib (string-append out "/lib")))
447 (install-file "stemwords" out-bin)
448 (install-file "include/libstemmer.h" out-include)
449 (rename-file "libstemmer.o" "libstemmer.a")
450 (install-file "libstemmer.a" out-lib)
451 #t))))))
452 (synopsis "Stemming Library")
453 (description "LibStemmer provides stemming library, supporting several
454languages.")
455 (home-page "https://snowballstem.org/")
cfcf9dea 456 (license license:bsd-3)))
a29eb739 457
0c32bf01
EB
458(define-public perl-lingua-en-findnumber
459 (package
460 (name "perl-lingua-en-findnumber")
84f06e54 461 (version "1.32")
0c32bf01
EB
462 (source
463 (origin
464 (method url-fetch)
465 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
466 "Lingua-EN-FindNumber-" version ".tar.gz"))
467 (sha256
468 (base32
84f06e54 469 "015ximzdp42v824llwlg2pd77vd0d172lb4xs55q9f9zhqf6s5qx"))))
0c32bf01
EB
470 (build-system perl-build-system)
471 (propagated-inputs
472 `(("perl-lingua-en-words2nums" ,perl-lingua-en-words2nums)))
9aba9b12 473 (home-page "https://metacpan.org/release/Lingua-EN-FindNumber")
0c32bf01
EB
474 (synopsis "Locate (written) numbers in English text ")
475 (description "This module provides a regular expression for finding
476numbers in English text. It also provides functions for extracting and
477manipulating such numbers.")
cfcf9dea 478 (license license:perl-license)))
0c32bf01 479
57ff0e04
EB
480(define-public perl-lingua-en-inflect
481 (package
482 (name "perl-lingua-en-inflect")
ce0be1bc 483 (version "1.903")
57ff0e04
EB
484 (source
485 (origin
486 (method url-fetch)
487 (uri (string-append "mirror://cpan/authors/id/D/DC/DCONWAY/"
488 "Lingua-EN-Inflect-" version ".tar.gz"))
489 (sha256
490 (base32
ce0be1bc 491 "0j8d1f1wvmgc11d71pc8xp8fv5a1nb2yfw1dgd19xhscn1klpvzw"))))
57ff0e04 492 (build-system perl-build-system)
a2190ccc 493 (native-inputs `(("perl-module-build" ,perl-module-build)))
9aba9b12 494 (home-page "https://metacpan.org/release/Lingua-EN-Inflect")
57ff0e04
EB
495 (synopsis "Convert singular to plural")
496 (description "Lingua::EN::Inflect provides plural inflections,
497\"a\"/\"an\" selection for English words, and manipulation of numbers as
498words. Plural forms of all nouns, most verbs, and some adjectives are
499provided. Where appropriate, \"classical\" variants (for example: \"brother\"
500-> \"brethren\", \"dogma\" -> \"dogmata\", etc.) are also provided.")
cfcf9dea 501 (license license:perl-license)))
57ff0e04 502
4812a813
EB
503(define-public perl-lingua-en-inflect-number
504 (package
505 (name "perl-lingua-en-inflect-number")
e2fb341f 506 (version "1.12")
4812a813
EB
507 (source
508 (origin
509 (method url-fetch)
510 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
511 "Lingua-EN-Inflect-Number-" version ".tar.gz"))
512 (sha256
513 (base32
e2fb341f 514 "1gxccynkaqav43ww43jp4rzkyr36x97jd03yb5f6yx0jhn1k7yv6"))))
4812a813
EB
515 (build-system perl-build-system)
516 (propagated-inputs
517 `(("perl-lingua-en-inflect" ,perl-lingua-en-inflect)))
9aba9b12 518 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Number")
4812a813
EB
519 (synopsis "Force number of words to singular or plural")
520 (description "This module extends the functionality of Lingua::EN::Inflect
521with three new functions for determining plurality of a word and forcefully
522converting a word to singular or plural.")
cfcf9dea 523 (license license:perl-license)))
4812a813 524
cfed969c
EB
525(define-public perl-lingua-en-inflect-phrase
526 (package
527 (name "perl-lingua-en-inflect-phrase")
cd75b642 528 (version "0.20")
cfed969c
EB
529 (source
530 (origin
531 (method url-fetch)
532 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
533 "Lingua-EN-Inflect-Phrase-" version ".tar.gz"))
534 (sha256
535 (base32
cd75b642 536 "1a6y1l2pjim2242wcpgz066di4pbzfgsjjdl7vg5a5wzm48qj1am"))))
cfed969c
EB
537 (build-system perl-build-system)
538 (native-inputs
539 `(("perl-test-nowarnings" ,perl-test-nowarnings)))
540 (propagated-inputs
541 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)
542 ("perl-lingua-en-inflect" ,perl-lingua-en-inflect)
543 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
544 ("perl-lingua-en-number-isordinal" ,perl-lingua-en-number-isordinal)
545 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)))
9aba9b12 546 (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Phrase")
cfed969c
EB
547 (synopsis "Inflect short English phrases")
548 (description "This module attempts to pluralize or singularize short
549English phrases.")
cfcf9dea 550 (license license:perl-license)))
cfed969c 551
930768b3
EB
552(define-public perl-lingua-en-number-isordinal
553 (package
554 (name "perl-lingua-en-number-isordinal")
5b5b4edf 555 (version "0.05")
930768b3
EB
556 (source
557 (origin
558 (method url-fetch)
559 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
560 "Lingua-EN-Number-IsOrdinal-" version ".tar.gz"))
561 (sha256
562 (base32
5b5b4edf 563 "1mhqjvh2ad30gjab5b3a6mbr4aysyrscp4wp42yy5x6001a6km98"))))
930768b3
EB
564 (build-system perl-build-system)
565 (native-inputs
566 `(("perl-try-tiny" ,perl-try-tiny)
567 ("perl-test-fatal" ,perl-test-fatal)))
568 (propagated-inputs
569 `(("perl-lingua-en-findnumber" ,perl-lingua-en-findnumber)))
9aba9b12 570 (home-page "https://metacpan.org/release/Lingua-EN-Number-IsOrdinal")
930768b3
EB
571 (synopsis "Detect if English number is ordinal or cardinal")
572 (description "This module will tell you if a number, either in words or as
573digits, is a cardinal or ordinal number.")
cfcf9dea 574 (license license:perl-license)))
930768b3 575
d7de0883
EB
576(define-public perl-lingua-en-tagger
577 (package
578 (name "perl-lingua-en-tagger")
35e4e359 579 (version "0.30")
d7de0883
EB
580 (source
581 (origin
582 (method url-fetch)
583 (uri (string-append "mirror://cpan/authors/id/A/AC/ACOBURN/"
584 "Lingua-EN-Tagger-" version ".tar.gz"))
585 (sha256
586 (base32
35e4e359 587 "0nrnkvsf9f0a7lp82sanmy89ms2nqq1lvjqicvsagsvzp513bl5b"))))
d7de0883
EB
588 (build-system perl-build-system)
589 (propagated-inputs
590 `(("perl-memoize-expirelru" ,perl-memoize-expirelru)
591 ("perl-lingua-stem" ,perl-lingua-stem)
592 ("perl-html-parser" ,perl-html-parser)
593 ("perl-html-tagset" ,perl-html-tagset)))
9aba9b12 594 (home-page "https://metacpan.org/release/Lingua-EN-Tagger")
d7de0883
EB
595 (synopsis "Part-of-speech tagger for English natural language processing")
596 (description "This module is a probability based, corpus-trained tagger
597that assigns part-of-speech tags to English text based on a lookup dictionary
598and a set of probability values. The tagger assigns appropriate tags based on
599conditional probabilities - it examines the preceding tag to determine the
600appropriate tag for the current word. Unknown words are classified according
601to word morphology or can be set to be treated as nouns or other parts of
602speech. The tagger also extracts as many nouns and noun phrases as it can,
603using a set of regular expressions.")
cfcf9dea 604 (license license:gpl3)))
d7de0883 605
fc436dba
EB
606(define-public perl-lingua-en-words2nums
607 (package
608 (name "perl-lingua-en-words2nums")
609 (version "0.18")
610 (source
611 (origin
612 (method url-fetch)
613 (uri (string-append "mirror://cpan/authors/id/J/JO/JOEY/"
614 "Lingua-EN-Words2Nums-" version ".tar.gz"))
615 (sha256
616 (base32
617 "118xx8qr1zbx30psv7ic55w65h15mc1vz6zicshfm96jgiwmcrb8"))))
618 (build-system perl-build-system)
9aba9b12 619 (home-page "https://metacpan.org/release/Lingua-EN-Words2Nums")
fc436dba
EB
620 (synopsis "Convert English text to numbers")
621 (description "This module converts English text into numbers. It supports
622both ordinal and cardinal numbers, negative numbers, and very large numbers.")
cfcf9dea 623 (license license:perl-license)))
9b446711
EB
624
625(define-public perl-lingua-pt-stemmer
626 (package
627 (name "perl-lingua-pt-stemmer")
8895a968 628 (version "0.02")
9b446711
EB
629 (source
630 (origin
631 (method url-fetch)
e8409dd2 632 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
9b446711
EB
633 "Lingua-PT-Stemmer-" version ".tar.gz"))
634 (sha256
635 (base32
8895a968 636 "17c48sfbgwd2ivlgf59sr6jdhwa3aim8750f8pyzz7xpi8gz0var"))))
9b446711 637 (build-system perl-build-system)
9aba9b12 638 (home-page "https://metacpan.org/release/Lingua-PT-Stemmer")
9b446711
EB
639 (synopsis "Portuguese language stemming")
640 (description "This module implements a Portuguese stemming algorithm
641proposed in the paper A Stemming Algorithm for the Portuguese Language by
642Moreira, V. and Huyck, C.")
cfcf9dea 643 (license license:perl-license)))
df11e052 644
9766e4fe
EB
645(define-public perl-lingua-stem
646 (package
647 (name "perl-lingua-stem")
648 (version "0.84")
649 (source
650 (origin
651 (method url-fetch)
652 (uri (string-append "mirror://cpan/authors/id/S/SN/SNOWHARE/"
653 "Lingua-Stem-" version ".tar.gz"))
654 (sha256
655 (base32
656 "12avh2mnnc7llmmshrr5bgb473fvydxnlqrqbl2815mf2dp4pxcg"))))
657 (build-system perl-build-system)
a2190ccc
EB
658 (native-inputs
659 `(("perl-module-build" ,perl-module-build)))
9766e4fe
EB
660 (propagated-inputs
661 `(("perl-lingua-pt-stemmer" ,perl-lingua-pt-stemmer)
662 ("perl-lingua-stem-fr" ,perl-lingua-stem-fr)
663 ("perl-lingua-stem-it" ,perl-lingua-stem-it)
664 ("perl-lingua-stem-ru" ,perl-lingua-stem-ru)
665 ("perl-lingua-stem-snowball-da" ,perl-lingua-stem-snowball-da)
666 ("perl-snowball-norwegian" ,perl-snowball-norwegian)
667 ("perl-snowball-swedish" ,perl-snowball-swedish)
668 ("perl-text-german" ,perl-text-german)))
9aba9b12 669 (home-page "https://metacpan.org/release/Lingua-Stem")
9766e4fe
EB
670 (synopsis "Stemming of words in various languages")
671 (description "This routine applies stemming algorithms to its parameters,
672returning the stemmed words as appropriate to the selected locale.")
cfcf9dea 673 (license license:perl-license)))
9766e4fe 674
df11e052
EB
675(define-public perl-lingua-stem-fr
676 (package
677 (name "perl-lingua-stem-fr")
678 (version "0.02")
679 (source
680 (origin
681 (method url-fetch)
682 (uri (string-append "mirror://cpan/authors/id/S/SD/SDP/"
683 "Lingua-Stem-Fr-" version ".tar.gz"))
684 (sha256
685 (base32
686 "0vyrspwzaqjxm5mqshf4wvwa3938mkajd1918d9ii2l9m2rn8kwx"))))
687 (build-system perl-build-system)
9aba9b12 688 (home-page "https://metacpan.org/release/Lingua-Stem-Fr")
df11e052
EB
689 (synopsis "Porter's stemming algorithm for French")
690 (description "This module uses a modified version of the Porter Stemming
691Algorithm to return a stemmed French word.")
cfcf9dea 692 (license license:perl-license)))
6afe5959
EB
693
694(define-public perl-lingua-stem-it
695 (package
696 (name "perl-lingua-stem-it")
697 (version "0.02")
698 (source
699 (origin
700 (method url-fetch)
701 (uri (string-append "mirror://cpan/authors/id/A/AC/ACALPINI/"
702 "Lingua-Stem-It-" version ".tar.gz"))
703 (sha256
704 (base32
705 "1207r183s5hlh4mfwa6p46vzm0dhvrs2dnss5s41a0gyfkxp7riq"))))
706 (build-system perl-build-system)
9aba9b12 707 (home-page "https://metacpan.org/release/Lingua-Stem-It")
6afe5959
EB
708 (synopsis "Porter's stemming algorithm for Italian")
709 (description "This module applies the Porter Stemming Algorithm to its
710parameters, returning the stemmed Italian word.")
cfcf9dea 711 (license license:perl-license)))
95d2eec1
EB
712
713(define-public perl-lingua-stem-ru
714 (package
715 (name "perl-lingua-stem-ru")
a4b7142e 716 (version "0.04")
95d2eec1
EB
717 (source
718 (origin
719 (method url-fetch)
a4b7142e 720 (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
95d2eec1
EB
721 "Lingua-Stem-Ru-" version ".tar.gz"))
722 (sha256
723 (base32
a4b7142e 724 "0a2jmdz7jn32qj5hyiw5kbv8fvlpmws8i00a6xcbkzb48yvwww0j"))))
95d2eec1 725 (build-system perl-build-system)
9aba9b12 726 (home-page "https://metacpan.org/release/Lingua-Stem-Ru")
95d2eec1
EB
727 (synopsis "Porter's stemming algorithm for Russian")
728 (description "This module applies the Porter Stemming Algorithm to its
729parameters, returning the stemmed Russian (KOI8-R only) word.")
cfcf9dea 730 (license license:perl-license)))
30c40044
EB
731
732(define-public perl-lingua-stem-snowball-da
733 (package
734 (name "perl-lingua-stem-snowball-da")
735 (version "1.01")
736 (source
737 (origin
738 (method url-fetch)
739 (uri (string-append "mirror://cpan/authors/id/C/CI/CINE/"
740 "Lingua-Stem-Snowball-Da-" version ".tar.gz"))
741 (sha256
742 (base32
743 "0mm0m7glm1s6i9f6a78jslw6wh573208arxhq93yriqmw17bwf9f"))))
744 (build-system perl-build-system)
9aba9b12 745 (home-page "https://metacpan.org/release/Lingua-Stem-Snowball-Da")
30c40044
EB
746 (synopsis "Porters stemming algorithm for Danish")
747 (description "Lingua::Stem::Snowball::Da is a perl port of the danish
748stemmer at http://snowball.sourceforge.net, it was originally altered from the
749Lingua::Stem::Snowball::Se.")
cfcf9dea 750 (license license:gpl2)))
1064abdc
EB
751
752(define-public perl-snowball-norwegian
753 (package
754 (name "perl-snowball-norwegian")
755 (version "1.2")
756 (source
757 (origin
758 (method url-fetch)
759 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
760 "Snowball-Norwegian-" version ".tar.gz"))
761 (sha256
762 (base32
763 "0675v45bbsh7vr7kpf36xs2q79g02iq1kmfw22h20xdk4rzqvkqx"))))
764 (build-system perl-build-system)
a2190ccc 765 (native-inputs `(("perl-module-build" ,perl-module-build)))
9aba9b12 766 (home-page "https://metacpan.org/release/Snowball-Norwegian")
1064abdc
EB
767 (synopsis "Porters stemming algorithm for Norwegian")
768 (description "Lingua::Stem::Snowball::No is a perl port of the norwegian
769stemmer at http://snowball.tartarus.org.")
cfcf9dea 770 (license license:perl-license)))
1f4b1129
EB
771
772(define-public perl-snowball-swedish
773 (package
774 (name "perl-snowball-swedish")
775 (version "1.2")
776 (source
777 (origin
778 (method url-fetch)
779 (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
780 "Snowball-Swedish-" version ".tar.gz"))
781 (sha256
782 (base32
783 "0agwc12jk5kmabnpsplw3wf4ii5w1zb159cpin44x3srb0sr5apg"))))
784 (build-system perl-build-system)
a2190ccc 785 (native-inputs `(("perl-module-build" ,perl-module-build)))
9aba9b12 786 (home-page "https://metacpan.org/release/Snowball-Swedish")
1f4b1129
EB
787 (synopsis "Porters stemming algorithm for Swedish")
788 (description "Lingua::Stem::Snowball::Se is a perl port of the swedish
789stemmer at http://snowball.sourceforge.net.")
cfcf9dea 790 (license license:perl-license)))
2b83abae 791
f3bbbb73
EB
792(define-public perl-string-toidentifier-en
793 (package
794 (name "perl-string-toidentifier-en")
97c79494 795 (version "0.12")
f3bbbb73
EB
796 (source
797 (origin
798 (method url-fetch)
799 (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
800 "String-ToIdentifier-EN-" version ".tar.gz"))
801 (sha256
802 (base32
97c79494 803 "12nw7h2yiybhdw0vnnpc7bif8ylhsn6kqf6s39dsrf9h54iq9yrs"))))
f3bbbb73
EB
804 (build-system perl-build-system)
805 (propagated-inputs
806 `(("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
807 ("perl-text-unidecode" ,perl-text-unidecode)
808 ("perl-namespace-clean" ,perl-namespace-clean)))
9aba9b12 809 (home-page "https://metacpan.org/release/String-ToIdentifier-EN")
e881752c 810 (synopsis "Convert strings to English program identifiers")
f3bbbb73
EB
811 (description "This module provides a utility method, \"to_identifier\" for
812converting an arbitrary string into a readable representation using the ASCII
813subset of \"\\w\" for use as an identifier in a computer program. The intent
814is to make unique identifier names from which the content of the original
815string can be easily inferred by a human just by reading the identifier.")
cfcf9dea 816 (license license:perl-license)))
f3bbbb73 817
2b83abae
EB
818(define-public perl-text-german
819 (package
820 (name "perl-text-german")
821 (version "0.06")
822 (source
823 (origin
824 (method url-fetch)
825 (uri (string-append "mirror://cpan/authors/id/U/UL/ULPFR/"
826 "Text-German-" version ".tar.gz"))
827 (sha256
828 (base32
829 "1p87pgap99lw0nv62i3ghvsi7yg90lhn8vsa3yqp75rd04clybcj"))))
830 (build-system perl-build-system)
9aba9b12 831 (home-page "https://metacpan.org/release/Text-German")
2b83abae 832 (synopsis "German grundform reduction")
e881752c 833 (description "This module is a rather incomplete implementation of work
2b83abae 834done by Gudrun Putze-Meier.")
cfcf9dea 835 (license license:perl-license)))
410387ad
AV
836
837(define* (tegaki-release-uri proj version
838 #:optional (ext "tar.gz"))
839 (string-append "https://github.com/tegaki/tegaki/releases/download"
840 "/v" version "/" proj "-" version "." ext))
841
842(define remove-pre-compiled-files
843 (lambda exts
844 "Return snippet for removing pre-compiled files matching one of the
845extensions in EXTS."
846 `(begin (for-each delete-file
847 (find-files "."
848 (lambda (name _)
849 (any (cut string-suffix? <> name)
850 (map (cut string-append "." <>)
851 ',exts)))))
852 #t)))
853
854;;; modules required for the above snippet
855(define remove-pre-compiled-files-modules
856 '((guix build utils)
857 (srfi srfi-1)
858 (srfi srfi-26)))
859
860(define-public python2-tegaki-wagomu
861 (package
862 (name "python2-tegaki-wagomu")
863 (version "0.3.1")
864 (source
865 (origin
866 (method url-fetch)
867 (uri (tegaki-release-uri "tegaki-wagomu" version))
868 (sha256
869 (base32
870 "1pzdiq4zy1nyylaj9i6v2h4h0r05klahskzpafpp367p4rysi1x9"))
871 (modules remove-pre-compiled-files-modules)
872 (snippet (remove-pre-compiled-files "pyc"))))
873 (build-system python-build-system)
874 (arguments
875 `(#:python ,python-2 ; only Python 2 is supported
876 #:phases
877 (modify-phases %standard-phases
878 (add-after 'unpack 'fix-recognizer
879 (lambda* (#:key inputs #:allow-other-keys)
880 ;; fix missing module and function
881 (substitute* "tegakiwagomu.py"
882 (("import Results,")
883 "import ")
884 (("def _recognize")
885 "def recognize")
886 (("Results\\(candidates\\)")
887 "candidates"))
888 #t)))))
889 (inputs
890 `(("glib" ,glib)))
891 (native-inputs
892 `(("pkg-config" ,pkg-config)
893 ("swig" ,swig)))
894 (home-page "https://tegaki.github.io/")
895 (synopsis
896 "Chinese and Japanese Handwriting Recognition (Recognition engine)")
897 (description
898 "Tegaki is an ongoing project which aims to develop a free and open-source
899modern implementation of handwriting recognition software, specifically
900designed for Chinese (simplified and traditional) and Japanese, and that is
901suitable for both the desktop and mobile devices.")
cfcf9dea 902 (license license:gpl2+))) ; all files
c2810523
AV
903
904(define-public python2-tegaki-python
905 (package
906 (inherit python2-tegaki-wagomu)
907 (name "python2-tegaki-python")
908 (version "0.3.1")
909 (source
910 (origin
911 (method url-fetch)
912 (uri (tegaki-release-uri "tegaki-python" version))
913 (sha256
914 (base32
915 "0x93k7pw9nh0ywd97pr8pm7jv3f94nw044i5k0zvzhdpsjqvak7p"))
916 (modules remove-pre-compiled-files-modules)
917 (snippet (remove-pre-compiled-files "pyc"))))
918 (arguments
919 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
920 ((#:phases _)
921 `(modify-phases %standard-phases
922 (add-after 'unpack 'pre-configure
923 (lambda* (#:key inputs #:allow-other-keys)
924 ;; Always convert string to unicode to avoid the following error
925 ;; when running "tegaki-build" in python2-tegaki-tools:
926 ;;
927 ;; sqlite3.ProgrammingError: You must not use 8-bit bytestrings
928 ;; unless you use a text_factory that can interpret 8-bit
929 ;; bytestrings (like text_factory = str).
930 ;; It is highly recommended that you instead just switch your
931 ;; application to Unicode strings.
932 (substitute* "tegaki/charcol.py"
933 (("sqlite3.OptimizedUnicode")
934 "lambda s: unicode(s, 'utf-8')"))
935 (substitute* "tegaki/engine.py"
936 (("/usr(/local)?")
937 (assoc-ref inputs "python2-tegaki-wagomu")))
938 #t))))))
939 ;; override inherited inputs
940 (inputs '())
941 (native-inputs '())
942 (propagated-inputs
943 `(("python2-tegaki-wagomu" ,python2-tegaki-wagomu)
944 ("python2-zinnia" ,python2-zinnia)))
945 (synopsis
946 "Chinese and Japanese Handwriting Recognition (Base python library)")
cfcf9dea
TGR
947 (license (list license:gpl2+ ; all files except...
948 license:bsd-3 ; dictutils.py
949 license:zpl2.1)))) ; minjson.py
58ac9289
AV
950
951(define-public python2-tegaki-pygtk
952 (package
953 (inherit python2-tegaki-wagomu)
954 (name "python2-tegaki-pygtk")
955 (version "0.3.1")
956 (source
957 (origin
958 (method url-fetch)
959 (uri (tegaki-release-uri "tegaki-pygtk" version))
960 (sha256
961 (base32
962 "1cip0azxhjdj2dg2z85cp1z3lz4qwx3w1j7z4xmcm7npapmsaqs2"))
963 (modules remove-pre-compiled-files-modules)
964 (snippet (remove-pre-compiled-files "pyc"))))
965 (arguments
966 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
967 ((#:phases _)
968 `(modify-phases %standard-phases
969 (add-after 'unpack 'fix-paths
970 (lambda* (#:key inputs #:allow-other-keys)
971 (substitute* "tegakigtk/fakekey.py"
972 (("libX11.so.6" so)
973 (string-append (assoc-ref inputs "libx11") "/lib/" so))
974 (("libXtst.so.6" so)
975 (string-append (assoc-ref inputs "libxtst") "/lib/" so)))
976 #t))))))
977 (inputs ; required for sending key strokes
978 `(("libx11" ,libx11)
979 ("libxtst" ,libxtst)))
980 (native-inputs '()) ; override inherited inputs
981 (propagated-inputs
982 `(("python2-pygtk" ,python2-pygtk)
983 ("python2-tegaki-python" ,python2-tegaki-python)))
984 (synopsis "Chinese and Japanese Handwriting Recognition (Base UI library)")
cfcf9dea 985 (license license:gpl2+)))
dd97a9c4
AV
986
987(define-public python2-tegaki-tools
988 (package
989 (inherit python2-tegaki-wagomu)
990 (name "python2-tegaki-tools")
991 (version "0.3.1")
992 (source
993 (origin
994 (method url-fetch)
995 (uri (tegaki-release-uri "tegaki-tools" version))
996 (sha256
997 (base32
998 "0xxv97ggh2jgldw3r7y59lv3fhz733r6l7mdn6nh4m0gvb0ja971"))
999 (modules remove-pre-compiled-files-modules)
1000 (snippet (remove-pre-compiled-files "pyc"))))
1001 (arguments
1002 (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
1003 ((#:phases _) '%standard-phases)))
1004 (inputs
1005 `(("python2-tegaki-pygtk" ,python2-tegaki-pygtk)))
1006 ;; override inherited inputs
1007 (native-inputs '())
1008 (propagated-inputs '())
1009 (synopsis "Chinese and Japanese Handwriting Recognition (Advanced tools)")
1010 ;; Files in gifenc/ are licensed under gpl3+ while other files are licensed
1011 ;; under gpl2+. Therefore, the combined work is licensed under gpl3+.
cfcf9dea 1012 (license license:gpl3+)))
e4f72a58
AV
1013
1014(define-public python2-tegaki-recognize
1015 (let ((commit "eceec69fe651d0733c8c8752dae569d2283d0f3c")
1016 (revision "1"))
1017 (package
1018 (inherit python2-tegaki-tools)
1019 (name "python2-tegaki-recognize")
1020 ;; version copied from <https://github.com/tegaki/tegaki/releases>
1021 (version (git-version "0.3.1" revision commit))
1022 (source
1023 (origin
1024 ;; We use GIT-FETCH because 'tegaki-recognize.desktop.in' and
1025 ;; 'tegaki-recognize.in' are missing in the tarball.
1026 (method git-fetch)
1027 (uri (git-reference
b0e7b699 1028 (url "https://github.com/tegaki/tegaki")
e4f72a58
AV
1029 (commit commit)))
1030 (sha256
1031 (base32
1032 "09mw2if9p885phbgah5f95q3fwy7s5b46qlmpxqyzfcnj6g7afr5"))
1033 (file-name (git-file-name name version))
1034 (modules `((guix build utils)
1035 (ice-9 ftw)
1036 (srfi srfi-26)
1037 ,@remove-pre-compiled-files-modules))
1038 (snippet
1039 `(begin
1040 ;; remove unnecessary files with potentially different license
1041 (for-each delete-file-recursively
1042 (scandir "."
1043 (negate (cut member <> '("tegaki-recognize"
1044 "." "..")))))
1045 ,(remove-pre-compiled-files "pyc")
1046 #t))))
1047 (arguments
1048 (substitute-keyword-arguments (package-arguments python2-tegaki-tools)
1049 ((#:phases _)
1050 `(modify-phases %standard-phases
1051 (add-after 'unpack 'chdir
1052 (lambda _
1053 (chdir "tegaki-recognize")
1054 #t))
1055 ;; 'setup.py' script does not support one of the Python build
1056 ;; system's default flags, "--single-version-externally-managed"
1057 (replace 'install
1058 (lambda* (#:key outputs #:allow-other-keys)
1059 (invoke "python" "setup.py" "install"
1060 (string-append "--prefix=" (assoc-ref outputs "out"))
1061 "--root=/")
1062 #t))))))
1063 (synopsis "Chinese and Japanese Handwriting Recognition (Main program)")
cfcf9dea 1064 (license license:gpl2+))))
3ed30b88
AV
1065
1066(define-public tegaki-zinnia-japanese
1067 (package
1068 (inherit python2-tegaki-wagomu)
1069 (name "tegaki-zinnia-japanese")
1070 (version "0.3")
1071 (source
1072 (origin
1073 (method url-fetch)
1074 (uri (tegaki-release-uri name version "zip"))
1075 (sha256
1076 (base32
1077 "1nmg9acxhcqly9gwkyb9m0hpy76fll91ywk4b1q4xms0ajxip1h7"))
1078 (modules remove-pre-compiled-files-modules)
1079 (snippet (remove-pre-compiled-files "model"))))
1080 (build-system gnu-build-system)
1081 (arguments
1082 `(#:tests? #f ; no tests
1083 #:phases
1084 (modify-phases %standard-phases
1085 (replace 'configure
1086 (lambda* (#:key outputs #:allow-other-keys)
1087 (substitute* "Makefile"
1088 (("/usr/local")
1089 (assoc-ref outputs "out")))
1090 #t)))))
1091 ;; override inherited inputs
1092 (inputs '())
1093 (native-inputs
1094 `(("python2-tegaki-tools" ,python2-tegaki-tools)))
1095 (propagated-inputs '())
1096 (native-search-paths
1097 (list (search-path-specification
1098 (variable "TEGAKI_MODEL_PATH")
1099 (files '("share/tegaki/models")))))
1100 (synopsis "Chinese and Japanese Handwriting Recognition (Model)")
cfcf9dea 1101 (license license:lgpl2.1)))
c8bbd808
AV
1102
1103(define-public tegaki-zinnia-japanese-light
1104 (package
1105 (inherit tegaki-zinnia-japanese)
1106 (name "tegaki-zinnia-japanese-light")
1107 (version "0.3")
1108 (source
1109 (origin
1110 (method url-fetch)
1111 (uri (tegaki-release-uri name version "zip"))
1112 (sha256
1113 (base32
1114 "0x0fs29ylqzxd6xvg51h7rigpbisd7q8v11df425ib2j792yfyf8"))
1115 (modules remove-pre-compiled-files-modules)
1116 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1117 (license license:lgpl2.1)))
5fd56748
AV
1118
1119(define-public tegaki-zinnia-japanese-kyoiku
1120 (package
1121 (inherit tegaki-zinnia-japanese)
1122 (name "tegaki-zinnia-japanese-kyoiku")
1123 (version "0.3")
1124 (source
1125 (origin
1126 (method url-fetch)
1127 (uri (tegaki-release-uri name version "zip"))
1128 (sha256
1129 (base32
1130 "0am94bcpmbzplxdnwn9gk15sgaizvcfhmv13mk14jjvx3419cvvx"))
1131 (modules remove-pre-compiled-files-modules)
1132 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1133 (license license:lgpl2.1)))
8955412b
AV
1134
1135(define-public tegaki-zinnia-japanese-joyo
1136 (package
1137 (inherit tegaki-zinnia-japanese)
1138 (name "tegaki-zinnia-japanese-joyo")
1139 (version "0.3")
1140 (source
1141 (origin
1142 (method url-fetch)
1143 (uri (tegaki-release-uri name version "zip"))
1144 (sha256
1145 (base32
1146 "1v0j40lzdyiz01ayws0b8r7fsdy2mr32658382kz4wyk883wzx2z"))
1147 (modules remove-pre-compiled-files-modules)
1148 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1149 (license license:lgpl2.1)))
e0679464
AV
1150
1151(define-public tegaki-zinnia-simplified-chinese
1152 (package
1153 (inherit tegaki-zinnia-japanese)
1154 (name "tegaki-zinnia-simplified-chinese")
1155 (version "0.3")
1156 (source
1157 (origin
1158 (method url-fetch)
1159 (uri (tegaki-release-uri name version "zip"))
1160 (sha256
1161 (base32
1162 "18wq0jccv7lpnrfnzspyc110d6pj2v1i21xcx4fmgzz1lnln3fs5"))
1163 (modules remove-pre-compiled-files-modules)
1164 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1165 (license license:lgpl2.1)))
ca1f28bd
AV
1166
1167(define-public tegaki-zinnia-simplified-chinese-light
1168 (package
1169 (inherit tegaki-zinnia-japanese)
1170 (name "tegaki-zinnia-simplified-chinese-light")
1171 (version "0.3")
1172 (source
1173 (origin
1174 (method url-fetch)
1175 (uri (tegaki-release-uri name version "zip"))
1176 (sha256
1177 (base32
1178 "0v24yf0w0p03lb7fyx128a75mwzad166bigvlbrzqnad789qg1sr"))
1179 (modules remove-pre-compiled-files-modules)
1180 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1181 (license license:lgpl2.1)))
0bfcc29d
AV
1182
1183(define-public tegaki-zinnia-traditional-chinese
1184 (package
1185 (inherit tegaki-zinnia-japanese)
1186 (name "tegaki-zinnia-traditional-chinese")
1187 (version "0.3")
1188 (source
1189 (origin
1190 (method url-fetch)
1191 (uri (tegaki-release-uri name version "zip"))
1192 (sha256
1193 (base32
1194 "140nlp6hynrai2svs5670jjfw1za6ayflhyj2dl0bzsfgbk3447l"))
1195 (modules remove-pre-compiled-files-modules)
1196 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1197 (license license:lgpl2.1)))
caee9806
AV
1198
1199(define-public tegaki-zinnia-traditional-chinese-light
1200 (package
1201 (inherit tegaki-zinnia-japanese)
1202 (name "tegaki-zinnia-traditional-chinese-light")
1203 (version "0.3")
1204 (source
1205 (origin
1206 (method url-fetch)
1207 (uri (tegaki-release-uri name version "zip"))
1208 (sha256
1209 (base32
1210 "1m6yk6a57vs9wg5y50qciwi1ahhmklp2mgsjysbj4mnyzv6yhcr2"))
1211 (modules remove-pre-compiled-files-modules)
1212 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1213 (license license:lgpl2.1)))
6b32e91a
AV
1214
1215(define-public tegaki-wagomu-japanese
1216 (package
1217 (inherit tegaki-zinnia-japanese)
1218 (name "tegaki-wagomu-japanese")
1219 (version "0.3")
1220 (source
1221 (origin
1222 (method url-fetch)
1223 (uri (tegaki-release-uri name version "zip"))
1224 (sha256
1225 (base32
1226 "0flj5id8xwsn7csrrzqz9prdikswnwm2wms0as2vzdpxzph1az4k"))
1227 (modules remove-pre-compiled-files-modules)
1228 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1229 (license license:lgpl2.1)))
ee3dc52b
AV
1230
1231(define-public tegaki-wagomu-japanese-kyoiku
1232 (package
1233 (inherit tegaki-zinnia-japanese)
1234 (name "tegaki-wagomu-japanese-kyoiku")
1235 (version "0.3")
1236 (source
1237 (origin
1238 (method url-fetch)
1239 (uri (tegaki-release-uri name version "zip"))
1240 (sha256
1241 (base32
1242 "0v8crfh8rdf6ndp16g52s5jlrrlwh73xp38zjn5i9dlacx8kfqg1"))
1243 (modules remove-pre-compiled-files-modules)
1244 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1245 (license license:lgpl2.1)))
7c25904c
AV
1246
1247(define-public tegaki-wagomu-japanese-joyo
1248 (package
1249 (inherit tegaki-zinnia-japanese)
1250 (name "tegaki-wagomu-japanese-joyo")
1251 (version "0.3")
1252 (source
1253 (origin
1254 (method url-fetch)
1255 (uri (tegaki-release-uri name version "zip"))
1256 (sha256
1257 (base32
1258 "0wk8shpr963zp328g991qs6abpnacq4242003m687z2d6yp7nph2"))
1259 (modules remove-pre-compiled-files-modules)
1260 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1261 (license license:lgpl2.1)))
708c6857
AV
1262
1263(define-public tegaki-wagomu-simplified-chinese
1264 (package
1265 (inherit tegaki-zinnia-japanese)
1266 (name "tegaki-wagomu-simplified-chinese")
1267 (version "0.3")
1268 (source
1269 (origin
1270 (method url-fetch)
1271 (uri (tegaki-release-uri name version "zip"))
1272 (sha256
1273 (base32
1274 "0wqprynigqxqxv128i1smh81gxvmjj056d9qpznxa3n9f5ymlbj6"))
1275 (modules remove-pre-compiled-files-modules)
1276 (snippet (remove-pre-compiled-files "model"))))
cfcf9dea 1277 (license license:lgpl2.1)))
0ed97e69
AV
1278
1279;;; Upstream does not provide the source for tegaki-wagomu-traditional-chinese.
1280;;; Therefore, we use the source for tegaki-zinnia-traditional-chinese and
1281;;; patch the Makefile accordingly.
1282(define-public tegaki-wagomu-traditional-chinese
1283 (package
1284 (inherit tegaki-zinnia-traditional-chinese)
1285 (name "tegaki-wagomu-traditional-chinese")
1286 (arguments
1287 (substitute-keyword-arguments
1288 (package-arguments tegaki-zinnia-traditional-chinese)
1289 ((#:phases phases '%standard-phases)
1290 `(modify-phases ,phases
1291 (replace 'configure
1292 (lambda args
1293 (let ((configure (assq-ref ,phases 'configure)))
1294 (apply configure args))
1295 (substitute* "Makefile"
1296 (("zinnia") "wagomu"))
1297 #t))))))
cfcf9dea 1298 (license license:lgpl2.1)))
1f6f0b6b
RW
1299
1300(define-public link-grammar
1301 (package
1302 (name "link-grammar")
1303 (version "5.7.0")
1304 (source (origin
1305 (method url-fetch)
1306 (uri (string-append "https://www.abisource.com/downloads/"
1307 "link-grammar/" version
1308 "/link-grammar-" version ".tar.gz"))
1309 (sha256
1310 (base32
1311 "0ak1v469k56v3511kxxkxvx1nw6zcxcl0f1kcvc82ffacqbr4y96"))))
1312 (build-system gnu-build-system)
1313 (home-page "https://www.abisource.com/projects/link-grammar/")
1314 (synopsis "Link grammar parser")
1315 (description "The Link Grammar Parser is a syntactic parser of English,
1316Russian, Arabic and Persian (and other languages as well), based on Link
1317Grammar, an original theory of syntax and morphology. Given a sentence, the
1318system assigns to it a syntactic structure, which consists of a set of
1319labelled links connecting pairs of words. The parser also produces a
1320\"constituent\" (HPSG style phrase tree) representation of a sentence (showing
1321noun phrases, verb phrases, etc.).")
cfcf9dea 1322 (license license:bsd-3)))
fa76fb63
JL
1323
1324(define-public praat
1325 (package
1326 (name "praat")
d67721ba 1327 (version "6.1.30")
fa76fb63
JL
1328 (source (origin
1329 (method git-fetch)
1330 (uri (git-reference
1331 (url "https://github.com/praat/praat")
1332 (commit (string-append "v" version))))
1333 (file-name (git-file-name name version))
1334 (sha256
1335 (base32
d67721ba 1336 "1pjfifyv3wjn68l3i2dr83xm75nf2kxvfxrk9qqbmwz58p183jw4"))))
fa76fb63
JL
1337 (build-system gnu-build-system)
1338 (arguments
0e25995a 1339 `(#:tests? #f ; no test target
fa76fb63
JL
1340 #:phases
1341 (modify-phases %standard-phases
1342 (replace 'configure
1343 (lambda _
1344 (copy-file "makefiles/makefile.defs.linux.pulse" "makefile.defs")
1345 #t))
1346 (replace 'install
1347 (lambda* (#:key outputs #:allow-other-keys)
1348 (let* ((out (assoc-ref outputs "out"))
1349 (bin (string-append out "/bin")))
1350 (mkdir-p bin)
1351 (copy-file "praat" (string-append bin "/praat")))
1352 #t)))))
1353 (inputs
1354 `(("alsa-lib" ,alsa-lib)
1355 ("gtk" ,gtk+-2)
1356 ("jack" ,jack-1)
1357 ("publesaudio" ,pulseaudio)))
1358 (native-inputs
1359 `(("pkg-config" ,pkg-config)))
1cbc8f5f 1360 (home-page "https://www.fon.hum.uva.nl/praat/")
fa76fb63 1361 (synopsis "Doing phonetics by computer")
7230f6d5
TGR
1362 (description "Praat is a tool to perform phonetics tasks. It can do speech
1363analysis (pitch, formant, intensity, ...), speech synthesis, labelling, segmenting
fa76fb63 1364and manipulation.")
cfcf9dea 1365 (license license:gpl2+)))