Jump to content

Archived

This topic is now archived and is closed to further replies.

thepip3r

Anyone using PSPELL successfully on Windows Server???

Recommended Posts

If so, if you couldn't mind compressing your Aspell directory in program files and sending it to me through one method or another, i'd greatly appreciate it.  I can't seem to get Pspell to work on my server and the only information I can find is that for Windows Servers, you either have to convert your files from Unix to Dos OR get the apsell directory files from someone on a Windows Server where Pspell is working.  My downloaded a unix2dos win32 converter and ran it against all files in my aspell\dict and aspell\data folders and i still get the same error...

[quote]Warning: pspell_new_config() [function.pspell-new-config]: PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en_US". in E:\war\addBullets.php on line 11[/quote]

I've tried using "en", "en_US", and "en_US.multi" for this function:

[code=php:0]
function spell_check ( $string ) {
$words = preg_split ( '/[\W]+?/', $string );
$misspelled = $return = array ();
/* we use the following (2) functions instead of pspell_new() */
// reset the dictionary path, use ASpell(s) config path
$config = pspell_config_create ( 'en', '', '', 'utf-8' );
  $int = pspell_new_config ( $config );
foreach ( $words as $value ) {
if ( ! pspell_check ( $int, $value )) {
$misspelled[] = $value;
}
}
foreach ( $misspelled as $value ) {
$return[$value] = pspell_suggest ( $int, $value );
}
return $return;
}[/code]

so... any assistance would be greatly appreciated either with suggestions on how to fix OR the source files from someone's working Aspell directory from a Windows server.

Share this post


Link to post
Share on other sites
Let try this one last time

1. uninstall everything relating to aspell (uninstall the dictionries first, then uninstall aspell)
2. make sure you have [b]no[/b] copies of the following files on your system! (use search)

aspell-15.dll
pspell-15.dll

3. Go to >> Start >> Run >> Enter >> regedit >> click OK

4. left window >> HKEY_LOCAL_MACHINE >> SOFTWARE

Delete any key that begins with...

Aspell, (Aspell, Aspell-en) [they shouldn't be there, but were checking in case they were not removed by the uninstall]

5. In the root of your [C:] or the drive you want to install aspell to, create a folder called 'web'

Do not install this into the Programs Files Directory, on the root of the drive you want to install aspell on!

6. Now you should have a directory called...

Example using drive C:

C:/web

7. Download the following files and place them on your desktop...

Program File

http://ftp.gnu.org/gnu/aspell/w32/Aspell-0-50-3-3-Setup.exe

English Dictionary File

http://ftp.gnu.org/gnu/aspell/w32/Aspell-en-0.50-2-3.exe

8. Run [b]Aspell-0-50-3-3-Setup.exe[/b]

A. click Next
B. at the top enter the following path... (if your not using drive C:, change C:, to the drive you are using)

Enter what is below as the path...

[code]c:\web\as[/code]

9. click next (2) times

10.

uncheck (add desktop icon)
uncheck (create send to link)

11. click next
12. click install
13. click next
14. uncheck (view manual)
15 click finish!
16. run the dictionary installer
17. click next (3) times
18. click install
19. click finish

20. Go to >> My Computer >> right click >> scroll down >> Properties >> left click
21. System Properties >> at the top, left click the [b]Advanced[/b] tab
22. left click the [b]Environment Variables...[/b] tab
23. Environment Variables, lower window >> [b]System Variables[/b]

Scroll the lower window and find [b]Variable[/b] >> Path >> left double click

24. Edit system Variables, [b]Variable Value[/b]

Go to the end of the Variable Value Input

If the last character is * ; * < semi-colon, add what is below! (change the drive letter * C * if you installed to a different drive)

[code]c:\web\as\bin;c:\web\as\dict;c:\web\as[/code]

If the last character is [b]not[/b] * ; * < semi-colon, add what is below! (change the drive letter * C * if you installed to a different drive)

[code];c:\web\as\bin;c:\web\as\dict;c:\web\as[/code]

25. left click OK (3) times

copy the the text below and put it in a text file and call it run.bat, and just click on it to run it, follow the directions

[code]@ECHO OFF
NET STOP iisadmin
NET START w3svc[/code]

Then try the pspell script again!





me!

Share this post


Link to post
Share on other sites
followed your instructions to a T and still get the following errors:

[quote]Warning: pspell_new_config() [function.pspell-new-config]: PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en". in E:\war\addBullets.php on line 11

Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13

Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13

Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13

Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13

Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13

Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18

Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18

Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18

Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18

Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18[/quote]

using the following code:
[code=php:0]...
function spell_check ( $string ) {
$words = preg_split ( '/[\W]+?/', $string );
$misspelled = $return = array ();
/* we use the following (2) functions instead of pspell_new() */
// reset the dictionary path, use ASpell(s) config path
$config = pspell_config_create ( 'en', '', '', 'utf-8' );
    $int = pspell_new_config ( $config );
foreach ( $words as $value ) {
if ( ! pspell_check ( $int, $value )) {
$misspelled[] = $value;
}
}
foreach ( $misspelled as $value ) {
$return[$value] = pspell_suggest ( $int, $value );
}
return $return;
}

if (isset($_POST['submit'])) {
$title = $_POST['title'];
$category = $_POST['category'];
$entryDate = $_POST['entryDate'];
$description = $_POST['description'];
$integer = $_POST['integer'];
$increment = $_POST['increment'];

if ($_SESSION['username'] == "my.name") {
spell_check($description);
iterateArray($return);
exit;
}
...[/code]

and also [quote]
Unhandled Error: C:\web\as\dict/en-only.rws: The file "C:\web\as\data/iso8859-1.dat" is not in the proper format.
[/quote]
when I just use pspell_config_create( "en" ) like the php site suggests...

Share this post


Link to post
Share on other sites
I don't understand why that is happening, unless your using some sort of unix to dos program on the files which you don't need to do. I can zip up my install but I don't know if it will help you, but you can try it if you want!

example...

http://www.dinningoutoftown.com/spell.php

view source

http://www.dinningoutoftown.com/spell.php?source=1


me!

Share this post


Link to post
Share on other sites
i have not run the unixtodos program on these new installs and i still get the same errors.  i don't get it either printf  =/.  the only thing left i can try is to have you zip up that directory for me so i can overwrite mine if you don't mind;  it's the only thing left i haven't tried from your suggestions and those of the commentators for the pspell functions on the PHP.net site.  this is so frustrating.  if this doesn't work, i'm going to try your install on a completely seperate server and see if i can get it to work.  thanx again for all of your continued help...

Share this post


Link to post
Share on other sites
I can zip up the install in a minute for you, but I also have a spell checker that I can give you if it doesn't work.

You can try the example here.... (you can't adds words because it's turned off, it's using a sessionless state for the example, but it supports sessions and db user tables)

It also supports  63 different languages... (not ASpell, my own PHP windows extension coded in C++)

http://www.dinningoutoftown.com/spell.php


I'll zip that stuff (ASpell) up in a minute...


me!

Share this post


Link to post
Share on other sites
Just as you thought, it didn't work.  Does your Spell checker have any dependencies?  Either way, do you have a site out there where I can download and test it?  and thanx again printf.

Share this post


Link to post
Share on other sites
Does your Spell checker have any dependencies?

No, if you have PHP, it will run. All you do is upload the scripts and templates, configure the options at the top of loader.php and away you  go. The templates are easy to create, but it comes with 10 different styles already. Plus it has admin panel so you can add or remove (certain bbcodes, words, spell check dictionaries, auto change words, form element names -> (tells it what form elements to spell check)) from the global configuration file. The dictionaries are compressed, 32 languages (latin set) takes 8MB of storage, compared to Aspell 263MB of storage. The extension is loaded into PHP works with PHP 4.2.0^ or PHP 5*.


me!

Share this post


Link to post
Share on other sites
Yes.

I have pspell running on a windows 2003 server with php5.16 and on xp pro running php5.14.

Have you downloaded the data fix as I always has corrupt files when using the downloads. There is a small data zip floating around.

Share this post


Link to post
Share on other sites
printf - sounds awesome.  where can i get it to try it out? 

mjlogan - if you can find that file, i'd appreciate a link for further troubleshooting.

Share this post


Link to post
Share on other sites
Found and attached.

and below is my working code

[code=php:0]
class spell_checker {

  var $personal_path = "C:\Program Files\Aspell\dict";
  var $skip_len = 3;
  var $mode = PSPELL_NORMAL;

  var $pspell_handle;
  var $pspell_cfg_handle;

  function spell_checker($dict = "en", $pconfig = "") {

$pspell_cfg_handle = pspell_config_create($dict);
pspell_config_mode($pspell_cfg_handle, PSPELL_FAST);
$this->pspell_handle = pspell_new_config($pspell_cfg_handle);

  }

  function check($word) {

  return pspell_check($this->pspell_handle, $word);

  }

  function suggest($word) {

      return pspell_suggest($this->pspell_handle, $word);

  }

};




$spell_chk = new spell_checker("en");

$mystr = $string;
$string="";
$words = split("[^[:alpha:]']+", $mystr);

foreach($words as $val) {

if($spell_chk->check($val)) {
//echo " " .$val. " ";
} else {
$string = $string." <a href=\"http://www.answers.com/".$val."\" target=\"_blank\"><font color=\"red\"><u>" .$val. "</u></font></a> ";
}

    }
[/code]

[attachment deleted by admin]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.