#39921 [Opn]: pspell_check returning incorrect results
| From: | php at daniel15 dot com | Date: | Thu, 21 Dec 2006 10:13:53 +0000 |
| Subject: | #39921 [Opn]: pspell_check returning incorrect results | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-106722@lists.php.net to get a copy of this message | ||
ID: 39921
User updated by: php at daniel15 dot com
-Reported By: dansoftaus at yahoo dot com dot au
+Reported By: php at daniel15 dot com
Status: Open
Bug Type: Pspell related
Operating System: GNU/Linux
PHP Version: 4.4.4
New Comment:
Additionally, checking it through the Aspell executable has correct
results:
==========
root@server1:/home/daniel# cat test_words
spel
spell
spelll
speling
spelling
spellling
root@server1:/home/daniel# cat test_words | aspell list
spel
spelll
speling
spellling
root@server1:/home/daniel# aspell -v
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.4)
============
Previous Comments:
------------------------------------------------------------------------
[2006-12-21 10:09:21] php at daniel15 dot com
Description:
------------
OS: Debian GNU/Linux
PHP version: 4.4.4
Aspell version: 0.60.4
Using pspell_check returns incorrect results for some words. For
example, it marks spellling and permanate are being spelt correctly,
and online as being spelt incorrectly
Reproduce code:
---------------
<?php
// Code from
http://www.simplemachines.org/community/index.php?topic=125497.msg802209#msg802209
$pspell_link = pspell_new('en', 'american', '', 'UTF-8',
PSPELL_FAST |
PSPELL_RUN_TOGETHER);
$tests = array(
'spel',
'spell',
'spelll',
'speling',
'spelling',
'spellling',
);
foreach ($tests as $test)
echo $test, '->', pspell_check($pspell_link, $test) ? 'correct' :
'incorrect', '<br />';
?>
Expected result:
----------------
spel->incorrect
spell->correct
spelll->incorrect
speling->incorrect
spelling->correct
spellling->incorrect
Actual result:
--------------
spel->incorrect
spell->correct
spelll->incorrect
speling->incorrect
spelling->correct
spellling->correct
(notice the last result)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39921&edit=1