Packagecom.adobe.linguistics.spelling
Classpublic final class HunspellDictionary
InheritanceHunspellDictionary Inheritance flash.events.EventDispatcher
Implements com.adobe.linguistics.spelling.ISpellingDictionary

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

This class enables creation and loading of spelling metadata including rules and dictionary data



Public Properties
 PropertyDefined By
  enableDictionarySplit : Boolean
This is a flag that enables/disables loading of dictionary in splits.
HunspellDictionary
  loaded : Boolean
[read-only] A flag that indicates if the dictionary has finished loading.
HunspellDictionary
  wordsPerDictionarySplit : int
This property defines the number of words in one dictionary split.
HunspellDictionary
Public Methods
 MethodDefined By
  
Constructs a new HunspellDictionary which can later be used by a SpellChecker object.
HunspellDictionary
  
load(rulesURL:String, dictionaryURL:String):void
Loads a Hunspell dictionary and corresponding rules files as specified by the dictionaryURL and the rulesURL.
HunspellDictionary
Property Detail
enableDictionarySplitproperty
enableDictionarySplit:Boolean

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

This is a flag that enables/disables loading of dictionary in splits. By default this flag is set to false. In case the initial loading time of dictionaries is found slow, this flag should be set to true. By enabling this, squiggly will load dictionary in splits with each split having wordsPerDictionarySplit number of words.

NOTE: This property, if used, should be set before calling HunspellDictionary.load. Once HunspellDictionary.load is called dictionaries will be loaded according to default values, and this property will not be used.


Implementation
    public function get enableDictionarySplit():Boolean
    public function set enableDictionarySplit(value:Boolean):void
loadedproperty 
loaded:Boolean  [read-only]

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

A flag that indicates if the dictionary has finished loading.


Implementation
    public function get loaded():Boolean
wordsPerDictionarySplitproperty 
wordsPerDictionarySplit:int

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

This property defines the number of words in one dictionary split. By default the value of this property is set to 20000 words. This property is used only if enableDictionarySplit is set to true. If enableDictionarySplit is set to flase this property turns void.

NOTE: This property, if used, should be defined before calling HunspellDictionary.load. Once HunspellDictionary.load is called dictionaries will be loaded according to default values, and this property will not be used.


Implementation
    public function get wordsPerDictionarySplit():int
    public function set wordsPerDictionarySplit(value:int):void
Constructor Detail
HunspellDictionary()Constructor
public function HunspellDictionary()

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

Constructs a new HunspellDictionary which can later be used by a SpellChecker object.

Method Detail
load()method
public function load(rulesURL:String, dictionaryURL:String):void

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

Loads a Hunspell dictionary and corresponding rules files as specified by the dictionaryURL and the rulesURL.

The actual loading is done asynchronously and the HunspellDictionary object will dispatch an Event.COMPLETE event. When an error condition occurs, it will dispatch an IOErrorEvent.IO_ERROR event.

Parameters

rulesURL:String — The URL of rule file to be loaded.
 
dictionaryURL:String — The URL of Dictionary file to be loaded.


Example
The following code shows how load API is called to load a Rule and Dictionary file to create a HunspellDictionay.
         private var _newdict:HunspellDictionary = new HunspellDictionary();
         _newdict.load("dictionaries/en_US/en_US.aff", "dictionaries/en_US/en_US.dic");