language.scm 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361
  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. (list 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. (list ncurses sqlite))
  321. (synopsis "Chinese phonetic input method")
  322. (description "Chewing is an intelligent phonetic (Zhuyin/Bopomofo) input
  323. method, one of the most popular choices for Traditional Chinese users.")
  324. (home-page "http://chewing.im/")
  325. (license license:lgpl2.1+)))
  326. (define-public liblouis
  327. (package
  328. (name "liblouis")
  329. (version "3.15.0")
  330. (source
  331. (origin
  332. (method git-fetch)
  333. (uri
  334. (git-reference
  335. (url "https://github.com/liblouis/liblouis")
  336. (commit (string-append "v" version))))
  337. (file-name (git-file-name name version))
  338. (sha256
  339. (base32 "1ljy5xsy7vf2r0ix0d7bqcr6qvr6897f8madsx9zlm1mrj31n5px"))))
  340. (build-system gnu-build-system)
  341. (outputs '("out" "bin" "doc" "python"))
  342. (arguments
  343. `(#:configure-flags
  344. (list
  345. "--disable-static"
  346. "--enable-ucs4")
  347. #:phases
  348. (modify-phases %standard-phases
  349. (add-after 'install 'install-python-extension
  350. (lambda* (#:key outputs #:allow-other-keys)
  351. (with-directory-excursion "python"
  352. (invoke "python" "setup.py" "install"
  353. (string-append "--prefix="
  354. (assoc-ref outputs "python"))
  355. "--root=/")))))))
  356. (native-inputs
  357. `(("autoconf" ,autoconf)
  358. ("automake" ,automake)
  359. ("clang-format" ,clang)
  360. ("help2man" ,help2man)
  361. ("libtool" ,libtool)
  362. ("libyaml" ,libyaml)
  363. ("makeinfo" ,texinfo)
  364. ("perl" ,perl)
  365. ("pkg-config" ,pkg-config)
  366. ("python" ,python-wrapper)))
  367. (synopsis "Braille translator and back-translator")
  368. (description "Liblouis is a braille translator and back-translator named in
  369. honor of Louis Braille. It features support for computer and literary braille,
  370. supports contracted and uncontracted translation for many languages and has
  371. support for hyphenation. New languages can easily be added through tables that
  372. support a rule- or dictionary based approach. Tools for testing and debugging
  373. tables are also included. Liblouis also supports math braille, Nemeth and
  374. Marburg.")
  375. (home-page "http://liblouis.org/")
  376. (license (list license:lgpl2.1+ ; library
  377. license:gpl3+)))) ; tools
  378. (define-public liblouisutdml
  379. (package
  380. (name "liblouisutdml")
  381. (version "2.9.0")
  382. (source
  383. (origin
  384. (method git-fetch)
  385. (uri
  386. (git-reference
  387. (url "https://github.com/liblouis/liblouisutdml")
  388. (commit (string-append "v" version))))
  389. (file-name (git-file-name name version))
  390. (sha256
  391. (base32 "0c32cfcfp0lyfd655c9ihhh3p7lhrb9q3xbll7q5dw4km86gaq6w"))))
  392. (build-system gnu-build-system)
  393. (outputs '("out" "bin" "doc"))
  394. (arguments
  395. `(#:configure-flags
  396. (list "--disable-static")))
  397. (native-inputs
  398. `(("autoconf" ,autoconf)
  399. ("automake" ,automake)
  400. ("help2man" ,help2man)
  401. ("jdk" ,icedtea "jdk")
  402. ("libtool" ,libtool)
  403. ("makeinfo" ,texinfo)
  404. ("pkg-config" ,pkg-config)))
  405. (inputs
  406. (list libxml2))
  407. (propagated-inputs
  408. `(("liblouis" ,liblouis)
  409. ("liblouis:bin" ,liblouis "bin")))
  410. (synopsis "Braille transcription services")
  411. (description "Liblouisutdml is a library providing complete braille
  412. transcription services for xml, html and text documents. It translates into
  413. appropriate braille codes and formats according to its style sheet and the
  414. specifications in the document.")
  415. (home-page "http://liblouis.org/")
  416. (license (list license:lgpl3+ ; library
  417. license:gpl3+)))) ; tools
  418. (define-public libstemmer
  419. (package
  420. (name "libstemmer")
  421. (version "2.0.0")
  422. (source
  423. (origin
  424. (method url-fetch)
  425. (uri "https://snowballstem.org/dist/libstemmer_c.tgz")
  426. (sha256
  427. (base32 "1z2xvrjsaaypc04lwz7dg8mjm5cq1gzmn0l544pn6y2ll3r7ckh5"))))
  428. (build-system gnu-build-system)
  429. (arguments
  430. `(#:tests? #f ; No tests exist
  431. #:make-flags
  432. (list
  433. (string-append "CC=" ,(cc-for-target))
  434. "CFLAGS=-fPIC")
  435. #:phases
  436. (modify-phases %standard-phases
  437. (delete 'configure)
  438. (replace 'install
  439. (lambda* (#:key outputs #:allow-other-keys)
  440. (let* ((out (assoc-ref outputs "out"))
  441. (out-bin (string-append out "/bin"))
  442. (out-include (string-append out "/include"))
  443. (out-lib (string-append out "/lib")))
  444. (install-file "stemwords" out-bin)
  445. (install-file "include/libstemmer.h" out-include)
  446. (rename-file "libstemmer.o" "libstemmer.a")
  447. (install-file "libstemmer.a" out-lib)
  448. #t))))))
  449. (synopsis "Stemming Library")
  450. (description "LibStemmer provides stemming library, supporting several
  451. languages.")
  452. (home-page "https://snowballstem.org/")
  453. (license license:bsd-3)))
  454. (define-public perl-lingua-en-findnumber
  455. (package
  456. (name "perl-lingua-en-findnumber")
  457. (version "1.32")
  458. (source
  459. (origin
  460. (method url-fetch)
  461. (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
  462. "Lingua-EN-FindNumber-" version ".tar.gz"))
  463. (sha256
  464. (base32
  465. "015ximzdp42v824llwlg2pd77vd0d172lb4xs55q9f9zhqf6s5qx"))))
  466. (build-system perl-build-system)
  467. (propagated-inputs
  468. (list perl-lingua-en-words2nums))
  469. (home-page "https://metacpan.org/release/Lingua-EN-FindNumber")
  470. (synopsis "Locate (written) numbers in English text")
  471. (description "This module provides a regular expression for finding
  472. numbers in English text. It also provides functions for extracting and
  473. manipulating such numbers.")
  474. (license license:perl-license)))
  475. (define-public perl-lingua-en-inflect
  476. (package
  477. (name "perl-lingua-en-inflect")
  478. (version "1.903")
  479. (source
  480. (origin
  481. (method url-fetch)
  482. (uri (string-append "mirror://cpan/authors/id/D/DC/DCONWAY/"
  483. "Lingua-EN-Inflect-" version ".tar.gz"))
  484. (sha256
  485. (base32
  486. "0j8d1f1wvmgc11d71pc8xp8fv5a1nb2yfw1dgd19xhscn1klpvzw"))))
  487. (build-system perl-build-system)
  488. (native-inputs (list perl-module-build))
  489. (home-page "https://metacpan.org/release/Lingua-EN-Inflect")
  490. (synopsis "Convert singular to plural")
  491. (description "Lingua::EN::Inflect provides plural inflections,
  492. \"a\"/\"an\" selection for English words, and manipulation of numbers as
  493. words. Plural forms of all nouns, most verbs, and some adjectives are
  494. provided. Where appropriate, \"classical\" variants (for example: \"brother\"
  495. -> \"brethren\", \"dogma\" -> \"dogmata\", etc.) are also provided.")
  496. (license license:perl-license)))
  497. (define-public perl-lingua-en-inflect-number
  498. (package
  499. (name "perl-lingua-en-inflect-number")
  500. (version "1.12")
  501. (source
  502. (origin
  503. (method url-fetch)
  504. (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
  505. "Lingua-EN-Inflect-Number-" version ".tar.gz"))
  506. (sha256
  507. (base32
  508. "1gxccynkaqav43ww43jp4rzkyr36x97jd03yb5f6yx0jhn1k7yv6"))))
  509. (build-system perl-build-system)
  510. (propagated-inputs
  511. (list perl-lingua-en-inflect))
  512. (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Number")
  513. (synopsis "Force number of words to singular or plural")
  514. (description "This module extends the functionality of Lingua::EN::Inflect
  515. with three new functions for determining plurality of a word and forcefully
  516. converting a word to singular or plural.")
  517. (license license:perl-license)))
  518. (define-public perl-lingua-en-inflect-phrase
  519. (package
  520. (name "perl-lingua-en-inflect-phrase")
  521. (version "0.20")
  522. (source
  523. (origin
  524. (method url-fetch)
  525. (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
  526. "Lingua-EN-Inflect-Phrase-" version ".tar.gz"))
  527. (sha256
  528. (base32
  529. "1a6y1l2pjim2242wcpgz066di4pbzfgsjjdl7vg5a5wzm48qj1am"))))
  530. (build-system perl-build-system)
  531. (native-inputs
  532. (list perl-test-nowarnings))
  533. (propagated-inputs
  534. (list perl-lingua-en-findnumber perl-lingua-en-inflect
  535. perl-lingua-en-inflect-number perl-lingua-en-number-isordinal
  536. perl-lingua-en-tagger))
  537. (home-page "https://metacpan.org/release/Lingua-EN-Inflect-Phrase")
  538. (synopsis "Inflect short English phrases")
  539. (description "This module attempts to pluralize or singularize short
  540. English phrases.")
  541. (license license:perl-license)))
  542. (define-public perl-lingua-en-number-isordinal
  543. (package
  544. (name "perl-lingua-en-number-isordinal")
  545. (version "0.05")
  546. (source
  547. (origin
  548. (method url-fetch)
  549. (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
  550. "Lingua-EN-Number-IsOrdinal-" version ".tar.gz"))
  551. (sha256
  552. (base32
  553. "1mhqjvh2ad30gjab5b3a6mbr4aysyrscp4wp42yy5x6001a6km98"))))
  554. (build-system perl-build-system)
  555. (native-inputs
  556. (list perl-try-tiny perl-test-fatal))
  557. (propagated-inputs
  558. (list perl-lingua-en-findnumber))
  559. (home-page "https://metacpan.org/release/Lingua-EN-Number-IsOrdinal")
  560. (synopsis "Detect if English number is ordinal or cardinal")
  561. (description "This module will tell you if a number, either in words or as
  562. digits, is a cardinal or ordinal number.")
  563. (license license:perl-license)))
  564. (define-public perl-lingua-en-tagger
  565. (package
  566. (name "perl-lingua-en-tagger")
  567. (version "0.30")
  568. (source
  569. (origin
  570. (method url-fetch)
  571. (uri (string-append "mirror://cpan/authors/id/A/AC/ACOBURN/"
  572. "Lingua-EN-Tagger-" version ".tar.gz"))
  573. (sha256
  574. (base32
  575. "0nrnkvsf9f0a7lp82sanmy89ms2nqq1lvjqicvsagsvzp513bl5b"))))
  576. (build-system perl-build-system)
  577. (propagated-inputs
  578. (list perl-memoize-expirelru perl-lingua-stem perl-html-parser
  579. perl-html-tagset))
  580. (home-page "https://metacpan.org/release/Lingua-EN-Tagger")
  581. (synopsis "Part-of-speech tagger for English natural language processing")
  582. (description "This module is a probability based, corpus-trained tagger
  583. that assigns part-of-speech tags to English text based on a lookup dictionary
  584. and a set of probability values. The tagger assigns appropriate tags based on
  585. conditional probabilities - it examines the preceding tag to determine the
  586. appropriate tag for the current word. Unknown words are classified according
  587. to word morphology or can be set to be treated as nouns or other parts of
  588. speech. The tagger also extracts as many nouns and noun phrases as it can,
  589. using a set of regular expressions.")
  590. (license license:gpl3)))
  591. (define-public perl-lingua-en-words2nums
  592. (package
  593. (name "perl-lingua-en-words2nums")
  594. (version "0.18")
  595. (source
  596. (origin
  597. (method url-fetch)
  598. (uri (string-append "mirror://cpan/authors/id/J/JO/JOEY/"
  599. "Lingua-EN-Words2Nums-" version ".tar.gz"))
  600. (sha256
  601. (base32
  602. "118xx8qr1zbx30psv7ic55w65h15mc1vz6zicshfm96jgiwmcrb8"))))
  603. (build-system perl-build-system)
  604. (home-page "https://metacpan.org/release/Lingua-EN-Words2Nums")
  605. (synopsis "Convert English text to numbers")
  606. (description "This module converts English text into numbers. It supports
  607. both ordinal and cardinal numbers, negative numbers, and very large numbers.")
  608. (license license:perl-license)))
  609. (define-public perl-lingua-pt-stemmer
  610. (package
  611. (name "perl-lingua-pt-stemmer")
  612. (version "0.02")
  613. (source
  614. (origin
  615. (method url-fetch)
  616. (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
  617. "Lingua-PT-Stemmer-" version ".tar.gz"))
  618. (sha256
  619. (base32
  620. "17c48sfbgwd2ivlgf59sr6jdhwa3aim8750f8pyzz7xpi8gz0var"))))
  621. (build-system perl-build-system)
  622. (home-page "https://metacpan.org/release/Lingua-PT-Stemmer")
  623. (synopsis "Portuguese language stemming")
  624. (description "This module implements a Portuguese stemming algorithm
  625. proposed in the paper A Stemming Algorithm for the Portuguese Language by
  626. Moreira, V. and Huyck, C.")
  627. (license license:perl-license)))
  628. (define-public perl-lingua-stem
  629. (package
  630. (name "perl-lingua-stem")
  631. (version "0.84")
  632. (source
  633. (origin
  634. (method url-fetch)
  635. (uri (string-append "mirror://cpan/authors/id/S/SN/SNOWHARE/"
  636. "Lingua-Stem-" version ".tar.gz"))
  637. (sha256
  638. (base32
  639. "12avh2mnnc7llmmshrr5bgb473fvydxnlqrqbl2815mf2dp4pxcg"))))
  640. (build-system perl-build-system)
  641. (native-inputs
  642. (list perl-module-build))
  643. (propagated-inputs
  644. (list perl-lingua-pt-stemmer
  645. perl-lingua-stem-fr
  646. perl-lingua-stem-it
  647. perl-lingua-stem-ru
  648. perl-lingua-stem-snowball-da
  649. perl-snowball-norwegian
  650. perl-snowball-swedish
  651. perl-text-german))
  652. (home-page "https://metacpan.org/release/Lingua-Stem")
  653. (synopsis "Stemming of words in various languages")
  654. (description "This routine applies stemming algorithms to its parameters,
  655. returning the stemmed words as appropriate to the selected locale.")
  656. (license license:perl-license)))
  657. (define-public perl-lingua-stem-fr
  658. (package
  659. (name "perl-lingua-stem-fr")
  660. (version "0.02")
  661. (source
  662. (origin
  663. (method url-fetch)
  664. (uri (string-append "mirror://cpan/authors/id/S/SD/SDP/"
  665. "Lingua-Stem-Fr-" version ".tar.gz"))
  666. (sha256
  667. (base32
  668. "0vyrspwzaqjxm5mqshf4wvwa3938mkajd1918d9ii2l9m2rn8kwx"))))
  669. (build-system perl-build-system)
  670. (home-page "https://metacpan.org/release/Lingua-Stem-Fr")
  671. (synopsis "Porter's stemming algorithm for French")
  672. (description "This module uses a modified version of the Porter Stemming
  673. Algorithm to return a stemmed French word.")
  674. (license license:perl-license)))
  675. (define-public perl-lingua-stem-it
  676. (package
  677. (name "perl-lingua-stem-it")
  678. (version "0.02")
  679. (source
  680. (origin
  681. (method url-fetch)
  682. (uri (string-append "mirror://cpan/authors/id/A/AC/ACALPINI/"
  683. "Lingua-Stem-It-" version ".tar.gz"))
  684. (sha256
  685. (base32
  686. "1207r183s5hlh4mfwa6p46vzm0dhvrs2dnss5s41a0gyfkxp7riq"))))
  687. (build-system perl-build-system)
  688. (home-page "https://metacpan.org/release/Lingua-Stem-It")
  689. (synopsis "Porter's stemming algorithm for Italian")
  690. (description "This module applies the Porter Stemming Algorithm to its
  691. parameters, returning the stemmed Italian word.")
  692. (license license:perl-license)))
  693. (define-public perl-lingua-stem-ru
  694. (package
  695. (name "perl-lingua-stem-ru")
  696. (version "0.04")
  697. (source
  698. (origin
  699. (method url-fetch)
  700. (uri (string-append "mirror://cpan/authors/id/N/NE/NEILB/"
  701. "Lingua-Stem-Ru-" version ".tar.gz"))
  702. (sha256
  703. (base32
  704. "0a2jmdz7jn32qj5hyiw5kbv8fvlpmws8i00a6xcbkzb48yvwww0j"))))
  705. (build-system perl-build-system)
  706. (home-page "https://metacpan.org/release/Lingua-Stem-Ru")
  707. (synopsis "Porter's stemming algorithm for Russian")
  708. (description "This module applies the Porter Stemming Algorithm to its
  709. parameters, returning the stemmed Russian (KOI8-R only) word.")
  710. (license license:perl-license)))
  711. (define-public perl-lingua-stem-snowball-da
  712. (package
  713. (name "perl-lingua-stem-snowball-da")
  714. (version "1.01")
  715. (source
  716. (origin
  717. (method url-fetch)
  718. (uri (string-append "mirror://cpan/authors/id/C/CI/CINE/"
  719. "Lingua-Stem-Snowball-Da-" version ".tar.gz"))
  720. (sha256
  721. (base32
  722. "0mm0m7glm1s6i9f6a78jslw6wh573208arxhq93yriqmw17bwf9f"))))
  723. (build-system perl-build-system)
  724. (home-page "https://metacpan.org/release/Lingua-Stem-Snowball-Da")
  725. (synopsis "Porters stemming algorithm for Danish")
  726. (description "Lingua::Stem::Snowball::Da is a perl port of the danish
  727. stemmer at http://snowball.sourceforge.net, it was originally altered from the
  728. Lingua::Stem::Snowball::Se.")
  729. (license license:gpl2)))
  730. (define-public perl-snowball-norwegian
  731. (package
  732. (name "perl-snowball-norwegian")
  733. (version "1.2")
  734. (source
  735. (origin
  736. (method url-fetch)
  737. (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
  738. "Snowball-Norwegian-" version ".tar.gz"))
  739. (sha256
  740. (base32
  741. "0675v45bbsh7vr7kpf36xs2q79g02iq1kmfw22h20xdk4rzqvkqx"))))
  742. (build-system perl-build-system)
  743. (native-inputs (list perl-module-build))
  744. (home-page "https://metacpan.org/release/Snowball-Norwegian")
  745. (synopsis "Porters stemming algorithm for Norwegian")
  746. (description "Lingua::Stem::Snowball::No is a perl port of the norwegian
  747. stemmer at http://snowball.tartarus.org.")
  748. (license license:perl-license)))
  749. (define-public perl-snowball-swedish
  750. (package
  751. (name "perl-snowball-swedish")
  752. (version "1.2")
  753. (source
  754. (origin
  755. (method url-fetch)
  756. (uri (string-append "mirror://cpan/authors/id/A/AS/ASKSH/"
  757. "Snowball-Swedish-" version ".tar.gz"))
  758. (sha256
  759. (base32
  760. "0agwc12jk5kmabnpsplw3wf4ii5w1zb159cpin44x3srb0sr5apg"))))
  761. (build-system perl-build-system)
  762. (native-inputs (list perl-module-build))
  763. (home-page "https://metacpan.org/release/Snowball-Swedish")
  764. (synopsis "Porters stemming algorithm for Swedish")
  765. (description "Lingua::Stem::Snowball::Se is a perl port of the swedish
  766. stemmer at http://snowball.sourceforge.net.")
  767. (license license:perl-license)))
  768. (define-public perl-string-toidentifier-en
  769. (package
  770. (name "perl-string-toidentifier-en")
  771. (version "0.12")
  772. (source
  773. (origin
  774. (method url-fetch)
  775. (uri (string-append "mirror://cpan/authors/id/R/RK/RKITOVER/"
  776. "String-ToIdentifier-EN-" version ".tar.gz"))
  777. (sha256
  778. (base32
  779. "12nw7h2yiybhdw0vnnpc7bif8ylhsn6kqf6s39dsrf9h54iq9yrs"))))
  780. (build-system perl-build-system)
  781. (propagated-inputs
  782. (list perl-lingua-en-inflect-phrase perl-text-unidecode
  783. perl-namespace-clean))
  784. (home-page "https://metacpan.org/release/String-ToIdentifier-EN")
  785. (synopsis "Convert strings to English program identifiers")
  786. (description "This module provides a utility method, \"to_identifier\" for
  787. converting an arbitrary string into a readable representation using the ASCII
  788. subset of \"\\w\" for use as an identifier in a computer program. The intent
  789. is to make unique identifier names from which the content of the original
  790. string can be easily inferred by a human just by reading the identifier.")
  791. (license license:perl-license)))
  792. (define-public perl-text-german
  793. (package
  794. (name "perl-text-german")
  795. (version "0.06")
  796. (source
  797. (origin
  798. (method url-fetch)
  799. (uri (string-append "mirror://cpan/authors/id/U/UL/ULPFR/"
  800. "Text-German-" version ".tar.gz"))
  801. (sha256
  802. (base32
  803. "1p87pgap99lw0nv62i3ghvsi7yg90lhn8vsa3yqp75rd04clybcj"))))
  804. (build-system perl-build-system)
  805. (home-page "https://metacpan.org/release/Text-German")
  806. (synopsis "German grundform reduction")
  807. (description "This module is a rather incomplete implementation of work
  808. done by Gudrun Putze-Meier.")
  809. (license license:perl-license)))
  810. (define* (tegaki-release-uri proj version
  811. #:optional (ext "tar.gz"))
  812. (string-append "https://github.com/tegaki/tegaki/releases/download"
  813. "/v" version "/" proj "-" version "." ext))
  814. (define remove-pre-compiled-files
  815. (lambda exts
  816. "Return snippet for removing pre-compiled files matching one of the
  817. extensions in EXTS."
  818. `(begin (for-each delete-file
  819. (find-files "."
  820. (lambda (name _)
  821. (any (cut string-suffix? <> name)
  822. (map (cut string-append "." <>)
  823. ',exts)))))
  824. #t)))
  825. ;;; modules required for the above snippet
  826. (define remove-pre-compiled-files-modules
  827. '((guix build utils)
  828. (srfi srfi-1)
  829. (srfi srfi-26)))
  830. (define-public python2-tegaki-wagomu
  831. (package
  832. (name "python2-tegaki-wagomu")
  833. (version "0.3.1")
  834. (source
  835. (origin
  836. (method url-fetch)
  837. (uri (tegaki-release-uri "tegaki-wagomu" version))
  838. (sha256
  839. (base32
  840. "1pzdiq4zy1nyylaj9i6v2h4h0r05klahskzpafpp367p4rysi1x9"))
  841. (modules remove-pre-compiled-files-modules)
  842. (snippet (remove-pre-compiled-files "pyc"))))
  843. (build-system python-build-system)
  844. (arguments
  845. `(#:python ,python-2 ; only Python 2 is supported
  846. #:phases
  847. (modify-phases %standard-phases
  848. (add-after 'unpack 'fix-recognizer
  849. (lambda* (#:key inputs #:allow-other-keys)
  850. ;; fix missing module and function
  851. (substitute* "tegakiwagomu.py"
  852. (("import Results,")
  853. "import ")
  854. (("def _recognize")
  855. "def recognize")
  856. (("Results\\(candidates\\)")
  857. "candidates"))
  858. #t)))))
  859. (inputs
  860. (list glib))
  861. (native-inputs
  862. (list pkg-config swig))
  863. (home-page "https://tegaki.github.io/")
  864. (synopsis
  865. "Chinese and Japanese Handwriting Recognition (Recognition engine)")
  866. (description
  867. "Tegaki is an ongoing project which aims to develop a free and open-source
  868. modern implementation of handwriting recognition software, specifically
  869. designed for Chinese (simplified and traditional) and Japanese, and that is
  870. suitable for both the desktop and mobile devices.")
  871. (license license:gpl2+))) ; all files
  872. (define-public python2-tegaki-python
  873. (package
  874. (inherit python2-tegaki-wagomu)
  875. (name "python2-tegaki-python")
  876. (version "0.3.1")
  877. (source
  878. (origin
  879. (method url-fetch)
  880. (uri (tegaki-release-uri "tegaki-python" version))
  881. (sha256
  882. (base32
  883. "0x93k7pw9nh0ywd97pr8pm7jv3f94nw044i5k0zvzhdpsjqvak7p"))
  884. (modules remove-pre-compiled-files-modules)
  885. (snippet (remove-pre-compiled-files "pyc"))))
  886. (arguments
  887. (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
  888. ((#:phases _)
  889. `(modify-phases %standard-phases
  890. (add-after 'unpack 'pre-configure
  891. (lambda* (#:key inputs #:allow-other-keys)
  892. ;; Always convert string to unicode to avoid the following error
  893. ;; when running "tegaki-build" in python2-tegaki-tools:
  894. ;;
  895. ;; sqlite3.ProgrammingError: You must not use 8-bit bytestrings
  896. ;; unless you use a text_factory that can interpret 8-bit
  897. ;; bytestrings (like text_factory = str).
  898. ;; It is highly recommended that you instead just switch your
  899. ;; application to Unicode strings.
  900. (substitute* "tegaki/charcol.py"
  901. (("sqlite3.OptimizedUnicode")
  902. "lambda s: unicode(s, 'utf-8')"))
  903. (substitute* "tegaki/engine.py"
  904. (("/usr(/local)?")
  905. (assoc-ref inputs "python2-tegaki-wagomu")))
  906. #t))))))
  907. ;; override inherited inputs
  908. (inputs '())
  909. (native-inputs '())
  910. (propagated-inputs
  911. (list python2-tegaki-wagomu python2-zinnia))
  912. (synopsis
  913. "Chinese and Japanese Handwriting Recognition (Base python library)")
  914. (license (list license:gpl2+ ; all files except...
  915. license:bsd-3 ; dictutils.py
  916. license:zpl2.1)))) ; minjson.py
  917. (define-public python2-tegaki-pygtk
  918. (package
  919. (inherit python2-tegaki-wagomu)
  920. (name "python2-tegaki-pygtk")
  921. (version "0.3.1")
  922. (source
  923. (origin
  924. (method url-fetch)
  925. (uri (tegaki-release-uri "tegaki-pygtk" version))
  926. (sha256
  927. (base32
  928. "1cip0azxhjdj2dg2z85cp1z3lz4qwx3w1j7z4xmcm7npapmsaqs2"))
  929. (modules remove-pre-compiled-files-modules)
  930. (snippet (remove-pre-compiled-files "pyc"))))
  931. (arguments
  932. (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
  933. ((#:phases _)
  934. `(modify-phases %standard-phases
  935. (add-after 'unpack 'fix-paths
  936. (lambda* (#:key inputs #:allow-other-keys)
  937. (substitute* "tegakigtk/fakekey.py"
  938. (("libX11.so.6" so)
  939. (search-input-file inputs
  940. (string-append "/lib/" so)))
  941. (("libXtst.so.6" so)
  942. (search-input-file inputs
  943. (string-append "/lib/" so))))))))))
  944. (inputs ; required for sending key strokes
  945. (list libx11 libxtst))
  946. (native-inputs '()) ; override inherited inputs
  947. (propagated-inputs
  948. (list python2-pygtk python2-tegaki-python))
  949. (synopsis "Chinese and Japanese Handwriting Recognition (Base UI library)")
  950. (license license:gpl2+)))
  951. (define-public python2-tegaki-tools
  952. (package
  953. (inherit python2-tegaki-wagomu)
  954. (name "python2-tegaki-tools")
  955. (version "0.3.1")
  956. (source
  957. (origin
  958. (method url-fetch)
  959. (uri (tegaki-release-uri "tegaki-tools" version))
  960. (sha256
  961. (base32
  962. "0xxv97ggh2jgldw3r7y59lv3fhz733r6l7mdn6nh4m0gvb0ja971"))
  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 _) '%standard-phases)))
  968. (inputs
  969. (list python2-tegaki-pygtk))
  970. ;; override inherited inputs
  971. (native-inputs '())
  972. (propagated-inputs '())
  973. (synopsis "Chinese and Japanese Handwriting Recognition (Advanced tools)")
  974. ;; Files in gifenc/ are licensed under gpl3+ while other files are licensed
  975. ;; under gpl2+. Therefore, the combined work is licensed under gpl3+.
  976. (license license:gpl3+)))
  977. (define-public python2-tegaki-recognize
  978. (let ((commit "eceec69fe651d0733c8c8752dae569d2283d0f3c")
  979. (revision "1"))
  980. (package
  981. (inherit python2-tegaki-tools)
  982. (name "python2-tegaki-recognize")
  983. ;; version copied from <https://github.com/tegaki/tegaki/releases>
  984. (version (git-version "0.3.1" revision commit))
  985. (source
  986. (origin
  987. ;; We use GIT-FETCH because 'tegaki-recognize.desktop.in' and
  988. ;; 'tegaki-recognize.in' are missing in the tarball.
  989. (method git-fetch)
  990. (uri (git-reference
  991. (url "https://github.com/tegaki/tegaki")
  992. (commit commit)))
  993. (sha256
  994. (base32
  995. "09mw2if9p885phbgah5f95q3fwy7s5b46qlmpxqyzfcnj6g7afr5"))
  996. (file-name (git-file-name name version))
  997. (modules `((guix build utils)
  998. (ice-9 ftw)
  999. (srfi srfi-26)
  1000. ,@remove-pre-compiled-files-modules))
  1001. (snippet
  1002. `(begin
  1003. ;; remove unnecessary files with potentially different license
  1004. (for-each delete-file-recursively
  1005. (scandir "."
  1006. (negate (cut member <> '("tegaki-recognize"
  1007. "." "..")))))
  1008. ,(remove-pre-compiled-files "pyc")
  1009. #t))))
  1010. (arguments
  1011. (substitute-keyword-arguments (package-arguments python2-tegaki-tools)
  1012. ((#:phases _)
  1013. `(modify-phases %standard-phases
  1014. (add-after 'unpack 'chdir
  1015. (lambda _
  1016. (chdir "tegaki-recognize")
  1017. #t))
  1018. ;; 'setup.py' script does not support one of the Python build
  1019. ;; system's default flags, "--single-version-externally-managed"
  1020. (replace 'install
  1021. (lambda* (#:key outputs #:allow-other-keys)
  1022. (invoke "python" "setup.py" "install"
  1023. (string-append "--prefix=" (assoc-ref outputs "out"))
  1024. "--root=/")
  1025. #t))))))
  1026. (synopsis "Chinese and Japanese Handwriting Recognition (Main program)")
  1027. (license license:gpl2+))))
  1028. (define-public tegaki-zinnia-japanese
  1029. (package
  1030. (inherit python2-tegaki-wagomu)
  1031. (name "tegaki-zinnia-japanese")
  1032. (version "0.3")
  1033. (source
  1034. (origin
  1035. (method url-fetch)
  1036. (uri (tegaki-release-uri name version "zip"))
  1037. (sha256
  1038. (base32
  1039. "1nmg9acxhcqly9gwkyb9m0hpy76fll91ywk4b1q4xms0ajxip1h7"))
  1040. (modules remove-pre-compiled-files-modules)
  1041. (snippet (remove-pre-compiled-files "model"))))
  1042. (build-system gnu-build-system)
  1043. (arguments
  1044. `(#:tests? #f ; no tests
  1045. #:phases
  1046. (modify-phases %standard-phases
  1047. (replace 'configure
  1048. (lambda* (#:key outputs #:allow-other-keys)
  1049. (substitute* "Makefile"
  1050. (("/usr/local")
  1051. (assoc-ref outputs "out")))
  1052. #t)))))
  1053. ;; override inherited inputs
  1054. (inputs '())
  1055. (native-inputs
  1056. (list python2-tegaki-tools))
  1057. (propagated-inputs '())
  1058. (native-search-paths
  1059. (list (search-path-specification
  1060. (variable "TEGAKI_MODEL_PATH")
  1061. (files '("share/tegaki/models")))))
  1062. (synopsis "Chinese and Japanese Handwriting Recognition (Model)")
  1063. (license license:lgpl2.1)))
  1064. (define-public tegaki-zinnia-japanese-light
  1065. (package
  1066. (inherit tegaki-zinnia-japanese)
  1067. (name "tegaki-zinnia-japanese-light")
  1068. (version "0.3")
  1069. (source
  1070. (origin
  1071. (method url-fetch)
  1072. (uri (tegaki-release-uri name version "zip"))
  1073. (sha256
  1074. (base32
  1075. "0x0fs29ylqzxd6xvg51h7rigpbisd7q8v11df425ib2j792yfyf8"))
  1076. (modules remove-pre-compiled-files-modules)
  1077. (snippet (remove-pre-compiled-files "model"))))
  1078. (license license:lgpl2.1)))
  1079. (define-public tegaki-zinnia-japanese-kyoiku
  1080. (package
  1081. (inherit tegaki-zinnia-japanese)
  1082. (name "tegaki-zinnia-japanese-kyoiku")
  1083. (version "0.3")
  1084. (source
  1085. (origin
  1086. (method url-fetch)
  1087. (uri (tegaki-release-uri name version "zip"))
  1088. (sha256
  1089. (base32
  1090. "0am94bcpmbzplxdnwn9gk15sgaizvcfhmv13mk14jjvx3419cvvx"))
  1091. (modules remove-pre-compiled-files-modules)
  1092. (snippet (remove-pre-compiled-files "model"))))
  1093. (license license:lgpl2.1)))
  1094. (define-public tegaki-zinnia-japanese-joyo
  1095. (package
  1096. (inherit tegaki-zinnia-japanese)
  1097. (name "tegaki-zinnia-japanese-joyo")
  1098. (version "0.3")
  1099. (source
  1100. (origin
  1101. (method url-fetch)
  1102. (uri (tegaki-release-uri name version "zip"))
  1103. (sha256
  1104. (base32
  1105. "1v0j40lzdyiz01ayws0b8r7fsdy2mr32658382kz4wyk883wzx2z"))
  1106. (modules remove-pre-compiled-files-modules)
  1107. (snippet (remove-pre-compiled-files "model"))))
  1108. (license license:lgpl2.1)))
  1109. (define-public tegaki-zinnia-simplified-chinese
  1110. (package
  1111. (inherit tegaki-zinnia-japanese)
  1112. (name "tegaki-zinnia-simplified-chinese")
  1113. (version "0.3")
  1114. (source
  1115. (origin
  1116. (method url-fetch)
  1117. (uri (tegaki-release-uri name version "zip"))
  1118. (sha256
  1119. (base32
  1120. "18wq0jccv7lpnrfnzspyc110d6pj2v1i21xcx4fmgzz1lnln3fs5"))
  1121. (modules remove-pre-compiled-files-modules)
  1122. (snippet (remove-pre-compiled-files "model"))))
  1123. (license license:lgpl2.1)))
  1124. (define-public tegaki-zinnia-simplified-chinese-light
  1125. (package
  1126. (inherit tegaki-zinnia-japanese)
  1127. (name "tegaki-zinnia-simplified-chinese-light")
  1128. (version "0.3")
  1129. (source
  1130. (origin
  1131. (method url-fetch)
  1132. (uri (tegaki-release-uri name version "zip"))
  1133. (sha256
  1134. (base32
  1135. "0v24yf0w0p03lb7fyx128a75mwzad166bigvlbrzqnad789qg1sr"))
  1136. (modules remove-pre-compiled-files-modules)
  1137. (snippet (remove-pre-compiled-files "model"))))
  1138. (license license:lgpl2.1)))
  1139. (define-public tegaki-zinnia-traditional-chinese
  1140. (package
  1141. (inherit tegaki-zinnia-japanese)
  1142. (name "tegaki-zinnia-traditional-chinese")
  1143. (version "0.3")
  1144. (source
  1145. (origin
  1146. (method url-fetch)
  1147. (uri (tegaki-release-uri name version "zip"))
  1148. (sha256
  1149. (base32
  1150. "140nlp6hynrai2svs5670jjfw1za6ayflhyj2dl0bzsfgbk3447l"))
  1151. (modules remove-pre-compiled-files-modules)
  1152. (snippet (remove-pre-compiled-files "model"))))
  1153. (license license:lgpl2.1)))
  1154. (define-public tegaki-zinnia-traditional-chinese-light
  1155. (package
  1156. (inherit tegaki-zinnia-japanese)
  1157. (name "tegaki-zinnia-traditional-chinese-light")
  1158. (version "0.3")
  1159. (source
  1160. (origin
  1161. (method url-fetch)
  1162. (uri (tegaki-release-uri name version "zip"))
  1163. (sha256
  1164. (base32
  1165. "1m6yk6a57vs9wg5y50qciwi1ahhmklp2mgsjysbj4mnyzv6yhcr2"))
  1166. (modules remove-pre-compiled-files-modules)
  1167. (snippet (remove-pre-compiled-files "model"))))
  1168. (license license:lgpl2.1)))
  1169. (define-public tegaki-wagomu-japanese
  1170. (package
  1171. (inherit tegaki-zinnia-japanese)
  1172. (name "tegaki-wagomu-japanese")
  1173. (version "0.3")
  1174. (source
  1175. (origin
  1176. (method url-fetch)
  1177. (uri (tegaki-release-uri name version "zip"))
  1178. (sha256
  1179. (base32
  1180. "0flj5id8xwsn7csrrzqz9prdikswnwm2wms0as2vzdpxzph1az4k"))
  1181. (modules remove-pre-compiled-files-modules)
  1182. (snippet (remove-pre-compiled-files "model"))))
  1183. (license license:lgpl2.1)))
  1184. (define-public tegaki-wagomu-japanese-kyoiku
  1185. (package
  1186. (inherit tegaki-zinnia-japanese)
  1187. (name "tegaki-wagomu-japanese-kyoiku")
  1188. (version "0.3")
  1189. (source
  1190. (origin
  1191. (method url-fetch)
  1192. (uri (tegaki-release-uri name version "zip"))
  1193. (sha256
  1194. (base32
  1195. "0v8crfh8rdf6ndp16g52s5jlrrlwh73xp38zjn5i9dlacx8kfqg1"))
  1196. (modules remove-pre-compiled-files-modules)
  1197. (snippet (remove-pre-compiled-files "model"))))
  1198. (license license:lgpl2.1)))
  1199. (define-public tegaki-wagomu-japanese-joyo
  1200. (package
  1201. (inherit tegaki-zinnia-japanese)
  1202. (name "tegaki-wagomu-japanese-joyo")
  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. "0wk8shpr963zp328g991qs6abpnacq4242003m687z2d6yp7nph2"))
  1211. (modules remove-pre-compiled-files-modules)
  1212. (snippet (remove-pre-compiled-files "model"))))
  1213. (license license:lgpl2.1)))
  1214. (define-public tegaki-wagomu-simplified-chinese
  1215. (package
  1216. (inherit tegaki-zinnia-japanese)
  1217. (name "tegaki-wagomu-simplified-chinese")
  1218. (version "0.3")
  1219. (source
  1220. (origin
  1221. (method url-fetch)
  1222. (uri (tegaki-release-uri name version "zip"))
  1223. (sha256
  1224. (base32
  1225. "0wqprynigqxqxv128i1smh81gxvmjj056d9qpznxa3n9f5ymlbj6"))
  1226. (modules remove-pre-compiled-files-modules)
  1227. (snippet (remove-pre-compiled-files "model"))))
  1228. (license license:lgpl2.1)))
  1229. ;;; Upstream does not provide the source for tegaki-wagomu-traditional-chinese.
  1230. ;;; Therefore, we use the source for tegaki-zinnia-traditional-chinese and
  1231. ;;; patch the Makefile accordingly.
  1232. (define-public tegaki-wagomu-traditional-chinese
  1233. (package
  1234. (inherit tegaki-zinnia-traditional-chinese)
  1235. (name "tegaki-wagomu-traditional-chinese")
  1236. (arguments
  1237. (substitute-keyword-arguments
  1238. (package-arguments tegaki-zinnia-traditional-chinese)
  1239. ((#:phases phases '%standard-phases)
  1240. `(modify-phases ,phases
  1241. (replace 'configure
  1242. (lambda args
  1243. (let ((configure (assq-ref ,phases 'configure)))
  1244. (apply configure args))
  1245. (substitute* "Makefile"
  1246. (("zinnia") "wagomu"))
  1247. #t))))))
  1248. (license license:lgpl2.1)))
  1249. (define-public link-grammar
  1250. (package
  1251. (name "link-grammar")
  1252. (version "5.7.0")
  1253. (source (origin
  1254. (method url-fetch)
  1255. (uri (string-append "https://www.abisource.com/downloads/"
  1256. "link-grammar/" version
  1257. "/link-grammar-" version ".tar.gz"))
  1258. (sha256
  1259. (base32
  1260. "0ak1v469k56v3511kxxkxvx1nw6zcxcl0f1kcvc82ffacqbr4y96"))))
  1261. (build-system gnu-build-system)
  1262. (home-page "https://www.abisource.com/projects/link-grammar/")
  1263. (synopsis "Link grammar parser")
  1264. (description "The Link Grammar Parser is a syntactic parser of English,
  1265. Russian, Arabic and Persian (and other languages as well), based on Link
  1266. Grammar, an original theory of syntax and morphology. Given a sentence, the
  1267. system assigns to it a syntactic structure, which consists of a set of
  1268. labelled links connecting pairs of words. The parser also produces a
  1269. \"constituent\" (HPSG style phrase tree) representation of a sentence (showing
  1270. noun phrases, verb phrases, etc.).")
  1271. (license license:bsd-3)))
  1272. (define-public praat
  1273. (package
  1274. (name "praat")
  1275. (version "6.1.30")
  1276. (source (origin
  1277. (method git-fetch)
  1278. (uri (git-reference
  1279. (url "https://github.com/praat/praat")
  1280. (commit (string-append "v" version))))
  1281. (file-name (git-file-name name version))
  1282. (sha256
  1283. (base32
  1284. "1pjfifyv3wjn68l3i2dr83xm75nf2kxvfxrk9qqbmwz58p183jw4"))))
  1285. (build-system gnu-build-system)
  1286. (arguments
  1287. `(#:tests? #f ; no test target
  1288. #:phases
  1289. (modify-phases %standard-phases
  1290. (replace 'configure
  1291. (lambda _
  1292. (copy-file "makefiles/makefile.defs.linux.pulse" "makefile.defs")
  1293. #t))
  1294. (replace 'install
  1295. (lambda* (#:key outputs #:allow-other-keys)
  1296. (let* ((out (assoc-ref outputs "out"))
  1297. (bin (string-append out "/bin")))
  1298. (mkdir-p bin)
  1299. (copy-file "praat" (string-append bin "/praat")))
  1300. #t)))))
  1301. (inputs
  1302. `(("alsa-lib" ,alsa-lib)
  1303. ("gtk" ,gtk+-2)
  1304. ("jack" ,jack-1)
  1305. ("publesaudio" ,pulseaudio)))
  1306. (native-inputs
  1307. (list pkg-config))
  1308. (home-page "https://www.fon.hum.uva.nl/praat/")
  1309. (synopsis "Doing phonetics by computer")
  1310. (description "Praat is a tool to perform phonetics tasks. It can do speech
  1311. analysis (pitch, formant, intensity, ...), speech synthesis, labelling, segmenting
  1312. and manipulation.")
  1313. (license license:gpl2+)))