Hi all,

pspell seems to be just the spelling solution for me - but I don't seem to be able to create a custom dictionary - which would make it ideal 😉

Can anyone point me in the right direction?

The example in the manual:

<?php
$pspell_config = pspell_config_create("en");
pspell_config_personal($pspell_config, "d:/tmp/dictionaries/custom.pws");
$pspell_link = pspell_new_config($pspell_config);
?>

Just wont work because:

PSPELL couldn't open the dictionary.
reason: No word lists can be found for the language "en"

Can pspell actually create a personal dictionary or does it just amend an existing one ? If so where can I get a template for one so I can create it and then amend it ???

Please help - its doing my nut!! :queasy:

    Hurrah!

    The custom dictionary now works - is there any way just to use the custom dictionary ???

    For those who want to know heres how i did it:

    //Create the Dictionary
    $pspell_link = pspell_new_personal ("d:/tmp/dictionaries/custom.pws","en", "", "", "", PSPELL_FAST|PSPELL_RUN_TOGETHER);
    
    // Setup the personal dictionary
    $pspell_config = pspell_config_create("en");
    pspell_config_personal($pspell_config, "d:/tmp/dictionaries/custom.pws");
    
    // Add some new words	pspell_add_to_personal($pspell_link,'wibble');
    // Save the wordlist
    pspell_save_wordlist($pspell_link);
    

    When I do a spell check I get suggestions (words) returned that aren't from the personal dictionary - is there a way to only check the personal dictionary ?

      OK - I think I have two options:

      1) Use pspell and create a blank dictionary language then include the custom wordlist to my blank dictionary - so only the custom wordlist would be checked. This way I would have access to all the functionailty.

      Any ideas on how to create a blank dictionary?

      2) Find another spell check method - a php class - can anyone recommend one - which has a decent spell check and suggest algorthim and isn't too slow!

      (I don't ask for much 🙂 )

      Any help gratefully recieved!

        a month later

        I found a way of creating custom wordlists, using aspell on the command line.

        So for those who want to know here is a quick how to:

        1) Ensure you have a base language dictionary (i.e. en for english).
        2) Create a wordlist file (a single word per line (alpha characters only))
        3) use aspell to create the .rws

        aspell --lang=en create master /path_to_dictionary/en_newdictionary.rws < wordlist

        That will create your wordlist rws file.

        4) Create a .multi text file in the same dir as your rws file, so aspell knows what to reference:
        example:

        en_newdictionary.multi

        add en_newdictionary.rws

        All done, now to exclusively use your wordlist use:

        $pspell_link = pspell_new("en_newdictionary");

        All this is in the Aspell manual chapter 5.

          Write a Reply...