OpenBD Wiki

From OpenBD
Jump to: navigation, search

SpellCheck()

This function performs a spell check on the given text and using the specified dictionaries to compare spelling against.

Contents

Parameters

SpellCheck( textToCheck, dictionariesToUse )

  • textToCheck: A string to run the spell check on
  • dictionariesToUse: A string list or array of registered dictionary names that are to be used in this spell check

Returns

Returns an array of structures. With each structure representing one possibly mistaken word in the form of:

  • originalWord: The original word that has been detected as a possible mistake.
  • positionIndex: The first character position of the original word.
  • suggestedWords: An array of strings to be considered as possible replacements for the mispelled word.

Example

Spell check a text string using listed dictionary name input:

<cfset results = SpellCheck( "Hi please spell check this text!", "english-custom, english-us" )>

Spell check a text string using an array of dictionary name input:

<cfset useTheseDictionaries = arrayNew(1)>
<cfset useTheseDictionaries[1] = "english-custom">
<cfset results = SpellCheck( "Hi please spell check this text!", useTheseDictionaries )>

Engine Compatibility

  • OpenBD

Personal tools