GNU bug report logs - #75063
[PATCH 0/2] Easy configuration of FreeDict into dicod-service-type

Previous Next

Package: guix-patches;

Reported by: Runciter <runciter <at> whispers-vpn.org>

Date: Tue, 24 Dec 2024 12:48:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 75063 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Runciter <runciter <at> whispers-vpn.org>
Cc: 75063 <at> debbugs.gnu.org
Subject: Re: [bug#75063] [PATCH 1/2] gnu: dict: Add symbols to help users
 configure FreeDict with dicod.
Date: Wed, 25 Dec 2024 22:23:48 +0100
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 <at> 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 <at> 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’.




This bug report was last modified 114 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.