LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 02-06-2012, 02:52 PM   #1
deathsfriend99
Member
 
Registered: Nov 2007
Distribution: CentOS 5
Posts: 129

Rep: Reputation: 16
SquirrelSpell reports no spelling errors EVER.


Just updated from Debian Etch>Lenny>Squeeze, and something has gone wrong with squirrelspell plugin for squirrelmail. It never reports a spelling error. Here is my sqspell_config.php

Code:
<?php
/**
 * sqspell_config.php -- SquirrelSpell Configuration file.
 *
 * Copyright (c) 1999-2010 The SquirrelMail Project Team
 * Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 * @version $Id: sqspell_config.php 13893 2010-01-25 02:47:41Z pdontthink $
 * @package plugins
 * @subpackage squirrelspell
 */

require_once(SM_PATH . 'functions/prefs.php');

/* Just for poor wretched souls with E_ALL. :) */
global $data_dir;

sqgetGlobalVar('username', $username, SQ_SESSION);

/**
 * Example:
 *
 * $SQSPELL_APP = array( 'american (American English)' => 'ispell -a',
 *                     'spanish (Spanish)' => 'ispell -d spanish -a' );
 * You can replace ispell with aspell keeping the same commandline:
 * $SQSPELL_APP = array( 'american (American English)' => 'aspell -a',
 *                     'spanish (Spanish)' => 'aspell -d spanish -a' );
 */

# Debian: if dictionaries-common >= 2.81.1 is available, detect the
# installed dictionaries automatically, else use the list below.
if ( ! @include('/var/cache/dictionaries-common/sqspell.php') ) {
    $SQSPELL_APP = array('american (American English)' => 'ispell -a',
                 'spanish (Spanish)' => 'ispell -d spanish -a');
}

# Debian: if dictionaries-common >= 2.50 is available, detect the
# default dictionary automatically.
if ( is_readable ( '/etc/dictionaries-common/ispell-default' ) ) {
    $SQSPELL_APP_DEFAULT = file_get_contents ( '/etc/dictionaries-common/ispell-default' );
} else {
    $SQSPELL_APP_DEFAULT = 'american (American English)';
}

$SQSPELL_WORDS_FILE = 
   getHashedFile($username, $data_dir, "$username.words");

$SQSPELL_EREG = 'ereg';
/var/log/mail.err gives:
Code:
PHP Notice:  Undefined index: American English in /usr/share/squirrelmail/plugins/squirrelspell/modules/check_me.mod on line 81, referer: https://mail.mydomain.com/plugins/squirrelspell/sqspell_interface.php
contents of /var/cache/dictionaries-common/sqspell.php
Code:
<?php
### This file is part of the dictionaries-common package.
### It has been automatically generated.
### DO NOT EDIT!
$SQSPELL_APP = array (
  'American English (aspell)' => 'aspell -a -d en_US   ',
  'American English (ispell)' => 'ispell -a    -B -d american',
  'British English (aspell)' => 'aspell -a -d en_GB   ',
  'British English (ispell)' => 'ispell -a    -B -d british',
  'Canadian English (aspell)' => 'aspell -a -d en_CA   ',
  'English (aspell)' => 'aspell -a -d en   '
);
Has the syntax changed?
 
Old 02-07-2012, 07:47 AM   #2
humbry
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Rep: Reputation: Disabled
In the first file you showed, you have this:

Code:
$SQSPELL_APP = array('american (American English)' => 'ispell -a',
                 'spanish (Spanish)' => 'ispell -d spanish -a');
The error says this:

Code:
PHP Notice:  Undefined index: American English in /usr/share/squirrelmail/plugins/squirrelspell/modules/check_me.mod on line 81
I would guess that in the file /usr/share/squirrelmail/plugins/squirrelspell/modules/check_me.mod on line 81 you'll find something with this in it:

Code:
$SQSPELL_APP['American English']
or a variable inside of $SQSPELL_APP[] that is defined as 'American English'

So you just have to make them agree. Either change your configuration file to say "American English" or change the way it's being used. So that it looks for "american (American English)".

i don't know about that cache file you showed. maybe you can rename it (don't just delete) and test to see if it is caching stuff and confusing the matter.
 
Old 02-07-2012, 12:52 PM   #3
deathsfriend99
Member
 
Registered: Nov 2007
Distribution: CentOS 5
Posts: 129

Original Poster
Rep: Reputation: 16
Bah! I forgot to post contents of check_me.mod Here is line 81:
Code:
/**
 * Define the command used to spellcheck the document.
 */
$sqspell_command=$SQSPELL_APP[$sqspell_use_app];
Still not sure where this gets me.
 
Old 02-07-2012, 04:19 PM   #4
humbry
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Rep: Reputation: Disabled
Yeah, so somehow $sqspell_use_app gets defined as "American English" when you are using the software. But the dictionary choices seem to be as defined in the /var/cache file:

'American English (aspell)'
'American English (ispell)'
'British English (aspell)'
'British English (ispell)'
'Canadian English (aspell)'
'English (aspell)'

So where do you make your dictionary selection? Where is $sqspell_use_app defined?

Maybe it's something that was in your preferences from before and it's just a matter of a broken upgrade that's out of sync with your old preferences. Try going in your user account and re-selecting your dictionary or just clear out the user preference value.

On the other hand, do you have any dictionary preferences set up? I see a variable in the config file called $SQSPELL_APP_DEFAULT, maybe it's outta sync. Show the file "/etc/dictionaries-common/ispell-default" what does it have?
 
Old 02-07-2012, 09:29 PM   #5
deathsfriend99
Member
 
Registered: Nov 2007
Distribution: CentOS 5
Posts: 129

Original Poster
Rep: Reputation: 16
I can't find where $sqspell_use_app is defined, but it is apparently pulling "American English" out of somewhere.

/etc/dictionaries-common/ispell-default:
Code:
american (American English)
So I can set my own dictionary and spell check appears to work correctly. Somehow the default is not setting for all users properly.
 
Old 02-08-2012, 02:26 AM   #6
humbry
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Rep: Reputation: Disabled
So my guess is that you have old preferences saved with the old dictionary name "American English". You should check if that's true and clear it out. Only other cause I can think of is something else in the code that sets that value wrong. You can grep for it in the source with something like

grep -r 'American English' *

You'll have to look through the results and find the places it only has those words in quotes and nothing else.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to get Squirrelspell plugin to work KPryor Linux - Server 8 06-22-2011 05:17 PM
Iwconfig reports many errors jimmyd1 Linux - Networking 8 04-17-2010 12:12 AM
Bash Reports Scripting Errors Where There Are None des_a Programming 3 03-28-2007 02:26 AM
[DNS->Experts] Need help setting them up, reports show many errors Aziz Linux - Networking 5 10-06-2004 03:49 PM
Gimp-1.2.3 'make' reports syntax errors GabeF Linux - Software 2 06-11-2003 08:29 PM


All times are GMT -5. The time now is 09:54 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration