ASP Spell Check Docs - Server Side Spell Check

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/

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  2. <%option explicit%>
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6. <title>ASPSpellCheck Server Side pell Check Example</title>
  7. </head>
  8. <body>
  9. <!--#include virtual="/ASPSpellCheck/core/asp/ASPSpellClass.asp"-->
  10.  
  11. <!--#include virtual="/ASPSpellCheck/core/settings/default-settings.asp"-->
  12. <%
  13. DIM LicenseKey, SaveToCentralDictionary, objASPSpell
  14.  
  15. Set objASPSpell = ASPSpellObjectProvider.Create("aspspellcheck")
  16.  
  17. objASPSpell.ignoreCaseMistakes =false
  18. objASPSpell.ignoreAllCaps = true
  19. objASPSpell.IgnoreNumeric = true
  20. objASPSpell.IgnoreEmailAddresses = true
  21. objASPSpell.IgnoreWebAddresses = true
  22. objASPSpell.newLineNewSentance = false
  23. objASPSpell.LicenseKey = LicenseKey
  24. objASPSpell.DictionaryPath = "/ASPSpellCheck/dictionaries/"
  25. objASPSpell.AddCustomDictionary("custom.txt")
  26. objASPSpell.AddDictionary("English (International)")
  27. objASPSpell.LoadCustomBannedWords("language-rules/banned-words.txt")
  28.  
  29.  
  30. DIM MyWord, AllDicts, BinSpellCheck, ArrSuggestions
  31. MyWord = "Helllo"
  32.  
  33.  
  34. '''''''''''''''Dictionaries Loaded
  35. AllDicts = objASPSpell.ListDictionaries()
  36. RESPONSE.WRITE "Dictionaries: "&join(AllDicts,",")
  37. RESPONSE.WRITE "<br/>"
  38.  
  39. '''''''''''''''Spellcheck True/False
  40. BinSpellCheck = objASPSpell.SpellCheck(MyWord)
  41. RESPONSE.WRITE "Spellchecking ("&MyWord&") : "&BinSpellCheck
  42. RESPONSE.WRITE "<br/>"
  43.  
  44. '''''''''''''''Suggestions=
  45. ArrSuggestions = objASPSpell.Suggestions(MyWord)
  46. RESPONSE.WRITE "Suggestions: "&join(ArrSuggestions,",")
  47.  
  48.  
  49.  
  50. %>
  51. </body>
  52. </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)