all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#75063] [PATCH 0/2] Easy configuration of FreeDict into dicod-service-type
@ 2024-12-24 12:47 Runciter via Guix-patches via
  2024-12-24 13:00 ` [bug#75063] [PATCH 1/2] gnu: dict: Add symbols to help users configure FreeDict with dicod Runciter via Guix-patches via
  2024-12-24 13:00 ` [bug#75063] [PATCH 2/2] doc: add FreeDict dictionaries to dicod configuration example Runciter via Guix-patches via
  0 siblings, 2 replies; 4+ messages in thread
From: Runciter via Guix-patches via @ 2024-12-24 12:47 UTC (permalink / raw)
  To: 75063; +Cc: Runciter

A few weeks my patch for FreeDict multilingual dictionaries for Guix was
integrated to the master branch (bug #74411).

These patches are simple updates to the (gnu services dict) module and to the
Guix info manual to help users configure FreeDict dictionaries into their
local dicod server.

Regards,
Runciter

Runciter (2):
  gnu: dict: Add symbols to help users configure FreeDict with dicod.
  doc: add FreeDict dictionaries to dicod configuration example.

 doc/guix.texi         |   8 ++--
 gnu/services/dict.scm | 107 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 111 insertions(+), 4 deletions(-)


base-commit: 9dc91360fd2e41fb783ab4af341ac60aee2f5d31
-- 
2.46.0






^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#75063] [PATCH 1/2] gnu: dict: Add symbols to help users configure FreeDict with dicod.
  2024-12-24 12:47 [bug#75063] [PATCH 0/2] Easy configuration of FreeDict into dicod-service-type Runciter via Guix-patches via
@ 2024-12-24 13:00 ` Runciter via Guix-patches via
  2024-12-25 21:23   ` Ludovic Courtès
  2024-12-24 13:00 ` [bug#75063] [PATCH 2/2] doc: add FreeDict dictionaries to dicod configuration example Runciter via Guix-patches via
  1 sibling, 1 reply; 4+ messages in thread
From: Runciter via Guix-patches via @ 2024-12-24 13:00 UTC (permalink / raw)
  To: 75063; +Cc: Runciter

* gnu/services/dict.scm: (%dictorg-handler): New variable;
(freedict-dictorg-database): new procedure;
(%freedict-dictorg-databases): new variable.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 gnu/services/dict.scm | 107 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 106 insertions(+), 1 deletion(-)

diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm
index a4e25f5302..39fb38c9c3 100644
--- a/gnu/services/dict.scm
+++ b/gnu/services/dict.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016, 2017, 2018, 2020, 2022, 2023 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017 Huang Ying <huang.ying.caritas@gmail.com>
+;;; Copyright © 2024 Runciter <runciter@whispers-vpn.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -40,7 +41,10 @@ (define-module (gnu services dict)
             dicod-configuration
             dicod-handler
             dicod-database
-            %dicod-database:gcide))
+            %dicod-database:gcide
+            %dictorg-handler
+            freedict-dictorg-database
+            %freedict-dictorg-databases))
 
 \f
 ;;;
@@ -94,6 +98,107 @@ (define %dicod-database:gcide
    (options (list #~(string-append "dbdir=" #$gcide "/share/gcide")
                   #~(string-append "idxdir=" #$%dicod-gcide-index)))))
 
+(define %dictorg-handler
+  (dicod-handler (name "dictorg")
+                 (module "dictorg")
+                 (options (list #~(string-append "dbdir=/")))))
+
+(define (freedict-dictorg-database dict-name)
+  "Return a record of type @code{<dicod-database>} that configures a
+database for the freedict multilingual dictionary named by the string
+DICT-NAME."
+  (dicod-database (name (string-append "freedict-"
+                                       dict-name))
+                  (complex? #t)
+                  (handler "dictorg")
+                  (options (list #~(string-append "database="
+                                                  #$freedict-dictionaries
+                                                  "/share/dictd/"
+                                                  #$dict-name)))))
+
+(define %freedict-dictorg-databases
+  (map freedict-dictorg-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")
-- 
2.46.0






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#75063] [PATCH 2/2] doc: add FreeDict dictionaries to dicod configuration example.
  2024-12-24 12:47 [bug#75063] [PATCH 0/2] Easy configuration of FreeDict into dicod-service-type Runciter via Guix-patches via
  2024-12-24 13:00 ` [bug#75063] [PATCH 1/2] gnu: dict: Add symbols to help users configure FreeDict with dicod Runciter via Guix-patches via
@ 2024-12-24 13:00 ` Runciter via Guix-patches via
  1 sibling, 0 replies; 4+ messages in thread
From: Runciter via Guix-patches via @ 2024-12-24 13:00 UTC (permalink / raw)
  To: 75063; +Cc: Runciter

* doc/guix.texi: (Dictionary Service): Update configuration example.

Signed-off-by: Runciter <runciter@whispers-vpn.org>
---
 doc/guix.texi | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 08ffbc36d7..1a394b91b2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -41158,13 +41158,15 @@ Miscellaneous Services
                       (name "wordnet")
                       (module "wordnet")
                       (options
-                       (list #~(string-append "wnhome=" #$wordnet))))))
-          (databases (list
+                       (list #~(string-append "wnhome=" #$wordnet))))
+                       %dictorg-handler))
+          (databases (cons*
                       (dicod-database
                        (name "wordnet")
                        (complex? #t)
                        (handler "wordnet"))
-                      %dicod-database:gcide))))
+                      %dicod-database:gcide
+                      %freedict-dictorg-databases))))
 @end lisp
 
 @cindex Docker
-- 
2.46.0






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#75063] [PATCH 1/2] gnu: dict: Add symbols to help users configure FreeDict with dicod.
  2024-12-24 13:00 ` [bug#75063] [PATCH 1/2] gnu: dict: Add symbols to help users configure FreeDict with dicod Runciter via Guix-patches via
@ 2024-12-25 21:23   ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2024-12-25 21:23 UTC (permalink / raw)
  To: Runciter; +Cc: 75063

Hi,

Nice!  I recently added FreeDict dictionaries to my own config and was
contemplating the idea of having it properly integrated.  Perfect.  :-)

FWIW, I have:

--8<---------------cut here---------------start------------->8---
(define %freedict-databases
  (map (lambda (dictionary-name)
         (dicod-database
          (name "freedict")
          (handler "dictorg")
          (options
           (list #~(string-append "database="
                                  #$freedict-dictionaries
                                  "/share/dictd/" #$dictionary-name)))))
       '("fra-eng" "eng-fra" "eng-spa" "spa-eng")))
--8<---------------cut here---------------end--------------->8---

and then:

--8<---------------cut here---------------start------------->8---
     (service dicod-service-type
              (dicod-configuration
               (databases (cons %dicod-database:gcide
                                %freedict-databases))))
--8<---------------cut here---------------end--------------->8---

Runciter <runciter@whispers-vpn.org> skribis:

> * gnu/services/dict.scm: (%dictorg-handler): New variable;
> (freedict-dictorg-database): new procedure;
> (%freedict-dictorg-databases): new variable.
>
> Signed-off-by: Runciter <runciter@whispers-vpn.org>

[...]

> +(define %dictorg-handler
> +  (dicod-handler (name "dictorg")
> +                 (module "dictorg")
> +                 (options (list #~(string-append "dbdir=/")))))

I believe we don’t even need that; it’s built-in.

> +(define (freedict-dictorg-database dict-name)
> +  "Return a record of type @code{<dicod-database>} that configures a
> +database for the freedict multilingual dictionary named by the string
> +DICT-NAME."
> +  (dicod-database (name (string-append "freedict-"
> +                                       dict-name))
> +                  (complex? #t)

What does ‘complex?’ do actually?  (Seems to work without it.)

> * doc/guix.texi: (Dictionary Service): Update configuration example.

Could you squash both commits?  In general documentation goes to the
same commit as the change it documents.

> diff --git a/doc/guix.texi b/doc/guix.texi
> index 08ffbc36d7..1a394b91b2 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -41158,13 +41158,15 @@ Miscellaneous Services
>                        (name "wordnet")
>                        (module "wordnet")
>                        (options
> -                       (list #~(string-append "wnhome=" #$wordnet))))))
> -          (databases (list
> +                       (list #~(string-append "wnhome=" #$wordnet))))
> +                       %dictorg-handler))
> +          (databases (cons*
>                        (dicod-database
>                         (name "wordnet")
>                         (complex? #t)
>                         (handler "wordnet"))
> -                      %dicod-database:gcide))))
> +                      %dicod-database:gcide
> +                      %freedict-dictorg-databases))))

Could you also document ‘freedict-dictorg-databases’ and
‘%freedict-dictorg-databases’, similar to how ‘%dicod-database:gcide’ is
documented?

For consistency, perhaps the these should be renamed to
‘dicod-freedict-databases’ and ‘%dicod-database:freedict’.

Thanks in advance,
Ludo’.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-25 21:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-24 12:47 [bug#75063] [PATCH 0/2] Easy configuration of FreeDict into dicod-service-type Runciter via Guix-patches via
2024-12-24 13:00 ` [bug#75063] [PATCH 1/2] gnu: dict: Add symbols to help users configure FreeDict with dicod Runciter via Guix-patches via
2024-12-25 21:23   ` Ludovic Courtès
2024-12-24 13:00 ` [bug#75063] [PATCH 2/2] doc: add FreeDict dictionaries to dicod configuration example Runciter via Guix-patches via

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.