Jump to content


Photo

Anyone using PSPELL successfully on Windows Server???


  • Please log in to reply
11 replies to this topic

#1 thepip3r

thepip3r
  • Members
  • PipPipPip
  • Advanced Member
  • 289 posts

Posted 06 October 2006 - 07:19 PM

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...

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


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

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;
}

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.

#2 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 06 October 2006 - 11:14 PM

Let try this one last time

1. uninstall everything relating to aspell (uninstall the dictionries first, then uninstall aspell)
2. make sure you have no 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/g...0-3-3-Setup.exe

English Dictionary File

http://ftp.gnu.org/g...en-0.50-2-3.exe

8. Run Aspell-0-50-3-3-Setup.exe

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...

c:\web\as

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 Advanced tab
22. left click the Environment Variables... tab
23. Environment Variables, lower window >> System Variables

Scroll the lower window and find Variable >> Path >> left double click

24. Edit system Variables, Variable Value

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)

c:\web\as\bin;c:\web\as\dict;c:\web\as

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

;c:\web\as\bin;c:\web\as\dict;c:\web\as

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

@ECHO OFF
NET STOP iisadmin
NET START w3svc

Then try the pspell script again!





me!

#3 thepip3r

thepip3r
  • Members
  • PipPipPip
  • Advanced Member
  • 289 posts

Posted 10 October 2006 - 10:14 PM

followed your instructions to a T and still get the following errors:

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


using the following code:
...
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;
	}
...

and also

Unhandled Error: C:\web\as\dict/en-only.rws: The file "C:\web\as\data/iso8859-1.dat" is not in the proper format.

when I just use pspell_config_create( "en" ) like the php site suggests...

#4 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 10 October 2006 - 10:35 PM

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.dinningou...n.com/spell.php

view source

http://www.dinningou...ll.php?source=1


me!



#5 thepip3r

thepip3r
  • Members
  • PipPipPip
  • Advanced Member
  • 289 posts

Posted 10 October 2006 - 10:43 PM

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...

#6 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 10 October 2006 - 11:05 PM

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.dinningou...n.com/spell.php


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


me!

#7 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 10 October 2006 - 11:20 PM

ASpell zipped....

http://www.dinningoutoftown.com/as.zip


me!

#8 thepip3r

thepip3r
  • Members
  • PipPipPip
  • Advanced Member
  • 289 posts

Posted 11 October 2006 - 03:49 PM

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.

#9 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 11 October 2006 - 04:23 PM

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!

#10 mjlogan

mjlogan
  • Members
  • PipPipPip
  • Advanced Member
  • 122 posts

Posted 11 October 2006 - 04:26 PM

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.

#11 thepip3r

thepip3r
  • Members
  • PipPipPip
  • Advanced Member
  • 289 posts

Posted 11 October 2006 - 05:18 PM

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.

#12 mjlogan

mjlogan
  • Members
  • PipPipPip
  • Advanced Member
  • 122 posts

Posted 12 October 2006 - 09:19 AM

Found and attached.

and below is my working code

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> ";
		}

    }

[attachment deleted by admin]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users