Link to home
Start Free TrialLog in
Avatar of faithless1
faithless1

asked on

pspell

Hello,

I'm having a difficult time running this script to remove any words not recognized.

The error I get is: Fatal error: call to undefined function pspell_new() in /home/directory/pspell.php on line 2.

Thank you
      

<?php
$pspell_link = pspell_new("en");
$lines=file('file.txt');
foreach ($lines as $line)
{
        $words=preg_split('/[ \s]+/',trim($line));
        foreach ($words as $word)
        {
                if(pspell_check($pspell_link,$word))
                {
                        echo $word,' ';
                }
        }
        echo "\n";
}
?>
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Fatal error: call to undefined function -- that is pretty unambiguous.  Maybe you want new Pspell() instead?  You do not have a function named pspell in the script and that is why there is an error message.
Avatar of Jagadishwor Dulal
You are calling a function which is not defined. If you have created function in a separate page then include it to this current page to call the function pspell_new("en")
Avatar of zappafan2k2
zappafan2k2

I read the following on php.net
As of php 5.3. Pspell is no longer supported/bundled. Instead you can use the enchant which is bundled by default in 5.3.
http://php.net/manual/en/book.pspell.php

Perhaps pspell is no longer supported by your hosting company?
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of faithless1

ASKER

I wanted to clarify... I'm trying to run this script through the gnome terminal in Ubuntu... I'm not using a server for this and this is not a hosted version. Thank you