How to setup the webvoyage spellchecker

1. Install Aspell on the server

Download Aspell from http://aspell.net/ then install on to your server

2. Install the Aspell Perl Module

Install Text::Aspell from cpan

3. Create Folders and Files

Create a Folder to store your additional words and replacements files in.
I use the directory /m1/voyager/shared/aspell/ if you want to use a different directory you will have to modify the two perl scripts. 
In the directory you just created make two empty files additionalwords.txt and replacements.txt 
these are the files that editdict.cgi edits directly. 
editdict.cgi will automatically create the .aspell.en.prepl and .aspell.en.pws in the same directory.

3. Add this Javascript code to header.htm

 <!-- Javascript for spell checking -->
 <script src="/spell.js" type="text/javascript"></script>
 
 <script type="text/javascript">
 function updatespelling(){
 if(document.forms[0] != null && document.forms[0].Search_Arg != null &&

 document.forms[0].Search_Arg.value != "")
 {var SearchString = document.forms[0].Search_Arg.value;
 loadFragmentInToElement('/cgi-bin/spell.cgi?words=' + SearchString + '&mode=correct' , 
  'spellcheck');}}
 </script>
Note: Something strange happens when you put the curly braces {} on their own line. 
Which is why I have them on the same line as other code above... 

4. Add/modify this line in /m1/voyager/SITEDB/etc/webvoyage/local/opac.ini

 [Misc_Strings]
 Database_Name=<div class="spellcheck" id="spellcheck">&nbsp;</div>Library:

5. Add this line to footer.htm

<script language='javascript' type='text/javascript'>updatespelling()</script>

6. Copy spell.js to /m1/voyager/SITEDB/webvoyage/html/

5. Copy spell.cgi into /m1/voyager/SITEDB/webvoyage/cgi-bin/

If you find any bugs in the code, or have suggestions for other things this could do. Please feel free to contact me (j.brunskill@waikato.ac.nz).

Back to the spellchecker page


This page was written by James Brunskill (www.jambe.co.nz) in March 2007

Note: The code linked to from this page was developed while James was working for the University of Waikato Library. If for any reason the university would like this page and associated scripts to be removed or moved to a different location, I reserve the right to do so.