language.scm 50 KB

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