Packagecom.adobe.linguistics.spelling.framework
Classpublic class SpellingService
InheritanceSpellingService Inheritance flash.events.EventDispatcher

Language Version : ActionScript 3.0.
Runtime Versions : AIR 1.0, Flash Player 10

The SpellingService provides spell checking features for the specified language. This class makes use of SpellingConfiguration class to dynamically get the language dictionary location. The dictionaries are then loaded and SpellChecker object created based on these dictionaries. SpellingService also caches SpellChecker and dictionary objects for individual languages for efficient reuse.



Public Properties
 PropertyDefined By
  ignoreWordWithAllUpperCase : Boolean
This property controls if words in all upper-case should be considered as properly spelled or not.
SpellingService
  userDictionaries : Vector.<UserDictionary>
[read-only] A Vector of user dictionaries added to this SpellingService.
SpellingService
Public Methods
 MethodDefined By
  
SpellingService(language:String)
Constructs a spelling service object.
SpellingService
  
addUserDictionary(userDictionary:UserDictionary):Boolean
Add a UserDictionary to the SpellingService.
SpellingService
  
checkWord(word:String):Boolean
Check the spelling of a word.
SpellingService
  
getSuggestions(word:String):Vector.<String>
Get the suggestion of a misspelled word.
SpellingService
  
init():void
Initialize the SpellingService.
SpellingService
  
removeUserDictionary(userDictionary:UserDictionary):Boolean
Remove a UserDictionary from the SpellingService.
SpellingService
Property Detail
ignoreWordWithAllUpperCaseproperty
ignoreWordWithAllUpperCase:Boolean

This property controls if words in all upper-case should be considered as properly spelled or not.

ignoreWordWithAllUpperCase Description
falseDefault

Words with all characters in upper case are checked against the dictionary for proper spelling.

Example: if ignoreWordWithAllUpperCase = false, "MISPEL" will be checked for proper spelling.

true 

Any words with all characters in upper case are always considered as properly spelled, no matter whether the word is in the dictionary or not.

Example: if ignoreWordWithAllUpperCase = true, "MISPEL" will be considered as properly spelled.


Implementation
    public function get ignoreWordWithAllUpperCase():Boolean
    public function set ignoreWordWithAllUpperCase(value:Boolean):void
userDictionariesproperty 
userDictionaries:Vector.<UserDictionary>  [read-only]

A Vector of user dictionaries added to this SpellingService.


Implementation
    public function get userDictionaries():Vector.<UserDictionary>

See also

UserDictionary
Constructor Detail
SpellingService()Constructor
public function SpellingService(language:String)

Constructs a spelling service object.

Parameters
language:String — The language used to create a SpellingService.
Method Detail
addUserDictionary()method
public function addUserDictionary(userDictionary:UserDictionary):Boolean

Add a UserDictionary to the SpellingService.

Parameters

userDictionary:UserDictionary — The UserDictionary to be added.

Returns
Boolean — True if the UserDictionary is added successfully, false if any error occurs. An example error scenario: Trying to add a previously added user dictionary.

See also

UserDictionary
checkWord()method 
public function checkWord(word:String):Boolean

Check the spelling of a word.

Parameters

word:String — The word to be checked.

Returns
Boolean — True if the word is correctly spelled, false if it is misspelled.
getSuggestions()method 
public function getSuggestions(word:String):Vector.<String>

Get the suggestion of a misspelled word.

Parameters

word:String — The word to be checked.

Returns
Vector.<String> — A vector containing all suggestions for the misspelled word, ordered by similarity to the original word. Note that if a word is already correctly spelled, an empty Vector is returned.
init()method 
public function init():void

Initialize the SpellingService. Once the initialization is done, an Event.COMPLETE event will be dispatched and the SpellingService is ready to be used.

removeUserDictionary()method 
public function removeUserDictionary(userDictionary:UserDictionary):Boolean

Remove a UserDictionary from the SpellingService.

Parameters

userDictionary:UserDictionary — The UserDictionary to be removed.

Returns
Boolean — True if the UserDictionary is removed successfully, false if any error occurs. An example error scenario: Trying to remove a user dictionary that has not been added previously.

See also

UserDictionary