Wintertree Software Inc.

Wintertree Spell Check Applet

Home Site index Contact us Catalog Shopping Cart Products Support Search

Technical details

Click here for more information about Wintertree Spell Check Applet

Summary:

  • Packaging: Java applet in a JAR file

  • JAR file size: 120K
  • Dictionary file size (English): 100,000 words: 320K; 50,000 words: 187K; 25,000 words: 102K
  • Dictionary file location: Server; read by Applet when first spelling check starts.

How to use Spell Check Applet in your forms

When a spelling error is detected, the error is reported to the user, who disposes of the error by, for example, replacing the word with a correctly spelled word, or skipping over the word. Spell Check Applet includes two mechanisms for interacting with the user to dispose of spelling errors: a built-in dialog box, and a pop-up HTML form. You can use either mechanism on your web site.

Regardless of the approach you use, you will need to add a reference to Spell Check Applet to the HTML page containing your form. The reference is made via the <APPLET> tag. The <APPLET> tag specifies the location of Spell Check Applet's JAR file, and defines some parameters.

Spell Check Applet is typically used to check the spelling of text entered by a user in a web-page form. The text could be entered in a text field (single line) or a text area (multi-line). Most likely, the spelling check will be requested by the user, so a "Check Spelling" button is placed on the form (the spelling check could also be done automatically, before the form is submitted to the server, for example).

Using the built-in dialog box

To use Spell Check Applet's built-in dialog box, include a reference to a JavaScript file named SpellCheckApplet.js (which is a file included with the Spell Check Applet software) This file is referenced in an HTML file using the following markup:

<SCRIPT LANGUAGE="JavaScript1.1" SRC="SpellCheckApplet.js"></SCRIPT>

Add a "Check Spelling" button to your form, and set its ONCLICK handler to the onCheckSpelling JavaScript function. Pass a reference to the text area object you want to check as a parameter to this function. For example, if your page contains a form named messageForm with a single text area named body, create your button like this:

<INPUT TYPE=BUTTON NAME="checkSpellingBtn" VALUE="Check Spelling"
ONCLICK="onCheckSpelling(document.messageForm.body);">

Using the pop-up spelling form

To use a pop-up spelling form, include a reference to a JavaScript file named onCheckSpellingBtn.js (which is a file included with the Spell Check Applet software) This file is referenced in an HTML file using the following markup:

<SCRIPT LANGUAGE="JavaScript1.1" SRC="onCheckSpellingBtn.js"></SCRIPT>

Add a "Check Spelling" button to your form, and set its ONCLICK handler to the onCheckSpellingBtn JavaScript function. Pass a reference to the text area object you want to check as a parameter to this function. For example, if your page contains a form named megForm with a single text area named body, create your button like this:

<INPUT TYPE=BUTTON NAME="checkSpellingBtn" VALUE="Check Spelling"
ONCLICK="onCheckSpellingBtn(document.msgForm.body);">

Methods

Methods are the functions called by JavaScript code in your Web forms to perform some action. Although Spell Check Applet includes JavaScript code for easy integration with your web forms, you can call its methods directly for specialized applications.

addToUserDict
Add a word to the user dictionary.

check
The check method checks the spelling of text set via the setText method. If a misspelled word is detected, the check method displays a dialog box which the user interacts with to dispose of the misspelled word. The dialog box contains a context display so the user can see the misspelled word in context. Once the dialog box is displayed, it remains visible until all the text has been checked or the user cancels the spelling check. If the text contains no misspelled words, the dialog box is not displayed. If the correct.tlx dictionary is open, certain misspelled English words will be automatically corrected (i.e., without user intervention). If the user disposes of a misspelled word by clicking the "Add" button in the dialog box, the word will be added to the user dictionary, which can later be retrieved via the getUserDictionary method.

checkText
Obtain the next misspelled word in the text. The return value indicates whether a misspelled word (or other word problem, such as a doubled word) was found or no further misspelled words were detected. It also contains the position of the misspelled word in the text.

getNumMisspelledWords
Obtain the number of misspelled words detected the last time the check method was called. Useful for displaying statistics.

getNumWordsChanged
Obtain the number of words which were replaced in the text the last time the check method was called. Words are replaced in the text when the user clicks the "Change" button in the spelling dialog box, and in some cases are also changed automatically (if the correct.tlx dictionary is open, certain misspelled words will be automatically corrected). Useful for displaying statistics or for determining if the text was changed by the user.

getNumWordsChecked
Obtain the total number of words in the text which were checked for spelling errors the last time the check method was called. Useful for displaying statistics.

getOptions
The getOptions method returns the current option settings. If the setOptions method has not yet been called, the current option settings are defaults. After the setOptions method has been called, the options set by that method are the current options.

getText
Obtain the text which was checked for spelling errors by the check method. After the check method has been called, the text will contain any corrections made by the user.

getUserDictionary
The getUserDictionary method returns the user dictionary represented as a string. Initially, the user dictionary is empty. Words can be added to the user dictionary via the setUserDictionary method. Words are also added if the user clicks the "Add" button in the spelling-checker dialog box.

setOptions
The setOptions method establishes a set of spelling-checker options contained in a bit-mask. The options bit-mask set by the setOptions method will be returned when the getOptions method is next called.

setText
Set the text which will be spell-checked when the check method is called. The text is normally obtained from an HTML text area, but it can be any string.

setUserDictionary
The setUserDictionary method sets the user dictionary used by the spelling checker. Any words contained in the user dictionary will be ignored (skipped over) by the spelling checker. When the setUserDictionary method is called, any words currently in the user dictionary will be replaced by the specified words. The getUserDictionary method can be used to obtain the current contents of the user dictionary.

Click here for more information about Wintertree Spell Check Applet

More information about Spell Check Applet:

 


Home Site index Contact us Catalog Shopping Cart Products Support Search


Copyright © 2015 Wintertree Software Inc.