Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-24-2010, 09:16 PM   PM User | #1
devils19
New to the CF scene

 
Join Date: Dec 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
devils19 is an unknown quantity at this point
How to use PHP pspell_config_repl

I am attempting to do a spell-checker that does the google "is this what you meant" thing. I have this function that I enter a word and I want it to use the replace suggestions from "/dict/replace.txt" but it only gives me suggestions from PHP's built-in dictionary.

What am I doing wrong so that the pspell_config_repl feature isn't working with the pspell_suggest function?

I am using the following code:

PHP Code:
spellCheck("tee");

function 
spellCheck($word) {
    
$p_cfg pspell_config_create("en");
    
pspell_config_personal($p_cfg"/dict/dictionary.txt");
    
pspell_config_repl($p_cfg"/dict/replace.txt");
    
$p_link pspell_new_config($p_cfg);
    
    
$su pspell_suggest($p_link$word);
    if (
$su) {
        
// Return first suggested word
        
return $su[1];
    } else {
        
// Return word
        
return $word;


Last edited by devils19; 12-24-2010 at 09:40 PM..
devils19 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:51 AM.


Advertisement
Log in to turn off these ads.