Packagecom.adobe.linguistics.spelling.framework
Classpublic class ResourceTable
InheritanceResourceTable Inheritance Object
Implements flash.utils.IExternalizable

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

The ResourceTable class contains a table mapping language to the spelling resources. Resources here imply the URL of rule file and dict file to be used for the language.



Public Properties
 PropertyDefined By
  availableLanguages : Vector.<String>
[read-only] A list of languages supported in this ResourceTable
ResourceTable
Public Methods
 MethodDefined By
  
Constructs a new ResourceTable object that performs language to resource mapping.
ResourceTable
  
getResource(language:String):Object
Get the resource for the specified language.
ResourceTable
  
setResource(language:String, resource:Object):void
Set the resource for the specified language.
ResourceTable
Property Detail
availableLanguagesproperty
availableLanguages:Vector.<String>  [read-only]

A list of languages supported in this ResourceTable


Implementation
    public function get availableLanguages():Vector.<String>
Constructor Detail
ResourceTable()Constructor
public function ResourceTable()

Constructs a new ResourceTable object that performs language to resource mapping.

Method Detail
getResource()method
public function getResource(language:String):Object

Get the resource for the specified language.

Parameters

language:String — The language associated with the resource you are looking for.

Returns
Object — An Object that stores the resource file URL(s).

Example
The following code gets and uses the resource for American English language.
         var resource_en_US:Object = SpellingConfiguration.resourceTable.getResource("en_US");
         trace("rule file:" + resource_en_US["rule"] + ", dictionary file:" + resource_en_US.dict);
         
setResource()method 
public function setResource(language:String, resource:Object):void

Set the resource for the specified language.

Parameters

language:String — The language that you want to assign spelling resources to.
 
resource:Object — A Object that behave as an associated array, it contains the path(s) to the resource file(s). For the time being, the only supported resource is hunspell dictionary, which contains a rule file (.aff) and a dictionary file (.dic).


Example
The following code sets the resource for American English language.
         var resourceTable:ResourceTable = new ResourceTable();
         resourceTable.setResource("en_US", {rule:"en_US.aff", dict:"en_US.dic"});