|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2007-03-08 17:13 UTC] david at mytton dot net
 Description: ------------ The personal dictionary does not appear to be used when asking pspell for suggestions. The same result occurs whether or not custom.dict actually exists. E.g. if I change the filename to customdict no error is output and the output is the same. I tried this with the latest php_pspell.dll from http://snaps.php.net/win32/php5.2-win32-200703081530.zip Reproduce code: --------------- <?php $spelling = pspell_new_personal('C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\custom.dict', 'en'); $suggestions = pspell_suggest($spelling, 'bloomsbur'); echo '<pre>'; print_r($suggestions); '</pre>'; ?> custom.dict: personal_ws-1.1 en 1 bloomsbury Expected result: ---------------- Array of suggestions including bloomsbury in the suggestions. Actual result: -------------- bloomsbury is not in the suggestions list: Array ( [0] => blooms bur [1] => blooms-bur [2] => blooms [3] => Bloom's [4] => bloom's [5] => bloomers [6] => Bloomer [7] => bloomer ) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 07:00:01 2025 UTC | 
Works perfectly fine here, on Linux. <?php $spelling = pspell_new_personal('/tmp/.aspell.en.pws', 'en'); $suggestions = pspell_suggest($spelling, 'bloomsbur'); var_dump(print_r($suggestions)); ?> Array ( [0] => blooms bur [1] => blooms-bur [2] => Bloomsbury [3] => bloomsbury <-------- [4] => blooms [5] => Bloom's [6] => bloom's ) bool(true)I tested the code on another XP computer and also on my Linux server, all with PHP 5.2.1 and it doesn't seem to work (even with full permissions). <?php $spelling = pspell_new_personal('/home/site/public_html/custom.dict', 'en'); $suggestions = pspell_suggest($spelling, 'bloomsbur'); echo '<pre>'; print_r($suggestions); '</pre>'; ?> david@server1 [/home/site/public_html]# ls -al ... -rwxrwxrwx 1 site site 32 Mar 10 19:57 custom.dict* ... Output: Array ( [0] => blooms bur [1] => blooms-bur [2] => blooms [3] => Bloom's [4] => bloom's [5] => bloomers [6] => Bloomer [7] => bloomer )