[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-devel
Subject:    Re: [SM-DEVEL] squirrelspell and aspell
From:       "Paul Lesniewski" <paul () squirrelmail ! org>
Date:       2008-09-09 7:08:25
Message-ID: 58191e420809090008j7c362e31w6ac2840f8c730726 () mail ! gmail ! com
[Download RAW message or body]

Hello,

> I have found out that squirrelspell support is available in Debian
> dictionaries-common package. So, one has only to benefit from it with
> minor efforts. Please, the attached patch (sqspell_config.php.patch).

The SquirrelMail patch portion of your changes is made against changes
Debian has made to SquirrelMail.  That code is not in our product, so
you'll need to send that Debian's way too.

Cheers,

  Paul


> dictionaries-common.patch I've sent to "dictionaries-common" package
> maintainer.
> 
> With best regards,
> 
> Dmitry
> 
> --- /usr/share/squirrelmail/plugins/squirrelspell/sqspell_config.php.orig       \
>                 2007-05-10 00:00:00.000000000 +0200
> +++ /usr/share/squirrelmail/plugins/squirrelspell/sqspell_config.php    2008-08-23 \
> 11:36:58.291679843 +0200 @@ -67,13 +67,8 @@
> 
> # Debian: if dictionaries-common >= 2.50 is available, detect the
> # installed dictionaries automatically.
> -if ( is_readable ( '/var/cache/dictionaries-common/ispell-dicts-list.txt' ) ) {
> -    $dicts = file( '/var/cache/dictionaries-common/ispell-dicts-list.txt' );
> -    $SQSPELL_APP = array();
> -    foreach ($dicts as $dict) {
> -        preg_match('/(\S+)\s+\((.+)\)/', $dict, $dparts);
> -        $SQSPELL_APP[$dparts[2]] = 'ispell -d ' . $dparts[1] . ' -a';
> -    }
> +if ( is_readable ( '/var/cache/dictionaries-common/sqspell.php' ) ) {
> +    include_once('/var/cache/dictionaries-common/sqspell.php');
> } else {
> $SQSPELL_APP = array('English' => 'ispell -a',
> 'Spanish' => 'ispell -d spanish -a');
> 
> --- /usr/sbin/update-dictcommon-aspell.orig     2008-07-03 19:26:35.000000000 +0200
> +++ /usr/sbin/update-dictcommon-aspell  2008-08-23 11:43:34.453341900 +0200
> @@ -11,6 +11,7 @@
> updatedb ($class);
> build_emacsen_support ();
> build_jed_support ();
> +build_squirrelmail_support ();
> 
> system ("aspell-autobuildhash") == 0
> or die "Error running aspell-autobuildhash\n";
> --- /usr/share/perl5/Debian/DictionariesCommon.pm.orig  2008-07-03 \
>                 19:26:35.000000000 +0200
> +++ /usr/share/perl5/Debian/DictionariesCommon.pm       2008-08-23 \
> 12:19:20.603448553 +0200 @@ -116,25 +116,35 @@
> my $T_option    = "";
> my $ispell_args = "";
> 
> -  $d_option = "-d $language->{'hash-name'}"
> -      if exists $language->{'hash-name'};
> -  $w_option = "-w $language->{'additionalchars'}"
> -      if exists $language->{'additionalchars'};
> +  if ($class eq 'ispell')
> +  {
> +    $d_option = "-d $language->{'hash-name'}"
> +        if exists $language->{'hash-name'};
> +    $w_option = "-w $language->{'additionalchars'}"
> +        if exists $language->{'additionalchars'};
> 
> -  if ( exists $language->{'extended-character-mode'} ){
> -    $T_option =  $language->{'extended-character-mode'};
> -    $T_option =~ s/^~//; # Strip leading ~ from Extended-Character-Mode.
> -    $T_option =  '-T ' . $T_option;
> -  }
> +    if ( exists $language->{'extended-character-mode'} ){
> +      $T_option =  $language->{'extended-character-mode'};
> +      $T_option =~ s/^~//; # Strip leading ~ from Extended-Character-Mode.
> +      $T_option =  '-T ' . $T_option;
> +    }
> 
> -  if ( exists $language->{'ispell-args'} ){
> -    $ispell_args = $language->{'ispell-args'};
> -    foreach ( split('\s+',$ispell_args) ) {
> -      # No d_option if already in $ispell_args
> -      $d_option = "" if /^\-d/;
> +    if ( exists $language->{'ispell-args'} ){
> +      $ispell_args = $language->{'ispell-args'};
> +      foreach ( split('\s+',$ispell_args) ) {
> +        # No d_option if already in $ispell_args
> +        $d_option = "" if /^\-d/;
> +      }
> }
> +
> +    return "$d_option $w_option $T_option $ispell_args";
> }
> -  return "$d_option $w_option $T_option $ispell_args";
> +  elsif ($class eq 'aspell')
> +  {
> +    return "-l $language->{'hash-name'}";
> +  }
> +
> +  return '';
> }
> 
> # ------------------------------------------------------------------
> @@ -438,25 +448,24 @@
> # 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 $php          = "<?php\n";
> +  my @classes      = ("aspell","ispell");
> 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 =
> -       &dc_get_spellchecker_params($class,$dictionaries->{$_});
> -    push @dictlist, qq {  '$_' => 'ispell -a $spellchecker_params'};
> +  foreach my $class (@classes)
> +  {
> +    my $dictionaries = loaddb ($class);
> +       print STDERR "Loading class $class = %{$dictionaries}\n";
> +    foreach ( keys %$dictionaries ){
> +      next if m/.*[^a-z]tex[^a-z]/i;            # Discard tex variants
> +      my $spellchecker_params = \
> &dc_get_spellchecker_params($class,$dictionaries->{$_}); +         next if ! \
> /^(\S+)\s+\((.+)\)$/; +      push @dictlist, qq { '$2 ($class)' => '$class -a \
> $spellchecker_params' }; +    }
> }
> -  $php .= join(",\n", @dictlist);
> -  $php .= "\n);\n";
> 
> open (PHP, "> $cachedir/$squirrelmailsupport")
> or die "Cannot open SquirrelMail cache file";
> -  print PHP $php;
> +  print PHP "<?php\n" . generate_comment ("### ") . "\$SQSPELL_APP = array (\n" . \
> join(",\n", @dictlist) . "\n);\n?>\n"; close PHP;
> }
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> -----
> squirrelmail-devel mailing list
> Posting guidelines: http://squirrelmail.org/postingguidelines
> List address: squirrelmail-devel@lists.sourceforge.net
> List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
> List info (subscribe/unsubscribe/change options): \
> https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-devel@lists.sourceforge.net
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): \
https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic