Package | com.adobe.linguistics.spelling |
Class | public class SpellChecker |
Inheritance | SpellChecker ![]() |
Implements | com.adobe.linguistics.spelling.ISpellChecker |
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 10 |
This class implements the ISpellChecker
interface.
This class performs spell-checking and generates suggestion lists for misspelled words.
This class does not include any user-interface elements. Use this class if you want to offer
control over how all upper case words are handled or words with numbers are handled, as this
level of control is not offered by the SpellUI class. However, please keep in mind that if
you use this class, you will need to write your own UI.
This class is based on the Hunspell algorithm and works with Hunspell/MySpell dictionaries and corresponding language rules files.
Currently, we support a subset of Hunspell rules(options).
The future of this class is to align as much as possible with existing Hunspell solution both for the algorithms and the content.
In this version, users can also directly load Open-Office dictionaries to HunspellDictionary class and initialize a SpellChecker instance with this HunspellDictionary object. When using this class, the language of use is implied by the dictionary supplied. Please make sure you load the appropriate dictionary based on the language the user selects to input.
Note: In the current implementation, only one main dictionary can be used at a time. In addition, in this version, suggestions for misspelled words do not include words from the user dictionary.
Property | Defined By | ||
---|---|---|---|
ignoreWordWithAllUpperCase : Boolean
This property controls if words in all upper case should be considered as properly spelled or not. | SpellChecker | ||
ignoreWordWithNumber : Boolean
This property controls if words with numbers, such as windows95, should be considered as properly spelled. | SpellChecker |
Method | Defined By | ||
---|---|---|---|
SpellChecker(spellingDictionary:ISpellingDictionary)
Constructs a new SpellChecker object that performs language sensitive spell checking. | SpellChecker | ||
addUserDictionary(userDictionary:UserDictionary):Boolean
Add a user dictionary to the SpellChecker. | SpellChecker | ||
checkWord(word:String):Boolean
Spellchecks a word. | SpellChecker | ||
getSuggestions(word:String):Array
Gets suggestions for a misspelled word. | SpellChecker | ||
removeUserDictionary(userDictionary:UserDictionary):Boolean
Remove a user dictionary from the SpellChecker. | SpellChecker |
ignoreWordWithAllUpperCase | property |
ignoreWordWithAllUpperCase:Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 10 |
This property controls if words in all upper case should be considered as properly spelled or not.
ignoreWordWithAllUpperCase | Description | |
false | Default | Words with all characters in upper case are checked against the dictionary for proper spelling. Example: if |
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 |
public function get ignoreWordWithAllUpperCase():Boolean
public function set ignoreWordWithAllUpperCase(value:Boolean):void
ignoreWordWithNumber | property |
ignoreWordWithNumber:Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 10 |
This property controls if words with numbers, such as windows95, should be considered as properly spelled.
ignoreWordWithNumber | Description | |
false | Default | Any words containing digits are checked for proper spelling. Example: If |
true | Words containing digits are always ignored/skipped regardless of the dictionary. Example: If |
public function get ignoreWordWithNumber():Boolean
public function set ignoreWordWithNumber(value:Boolean):void
SpellChecker | () | Constructor |
public function SpellChecker(spellingDictionary:ISpellingDictionary)
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 10 |
Constructs a new SpellChecker
object that performs language sensitive spell checking.
spellingDictionary:ISpellingDictionary — A ISpellingDictionary interface to be used by this SpellChecker .
For example, you can pass a HunspellDictonary object which already implemented the ISpellingDictionary interface to this constructor.
|
addUserDictionary | () | method |
public function addUserDictionary(userDictionary:UserDictionary):Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 10 |
Add a user dictionary to the SpellChecker.
Parameters
userDictionary:UserDictionary — A UserDictionary object to be added to this SpellChecker .
|
Boolean — true if the operation is successful. false if the operation failed.
|
checkWord | () | method |
public function checkWord(word:String):Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 10 |
Spellchecks a word.
Parameters
word:String — A string containing a word.
Notes:
|
Boolean — true if the word is properly spelled. false if the word is misspelled.
|
getSuggestions | () | method |
public function getSuggestions(word:String):Array
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 10 |
Gets suggestions for a misspelled word.
Parameters
word:String — A string containing a misspelled word.
|
Array — A list of suggestions. Up to ten suggestions may be returned. |
removeUserDictionary | () | method |
public function removeUserDictionary(userDictionary:UserDictionary):Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 10 |
Remove a user dictionary from the SpellChecker.
Parameters
userDictionary:UserDictionary — A UserDictionary object to be removed from this SpellChecker .
|
Boolean — true if the operation is successful. false if the operation failed.
|