summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorRunciter <[email protected]>2025-01-09 14:14:31 +0000
committerLudovic Courtès <[email protected]>2025-01-26 22:09:28 +0100
commita47bbf6965283562e086393f357e5519379bccef (patch)
tree7a7917d454ce91bcac0369092834afc50cf8cf1f /gnu/services
parent4fa122bc4d3ccdca5b4613c3d700558c4af593fe (diff)
services: dico: Add symbols to help users configure FreeDict with dicod.
* gnu/services/dict.scm: (dicod-freedict-database): New procedure; (%dicod-databases:freedict): new variable. * doc/guix.texi (Dictionary Service): Document them. Signed-off-by: Runciter <[email protected]> Signed-off-by: Ludovic Courtès <[email protected]> Change-Id: Id5b20e235b988953a66e0344872d1fa165c4c773
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/dict.scm100
1 files changed, 99 insertions, 1 deletions
diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm
index a4e25f5302..fef8915439 100644
--- a/gnu/services/dict.scm
+++ b/gnu/services/dict.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2016 Sou Bunnbu <[email protected]>
;;; Copyright © 2016, 2017, 2018, 2020, 2022, 2023 Ludovic Courtès <[email protected]>
;;; Copyright © 2017 Huang Ying <[email protected]>
+;;; Copyright © 2024 Runciter <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -40,7 +41,9 @@
dicod-configuration
dicod-handler
dicod-database
- %dicod-database:gcide))
+ %dicod-database:gcide
+ dicod-freedict-database
+ %dicod-databases:freedict))
;;;
@@ -94,6 +97,101 @@
(options (list #~(string-append "dbdir=" #$gcide "/share/gcide")
#~(string-append "idxdir=" #$%dicod-gcide-index)))))
+(define (dicod-freedict-database dictionary-name)
+ "Returns a record of type @code{dicod-database} for purpose of configuring a
+database for the FreeDict multilingual dictionary named by the string
+@var{dictionary-name} into a service of type @code{dicod-service-type}."
+ (dicod-database (name (string-append "freedict-"
+ dictionary-name))
+ (handler "dictorg")
+ (options (list #~(string-append "database="
+ #$freedict-dictionaries
+ "/share/dictd/"
+ #$dictionary-name)))))
+
+(define %dicod-databases:freedict
+ (map dicod-freedict-database (list "afr-deu"
+ "afr-eng"
+ "ara-eng"
+ "bre-fra"
+ "ces-eng"
+ "ckb-kmr"
+ "cym-eng"
+ "dan-eng"
+ "deu-ita"
+ "deu-kur"
+ "deu-nld"
+ "deu-por"
+ "deu-tur"
+ "eng-afr"
+ "eng-ara"
+ "eng-ces"
+ "eng-cym"
+ "eng-dan"
+ "eng-ell"
+ "eng-fra"
+ "eng-gle"
+ "eng-hin"
+ "eng-hrv"
+ "eng-hun"
+ "eng-ita"
+ "eng-lat"
+ "eng-lit"
+ "eng-nld"
+ "eng-pol"
+ "eng-por"
+ "eng-rom"
+ "eng-rus"
+ "eng-spa"
+ "eng-srp"
+ "eng-swh"
+ "eng-tur"
+ "fra-bre"
+ "fra-eng"
+ "fra-nld"
+ "gla-deu"
+ "gle-eng"
+ "gle-pol"
+ "hrv-eng"
+ "hun-eng"
+ "isl-eng"
+ "ita-deu"
+ "ita-eng"
+ "jpn-deu"
+ "jpn-eng"
+ "jpn-fra"
+ "jpn-rus"
+ "kha-deu"
+ "kha-eng"
+ "kur-deu"
+ "kur-eng"
+ "kur-tur"
+ "lat-deu"
+ "lat-eng"
+ "lit-eng"
+ "mkd-bul"
+ "nld-deu"
+ "nld-eng"
+ "nld-fra"
+ "nno-nob"
+ "oci-cat"
+ "pol-gle"
+ "por-deu"
+ "por-eng"
+ "san-deu"
+ "slk-eng"
+ "slv-eng"
+ "spa-ast"
+ "spa-eng"
+ "spa-por"
+ "srp-eng"
+ "swe-eng"
+ "swh-eng"
+ "swh-pol"
+ "tur-deu"
+ "tur-eng"
+ "wol-fra")))
+
(define %dicod-accounts
(list (user-group
(name "dicod")