Server Side Spell Checking with ASPSpellCheck
ASP Spell Check allows you to perform 'behind the scenes' spellchecking using the classes in the file: /ASPSpellCheck/core/asp/ASPSpellClass.asp
This may be useful in developing advanced custom features in your own application. The API has been left in a highly optimized state designed for advanced developers who need exceptional performance.
Example
Found as example 10 in /ASPSpellCheck/examples/
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%option explicit%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ASPSpellCheck Server Side pell Check Example</title>
</head>
<body>
<!--#include virtual="/ASPSpellCheck/core/asp/ASPSpellClass.asp"-->
<!--#include virtual="/ASPSpellCheck/core/settings/default-settings.asp"-->
<%
DIM LicenseKey, SaveToCentralDictionary, objASPSpell
Set objASPSpell = ASPSpellObjectProvider.Create("aspspellcheck")
objASPSpell.ignoreCaseMistakes =false
objASPSpell.ignoreAllCaps = true
objASPSpell.IgnoreNumeric = true
objASPSpell.IgnoreEmailAddresses = true
objASPSpell.IgnoreWebAddresses = true
objASPSpell.newLineNewSentance = false
objASPSpell.LicenseKey = LicenseKey
objASPSpell.DictionaryPath = "/ASPSpellCheck/dictionaries/"
objASPSpell.AddCustomDictionary("custom.txt")
objASPSpell.AddDictionary("English (International)")
objASPSpell.LoadCustomBannedWords("language-rules/banned-words.txt")
DIM MyWord, AllDicts, BinSpellCheck, ArrSuggestions
MyWord = "Helllo"
'''''''''''''''Dictionaries Loaded
AllDicts = objASPSpell.ListDictionaries()
RESPONSE.WRITE "Dictionaries: "&join(AllDicts,",")
RESPONSE.WRITE "<br/>"
'''''''''''''''Spellcheck True/False
BinSpellCheck = objASPSpell.SpellCheck(MyWord)
RESPONSE.WRITE "Spellchecking ("&MyWord&") : "&BinSpellCheck
RESPONSE.WRITE "<br/>"
'''''''''''''''Suggestions=
ArrSuggestions = objASPSpell.Suggestions(MyWord)
RESPONSE.WRITE "Suggestions: "&join(ArrSuggestions,",")
%>
</body>
</html>
Instantiate
The following line creates an instance of the spellchecking object
Set objASPSpell = ASPSpellObjectProvider.Create("aspspellcheck")
Setup
The following lines creates set its basic properties. Note that LicenseKey has been retrieved from /ASPSpellCheck/core/settings/default-settings.asp
objASPSpell.ignoreCaseMistakes =false
objASPSpell.ignoreAllCaps = true
objASPSpell.IgnoreNumeric = true
objASPSpell.IgnoreEmailAddresses = true
objASPSpell.IgnoreWebAddresses = true
objASPSpell.newLineNewSentance = false
objASPSpell.LicenseKey = LicenseKey
objASPSpell.DictionaryPath = "/ASPSpellCheck/dictionaries/"
objASPSpell.AddCustomDictionary("custom.txt")
objASPSpell.AddDictionary("English (International)")
objASPSpell.LoadCustomBannedWords("language-rules/banned-words.txt")
List All Live dictionaries
The following line lists all installed dictionaries as an array
AllDicts = objASPSpell.ListDictionaries()
Spellcheck
The following line spellchecks a word and returns true or false
BinSpellCheck = objASPSpell.SpellCheck(MyWord)
Suggestions
The following line provides n array of spellchcking suggestions for a word
ArrSuggestions = objASPSpell.Suggestions(MyWord)