On Tue, Aug 26, 2008 at 07:21:11PM +0200, Agustin Martin wrote:

> The best way for this kind of things is to file a bug report of the
> appropriate severity. This way the problem gets stored and assigned a bug
> number. I am opening a new one on your behalf. You will receive another copy
> of this mail with the bug number later, as well as Konstantin (whose mail
> bounced yesterday) and squirrelmail maintainers.

Done, Dmitry, to provide feedback, please reply to [EMAIL PROTECTED] I
will read that, no need to cc me, but if you want other interested people to
receive your mails, you will need to explicitly cc them.

If you want to look at the bug history, please see

http://bugs.debian.org/496675

in case people forgets to cc you.

> 
> > While looking at the debian module "dictionaries-common-0.98.10", I
> > wound that squirrelmail spellchecker support is already there, but it
> > supports only ispeel. I have played with a code a bit and added aspell
> > engine support as well (see attached patch). The code might not be
> > perfect, it still does not update the default language. But that is the
> > minor thing still needs to be done...
> 
> I have been looking at the patch and seems that only changes in
> update-dictcommon-aspell and DictionariesCommon::build_squirrelmail_support
> are needed. There is no problem in calling aspell with -w or -T options, if
> present. For compatibility with ispell aspell accepts them, and are silently
> ignored. Also, aspell should work with -d, if the hash name is correctly put
> in the dictionary info file. Otherwise is a bug in the dictionary package.
> 
> Also we are in the middle of a freeze previous to 'lenny' release, so do not
> expect changes soon. Once 'lenny' is released, we will reconsider ispell
> status, and we might even remove it from the archive.
> 
> > The items are also suffixed with engine used (so, for the users to see,
> > when engine is invoked on each call). But it SquirrelSpell interface
> > then is then difficult to localize. Just a matter of taste.
> 
> I do not use squirrelmail, so before including your changes I am
> X-debbugs-cc'ing Debian squirrelmail maintainers. Since changes will show
> up in squirrelmail, I will not add changes in the interface until approved
> by them.

I have been playing a bit with your patch. Please find attached a patch
explaining how are things now in my sandbox. Did not apply changes
related to -w and -T and also did some other minor changes.

Thijs, what do you think about the proposed SquirrelSpell interface?

-- 
Agustin
diff --git a/scripts/Debian/DictionariesCommon.pm.in b/scripts/Debian/DictionariesCommon.pm.in
index 7fd7feb..d80dbc5 100644
--- a/scripts/Debian/DictionariesCommon.pm.in
+++ b/scripts/Debian/DictionariesCommon.pm.in
@@ -438,19 +438,24 @@ sub build_squirrelmail_support {
 # Build support file for squirrelmail with a list of available
 # dictionaries and associated spellchecker calls, in php format.
 # ------------------------------------------------------------------
-  my $class        = "ispell";
-  my $dictionaries = loaddb ($class);
+  my @classes      = ("aspell","ispell");
   my $php          = "<?php\n";
   my @dictlist     = ();
 
   $php .= generate_comment ("### ");
   $php .= "\$SQSPELL_APP = array (\n";
-  foreach ( keys %$dictionaries ){
-    next if m/.*[^a-z]tex[^a-z]/i;            # Discard tex variants
-    my $spellchecker_params =
+
+  foreach my $class (@classes) {
+    my $dictionaries = loaddb ($class);
+    foreach ( keys %$dictionaries ){
+      next if m/.*[^a-z]tex[^a-z]/i;            # Discard tex variants
+      my $spellchecker_params =
 	&dc_get_spellchecker_params($class,$dictionaries->{$_});
-    push @dictlist, qq {  '$_' => 'ispell -a $spellchecker_params'};
+      next unless m/^(\S+)\s+\((.+)\)$/;
+      push @dictlist, qq {  '$2 ($class)' => '$class -a $spellchecker_params'};
+    }
   }
+
   $php .= join(",\n", @dictlist);
   $php .= "\n);\n";
 
diff --git a/scripts/system/update-dictcommon.in b/scripts/system/update-dictcommon.in
index 998e3ae..a029e03 100644
--- a/scripts/system/update-dictcommon.in
+++ b/scripts/system/update-dictcommon.in
@@ -11,6 +11,7 @@ my %locales    = ();
 updatedb ($class);
 build_emacsen_support ();
 build_jed_support ();
+build_squirrelmail_support ();
 
 system ("aspell-autobuildhash") == 0
     or die "Error running aspell-autobuildhash\n";

Reply via email to