php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39921 pspell_check returning incorrect results
Submitted: 2006-12-21 10:09 UTC Modified: 2006-12-21 15:16 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: php at daniel15 dot com Assigned:
Status: Not a bug Package: Pspell related
PHP Version: 4.4.4 OS: GNU/Linux
Private report: No CVE-ID: None
 [2006-12-21 10:09 UTC] 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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-21 10:13 UTC] php at daniel15 dot com
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)
============
 [2006-12-21 15:16 UTC] tony2001@php.net
There is nothing we can do about it as long as pspell/aspell C api returns "1" (which means "correct").
Not PHP problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC