Print

Print


Kevin,

At my former place of work I did something similar to what you are trying to do.  I never was able to get pspell in PHP to work with the custom dictionary.  As a work-around I used the shell_exec command to run aspell as if from the command line, e.g.,:
$return = shell_exec("cat $temptext | /usr/local/bin/aspell -a -d[custom dictionary file]");

From there you need to parse the $return string.  You can see more details on how this is done at http://chxo.com/scripts/spellcheck.php

Unfortunately, I don't have access to the code that I actually used, but hopefully that will get you started.

Ron Peterson
University of Delaware Library

----- Original Message ----
From: Kevin Kierans <[log in to unmask]>
To: [log in to unmask]
Sent: Tuesday, April 3, 2007 12:40:53 PM
Subject: [CODE4LIB] pspell aspell: make your own word lists/dictionaries

Has anyone created their own "dictionaries"
for aspell?  We've created blank delimited
lists of words from our opac.  One for title,
one for subjects, and one for authors.  (We're thinking
of a series one as well)

We would like to use
one of these word lists to offer suggestions
depending on which search the patron is making.
We're assuming we can make better suggestions
if the words come from our actual opac.

We've got it working with the dictionary that
comes with aspell, but having problems (we can't do it!)
substituting our own  "dictionaries."

Does anyone have any experience/knowledge/hints/pointers
they can share with us?

We are using linux, php 5,  aspell 0.50.5, and
php -> pspell functions.

Thanks,
Kevin
TNRD Library System, Kamloops, British Columbia, Canada