flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [18/18] git commit: [flex-utilities] [refs/heads/develop] - Squiggly spell checker donation from Adobe Systems Inc.
Date Fri, 25 Apr 2014 05:27:23 GMT
Squiggly spell checker donation from Adobe Systems Inc.


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/a52655ac
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/a52655ac
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/a52655ac

Branch: refs/heads/develop
Commit: a52655acc312c73c97f7900e0f5ce2adaaa760cc
Parents: e3d2737
Author: Alex Harui <aharui@apache.org>
Authored: Thu Apr 24 22:25:34 2014 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Apr 24 22:26:52 2014 -0700

----------------------------------------------------------------------
 .../src/SquigglyTLFExample.as                   |    44 +
 .../src/UserDictionaryExample-app.xml           |   153 +
 .../src/UserDictionaryExample.mxml              |   126 +
 .../Examples/Flex/CheckWord/src/CheckWord.mxml  |    47 +
 .../Flex/ConfigExample/src/ConfigExample.mxml   |    61 +
 .../locale/en_US/SquigglyContextMenu.properties |    23 +
 .../locale/es_ES/SquigglyContextMenu.properties |    23 +
 .../src/ContextMenuWithResource.mxml            |    60 +
 .../src/CustomContextMenu.mxml                  |    40 +
 .../Flex/GetSuggestion/src/GetSuggestion.mxml   |    60 +
 .../src/SpellingServiceEsg.mxml                 |    80 +
 .../src/SquigglyUIExample.mxml                  |    40 +
 .../Flex/TextEditor/src/TextEditor.mxml         |    61 +
 Squiggly/ane/Examples/HowToUseExamples.txt      |    34 +
 .../HunspellNativeExtension/EncConv.cpp         |   294 +
 .../HunspellNativeExtension/EncConv.h           |    59 +
 .../English.lproj/InfoPlist.strings             |     2 +
 .../HunspellNativeExtension/Exported_Sym_FIle   |     4 +
 .../HunspellNativeExtension.cpp                 |   368 +
 .../HunspellNativeExtension.h                   |    37 +
 .../project-sve.pbxproj                         |   329 +
 .../project.pbxproj                             |   428 +
 .../contents.xcworkspacedata                    |    25 +
 .../HunspellNativeExtension/Info.plist          |    46 +
 .../HunspellNativeExtension/Utilities.cpp       |    20 +
 .../HunspellNativeExtension/Utilities.h         |    41 +
 .../HunspellNativeExtension/create_fw.sh        |    39 +
 Squiggly/ane/README.txt                         |    28 +
 Squiggly/ane/SWCandANE/build.properties         |    32 +
 Squiggly/ane/SWCandANE/build.xml                |   210 +
 Squiggly/ane/SWCandANE/create_ane.sh            |    68 +
 Squiggly/ane/SWCandANE/create_swc.sh            |    38 +
 .../ane/SWCandANE/extensions/src/extension.xml  |    38 +
 .../src/HunspellNativeExtensionWorkflow-app.xml |   244 +
 .../src/HunspellNativeExtensionWorkflow.mxml    |   123 +
 .../extensions/HunspellNativeExtension.as       |   128 +
 .../com/adobe/linguistics/utils/ITokenizer.as   |    82 +
 .../com/adobe/linguistics/utils/TextFilter.as   |    90 +
 .../adobe/linguistics/utils/TextTokenizer.as    |   400 +
 .../src/com/adobe/linguistics/utils/Token.as    |    95 +
 .../linguistics/spelling/UserDictionary.as      |   173 +
 .../spelling/UserDictionaryInternal.as          |   120 +
 .../spelling/core/UserDictionaryEngine.as       |    75 +
 .../linguistics/spelling/utils/WordList.as      |   128 +
 .../AdobeSpellingFramework/asdocgen.bat         |    18 +
 .../spelling/framework/ResourceTable.as         |   143 +
 .../spelling/framework/SpellingConfiguration.as |   103 +
 .../spelling/framework/SpellingService.as       |   223 +
 .../spelling/framework/UserDictionaryV.as       |   113 +
 .../adobe/linguistics/spelling/SpellUIForTLF.as |   597 +
 .../linguistics/spelling/ui/IHighlighter.as     |    67 +
 .../linguistics/spelling/ui/IWordProcessor.as   |    32 +
 .../linguistics/spelling/ui/TLFHighlighter.as   |   252 +
 .../linguistics/spelling/ui/TLFWordProcessor.as |   164 +
 .../Squiggly/Demo/SimpleEditor/SimpleText.xml   |    23 +
 .../SimpleEditor/src/AdobeSpellingConfig.xml    |    22 +
 .../SimpleEditor/src/MyContainerController.as   |   300 +
 .../Demo/SimpleEditor/src/SimpleEditor-app.xml  |   253 +
 .../Demo/SimpleEditor/src/SimpleEditor.mxml     |    82 +
 .../SimpleEditor/src/SimpleEditorPanel.mxml     |   393 +
 Squiggly/ane/Squiggly/build.xml                 |   131 +
 .../HunspellNativeExtension.sln                 |    26 +
 .../HunspellNativeExtension/CharConv.cpp        |   130 +
 .../HunspellNativeExtension/CharConv.h          |    71 +
 .../HunspellNativeExtension/EncConv.cpp         |   281 +
 .../HunspellNativeExtension/EncConv.h           |    56 +
 .../HunspellNativeExtension.cpp                 |   334 +
 .../HunspellNativeExtension.h                   |    54 +
 .../HunspellNativeExtension.vcxproj             |   194 +
 .../HunspellNativeExtension/resource.h          |    22 +
 .../HunspellNativeExtension/win/Utilities.h     |   118 +
 Squiggly/ane/build.xml                          |    31 +
 .../src/SquigglyTLFExample.as                   |    59 +
 .../src/UserDictionaryExample-app.xml           |   153 +
 .../src/UserDictionaryExample.mxml              |   132 +
 .../Examples/Flex/CheckWord/src/CheckWord.mxml  |    68 +
 .../Flex/ConfigExample/src/ConfigExample.mxml   |    77 +
 .../locale/en_US/SquigglyContextMenu.properties |    19 +
 .../locale/es_ES/SquigglyContextMenu.properties |    19 +
 .../src/ContextMenuWithResource.mxml            |    74 +
 .../src/CustomContextMenu.mxml                  |    59 +
 .../Flex/GetSuggestion/src/GetSuggestion.mxml   |    84 +
 .../src/SpellingServiceEsg.mxml                 |    98 +
 .../src/AdobeSpellingFrameworkExample.mxml      |    80 +
 .../src/SquigglyUIExample.mxml                  |    55 +
 .../src/SquigglyUIexampleDictload.mxml          |    79 +
 .../src/SquigglyUIexampleUBS.mxml               |   596 +
 .../Flex/TextEditor/src/TextEditor.mxml         |    83 +
 .../spelling/Examples/HowToUseExamples.txt      |    33 +
 .../com/adobe/linguistics/utils/ITokenizer.as   |    76 +
 .../adobe/linguistics/utils/TextTokenizer.as    |   393 +
 .../src/com/adobe/linguistics/utils/Token.as    |    94 +
 .../linguistics/spelling/HunspellDictionary.as  |   205 +
 .../adobe/linguistics/spelling/ISpellChecker.as |    62 +
 .../linguistics/spelling/ISpellingDictionary.as |    45 +
 .../adobe/linguistics/spelling/SpellChecker.as  |   387 +
 .../linguistics/spelling/UserDictionary.as      |   113 +
 .../spelling/UserDictionaryInternal.as          |   115 +
 .../spelling/core/DictionaryManager.as          |    73 +
 .../linguistics/spelling/core/HashEntry.as      |   108 +
 .../linguistics/spelling/core/LinguisticRule.as |  1118 +
 .../linguistics/spelling/core/SpellingInfo.as   |    32 +
 .../spelling/core/SquigglyDictionary.as         |   207 +
 .../linguistics/spelling/core/SquigglyEngine.as |   426 +
 .../spelling/core/SuggestionManager.as          |  1026 +
 .../spelling/core/UserDictionaryEngine.as       |    71 +
 .../spelling/core/container/Collection.as       |    89 +
 .../spelling/core/container/Enumeration.as      |    28 +
 .../spelling/core/container/HashTable.as        |   179 +
 .../linguistics/spelling/core/container/Heap.as |   263 +
 .../spelling/core/container/Iterator.as         |    64 +
 .../linguistics/spelling/core/container/Set.as  |   195 +
 .../spelling/core/container/SparseHashTable.as  |   283 +
 .../spelling/core/env/ExternalConstants.as      |    47 +
 .../spelling/core/env/InternalConstants.as      |    87 +
 .../spelling/core/error/ContentError.as         |    39 +
 .../spelling/core/error/ErrorTable.as           |    41 +
 .../spelling/core/logging/AbstractTarget.as     |   167 +
 .../spelling/core/logging/ILogger.as            |    40 +
 .../spelling/core/logging/ILoggingTarget.as     |    39 +
 .../linguistics/spelling/core/logging/Log.as    |   210 +
 .../spelling/core/logging/LogEvent.as           |    87 +
 .../spelling/core/logging/LogEventLevel.as      |    76 +
 .../spelling/core/logging/LogLogger.as          |   102 +
 .../core/logging/targets/ArrayTarget.as         |    35 +
 .../core/logging/targets/CollectionTarget.as    |   107 +
 .../core/logging/targets/LineFormattedTarget.as |   104 +
 .../core/logging/targets/TextFieldTarget.as     |    52 +
 .../core/logging/targets/TraceTarget.as         |    37 +
 .../spelling/core/rule/AffixEntry.as            |   137 +
 .../linguistics/spelling/core/rule/AffixRule.as |    92 +
 .../linguistics/spelling/core/rule/MapFilter.as |    39 +
 .../spelling/core/rule/OptimizedPrefixEntry.as  |   245 +
 .../spelling/core/rule/OptimizedSuffixEntry.as  |   301 +
 .../spelling/core/rule/PrefixEntry.as           |   102 +
 .../spelling/core/rule/ReplacementFilter.as     |    34 +
 .../spelling/core/rule/SimpleFilter.as          |    48 +
 .../spelling/core/rule/SuffixEntry.as           |   126 +
 .../spelling/core/utils/DictionaryLoader.as     |    94 +
 .../spelling/core/utils/LinguisticRuleLoader.as |   977 +
 .../spelling/core/utils/MathUtils.as            |    66 +
 .../spelling/core/utils/RefObject.as            |    36 +
 .../spelling/core/utils/SimpleNumberParser.as   |    54 +
 .../core/utils/SquigglyDictionaryLoader.as      |   369 +
 .../spelling/core/utils/StringUtils.as          |   333 +
 .../spelling/core/utils/SuggestionsResult.as    |   142 +
 .../adobe/linguistics/spelling/utils/Token.as   |    47 +
 .../linguistics/spelling/utils/Tokenizer.as     |    96 +
 .../linguistics/spelling/utils/WordList.as      |   120 +
 .../main/AdobeSpellingFramework/asdocgen.bat    |    18 +
 .../spelling/framework/ResourceTable.as         |   134 +
 .../spelling/framework/SpellingConfiguration.as |   102 +
 .../spelling/framework/SpellingService.as       |   241 +
 .../spelling/framework/ui/HaloHighlighter.as    |   124 +
 .../spelling/framework/ui/HaloWordProcessor.as  |   111 +
 .../spelling/framework/ui/IHighlighter.as       |    34 +
 .../spelling/framework/ui/IWordProcessor.as     |    30 +
 .../spelling/framework/ui/SparkHighlighter.as   |   225 +
 .../spelling/framework/ui/SparkWordProcessor.as |   132 +
 .../framework/ui/SpellingHighlighter.as         |   179 +
 .../spelling/framework/ui/TLFHighlighter.as     |   248 +
 .../spelling/framework/ui/TLFWordProcessor.as   |   156 +
 .../com/adobe/linguistics/spelling/SpellUI.as   |   562 +
 .../linguistics/spelling/SpellingContextMenu.as |   243 +
 .../linguistics/spelling/ui/HaloHighlighter.as  |   126 +
 .../spelling/ui/HaloWordProcessor.as            |   112 +
 .../linguistics/spelling/ui/IHighlighter.as     |    67 +
 .../linguistics/spelling/ui/IWordProcessor.as   |    30 +
 .../linguistics/spelling/ui/SparkHighlighter.as |   229 +
 .../spelling/ui/SparkWordProcessor.as           |   133 +
 .../spelling/ui/SpellingHighlighter.as          |   196 +
 .../linguistics/spelling/ui/TLFHighlighter.as   |   252 +
 .../linguistics/spelling/ui/TLFWordProcessor.as |   159 +
 .../linguistics/spelling/ui/HaloHighlighter.as  |    87 +
 .../spelling/ui/HaloWordProcessor.as            |   109 +
 .../linguistics/spelling/ui/IHighlighter.as     |    34 +
 .../linguistics/spelling/ui/IWordProcessor.as   |    30 +
 .../linguistics/spelling/ui/SparkHighlighter.as |   190 +
 .../spelling/ui/SparkWordProcessor.as           |   104 +
 .../spelling/ui/SpellingHighlighter.as          |   179 +
 .../com/adobe/linguistics/spelling/SpellUI.as   |   577 +
 .../linguistics/spelling/SpellingContextMenu.as |   243 +
 .../adobe/linguistics/spelling/SpellUIForTLF.as |   522 +
 .../spelling/SpellingContextMenuForTLF.as       |   249 +
 .../SquigglyCustomContainerController.as        |   258 +
 Squiggly/main/Automation/asdocgen.bat           |    18 +
 Squiggly/main/Automation/copydictsandlibs.bat   |    35 +
 Squiggly/main/Automation/examplegen.py          |    75 +
 .../main/Automation/prepareReleasePackage.bat   |    20 +
 Squiggly/main/Data/genTextWordlist.sh           |    31 +
 Squiggly/main/Data/usa.txt                      | 97812 +++++++++++++++++
 .../src/AdobeSpellingAirDemo-app.xml            |   153 +
 .../src/AdobeSpellingAirDemo.mxml               |    39 +
 .../src/AdobeSpellingAirDemoEx-app.xml          |   153 +
 .../src/AdobeSpellingAirDemoEx.mxml             |    71 +
 .../src/AdobeSpellingConfig.xml                 |    26 +
 .../src/AdobeSpellingDemo.mxml                  |    72 +
 .../src/AdobeSpellingConfig.xml                 |    27 +
 .../src/AdobeSpellingDemoEx.mxml                |    70 +
 Squiggly/main/README.txt                        |    28 +
 .../main/Tools/AdobeSpellingDictGen/README.txt  |    16 +
 .../sample/sampleWordList.txt                   |    13 +
 .../src/AdobeSpellingDictGen-app.xml            |   153 +
 .../src/AdobeSpellingDictGen.mxml               |   210 +
 .../Tools/AdobeSpellingDictGen/src/UIWord.as    |    37 +
 .../performanceTool/src/performanceTool.mxml    |    84 +
 Squiggly/main/build.xml                         |   231 +
 207 files changed, 126796 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/ActionScript/SquigglyTLFExample/src/SquigglyTLFExample.as
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/ActionScript/SquigglyTLFExample/src/SquigglyTLFExample.as b/Squiggly/ane/Examples/ActionScript/SquigglyTLFExample/src/SquigglyTLFExample.as
new file mode 100644
index 0000000..cad0b92
--- /dev/null
+++ b/Squiggly/ane/Examples/ActionScript/SquigglyTLFExample/src/SquigglyTLFExample.as
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+	import flash.display.Sprite;
+	
+	import flashx.textLayout.container.ContainerController;
+	import flashx.textLayout.elements.TextFlow;
+	import flashx.textLayout.conversion.TextConverter;
+	import flashx.textLayout.edit.EditManager;
+	
+	import com.adobe.linguistics.spelling.SpellUIForTLF;
+	
+	public class SquigglyTLFExample extends Sprite
+	{
+		public function SquigglyTLFExample()
+		{
+			var markup:XML = <TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p><span>I know &nbsp;</span><span fontStyle='italic'>Enlish</span><span>. Use the context menu to see the suggestions of the missbelled word.</span></p></TextFlow>;
+			var textFlow:TextFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
+			textFlow.flowComposer.addController(new ContainerController(this, 500, 600));
+			textFlow.flowComposer.updateAllControllers();
+			
+			textFlow.interactionManager = new EditManager();
+			
+			SpellUIForTLF.enableSpelling(textFlow, "en_US");
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Air/UserDictionaryExample/src/UserDictionaryExample-app.xml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Air/UserDictionaryExample/src/UserDictionaryExample-app.xml b/Squiggly/ane/Examples/Air/UserDictionaryExample/src/UserDictionaryExample-app.xml
new file mode 100644
index 0000000..d400631
--- /dev/null
+++ b/Squiggly/ane/Examples/Air/UserDictionaryExample/src/UserDictionaryExample-app.xml
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<application xmlns="http://ns.adobe.com/air/application/1.5.1">
+
+<!-- Adobe AIR Application Descriptor File Template.
+
+	Specifies parameters for identifying, installing, and launching AIR applications.
+
+	xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/1.5.1
+			The last segment of the namespace specifies the version 
+			of the AIR runtime required for this application to run.
+			
+	minimumPatchLevel - The minimum patch level of the AIR runtime required to run 
+			the application. Optional.
+-->
+
+	<!-- The application identifier string, unique to this application. Required. -->
+	<id>UserDictionaryExample</id>
+
+	<!-- Used as the filename for the application. Required. -->
+	<filename>UserDictionaryExample</filename>
+
+	<!-- The name that is displayed in the AIR application installer. 
+	     May have multiple values for each language. See samples or xsd schema file. Optional. -->
+	<name>UserDictionaryExample</name>
+
+	<!-- An application version designator (such as "v1", "2.5", or "Alpha 1"). Required. -->
+	<version>v1</version>
+
+	<!-- Description, displayed in the AIR application installer.
+	     May have multiple values for each language. See samples or xsd schema file. Optional. -->
+	<!-- <description></description> -->
+
+	<!-- Copyright information. Optional -->
+	<!-- <copyright></copyright> -->
+
+	<!-- Settings for the application's initial window. Required. -->
+	<initialWindow>
+		<!-- The main SWF or HTML file of the application. Required. -->
+		<!-- Note: In Flex Builder, the SWF reference is set automatically. -->
+		<content>[This value will be overwritten by Flex Builder in the output app.xml]</content>
+		
+		<!-- The title of the main window. Optional. -->
+		<!-- <title></title> -->
+
+		<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
+		<!-- <systemChrome></systemChrome> -->
+
+		<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
+		<!-- <transparent></transparent> -->
+
+		<!-- Whether the window is initially visible. Optional. Default false. -->
+		<!-- <visible></visible> -->
+
+		<!-- Whether the user can minimize the window. Optional. Default true. -->
+		<!-- <minimizable></minimizable> -->
+
+		<!-- Whether the user can maximize the window. Optional. Default true. -->
+		<!-- <maximizable></maximizable> -->
+
+		<!-- Whether the user can resize the window. Optional. Default true. -->
+		<!-- <resizable></resizable> -->
+
+		<!-- The window's initial width. Optional. -->
+		<!-- <width></width> -->
+
+		<!-- The window's initial height. Optional. -->
+		<!-- <height></height> -->
+
+		<!-- The window's initial x position. Optional. -->
+		<!-- <x></x> -->
+
+		<!-- The window's initial y position. Optional. -->
+		<!-- <y></y> -->
+
+		<!-- The window's minimum size, specified as a width/height pair, such as "400 200". Optional. -->
+		<!-- <minSize></minSize> -->
+
+		<!-- The window's initial maximum size, specified as a width/height pair, such as "1600 1200". Optional. -->
+		<!-- <maxSize></maxSize> -->
+	</initialWindow>
+
+	<!-- The subpath of the standard default installation location to use. Optional. -->
+	<!-- <installFolder></installFolder> -->
+
+	<!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
+	<!-- <programMenuFolder></programMenuFolder> -->
+
+	<!-- The icon the system uses for the application. For at least one resolution,
+		 specify the path to a PNG file included in the AIR package. Optional. -->
+	<!-- <icon>
+		<image16x16></image16x16>
+		<image32x32></image32x32>
+		<image48x48></image48x48>
+		<image128x128></image128x128>
+	</icon> -->
+
+	<!-- Whether the application handles the update when a user double-clicks an update version
+	of the AIR file (true), or the default AIR application installer handles the update (false).
+	Optional. Default false. -->
+	<!-- <customUpdateUI></customUpdateUI> -->
+	
+	<!-- Whether the application can be launched when the user clicks a link in a web browser.
+	Optional. Default false. -->
+	<!-- <allowBrowserInvocation></allowBrowserInvocation> -->
+
+	<!-- Listing of file types for which the application can register. Optional. -->
+	<!-- <fileTypes> -->
+
+		<!-- Defines one file type. Optional. -->
+		<!-- <fileType> -->
+
+			<!-- The name that the system displays for the registered file type. Required. -->
+			<!-- <name></name> -->
+
+			<!-- The extension to register. Required. -->
+			<!-- <extension></extension> -->
+			
+			<!-- The description of the file type. Optional. -->
+			<!-- <description></description> -->
+			
+			<!-- The MIME content type. -->
+			<!-- <contentType></contentType> -->
+			
+			<!-- The icon to display for the file type. Optional. -->
+			<!-- <icon>
+				<image16x16></image16x16>
+				<image32x32></image32x32>
+				<image48x48></image48x48>
+				<image128x128></image128x128>
+			</icon> -->
+			
+		<!-- </fileType> -->
+	<!-- </fileTypes> -->
+
+</application>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Air/UserDictionaryExample/src/UserDictionaryExample.mxml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Air/UserDictionaryExample/src/UserDictionaryExample.mxml b/Squiggly/ane/Examples/Air/UserDictionaryExample/src/UserDictionaryExample.mxml
new file mode 100644
index 0000000..68d32de
--- /dev/null
+++ b/Squiggly/ane/Examples/Air/UserDictionaryExample/src/UserDictionaryExample.mxml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" horizontalAlign="left" initialize="init()">
+<mx:Script>
+	<![CDATA[
+
+
+	import com.adobe.linguistics.spelling.HunspellDictionary;
+	import com.adobe.linguistics.spelling.SpellChecker;
+	import com.adobe.linguistics.spelling.UserDictionary;
+		
+	
+	private var ud:UserDictionary;
+	private var _newdict:HunspellDictionary = new HunspellDictionary();
+	private var sp:SpellChecker;
+	private function init():void {
+		_newdict.addEventListener(Event.COMPLETE, handleLoadComplete);
+		_newdict.load("dictionaries/en_US/en_US.aff", "dictionaries/en_US/en_US.dic");
+	}
+		
+	private function handleLoadComplete(evt:Event):void
+	{
+		sp = new SpellChecker(_newdict);
+	}
+
+	private function checkWord():void {
+		if( sp.checkWord( inputWord.text ) )
+			result.text = "Result:correct";
+		else
+			result.text = "Result:wrong";
+	}
+		
+	public function updateWordList():void
+	{
+		wordList.text = "";
+		
+		var wl:Vector.<String> = ud.wordList;
+		for each(var w:String in wl)
+		{
+			wordList.text += w + "\n";
+		}
+		
+	}
+	
+	
+	public function loadDict():void
+	{
+		var inFile:File = File.desktopDirectory;
+		inFile = inFile.resolvePath(filename.text);
+		if (inFile.exists)
+		{		
+			var inStream:FileStream = new FileStream();
+			inStream.open(inFile, FileMode.READ);
+			ud = new UserDictionary(inStream.readObject() as Vector.<String>);
+			inStream.close();  	
+			result1.text = "File loaded";	
+		}
+		else
+		{
+			ud = new UserDictionary();
+			result1.text = "File created";
+		}		
+		updateWordList();
+		sp.addUserDictionary(ud);
+	}
+	
+	public function saveDict():void
+	{
+		var outFile:File = File.desktopDirectory;
+		outFile = outFile.resolvePath(filename.text);
+		var outStream:FileStream = new FileStream();
+		outStream.open(outFile, FileMode.WRITE);
+		outStream.writeObject(ud.wordList);
+		outStream.close();
+		result1.text = "File saved"
+	}
+	
+	public function addWord():void
+	{
+		ud.addWord(word.text);
+		updateWordList();
+	}
+	
+	public function removeWord():void
+	{
+		ud.removeWord(word.text);
+		updateWordList();
+	}
+	
+	]]>
+</mx:Script>		
+	<mx:HBox>
+		<mx:TextInput id="filename" text="mywords.ud"/>
+		<mx:Button id="load" label="Load/New dictionary" click="loadDict()" />
+		<mx:Button id="save" label="Save dictionary" click="saveDict()" />
+		<mx:Label id="result1" text="Result:"/> 
+	</mx:HBox>	
+	<mx:HBox>
+		<mx:TextInput id="word" text="myword"/>
+		<mx:Button id="add" label="Add Word" click="addWord()" />
+		<mx:Button id="remove" label="Remove word" click="removeWord()" />
+		<mx:Label id="result2" text="Result:"/> 
+	</mx:HBox>
+	<mx:TextArea id="wordList" height="100" width="100"/>
+	
+	<mx:TextInput id="inputWord" text ="test" keyUp="checkWord()"/>
+	<mx:Button id="check" label="Check Word" click="checkWord()"  />
+	<mx:Label id ="result" text="Result:"/>
+</mx:WindowedApplication>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/CheckWord/src/CheckWord.mxml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/CheckWord/src/CheckWord.mxml b/Squiggly/ane/Examples/Flex/CheckWord/src/CheckWord.mxml
new file mode 100644
index 0000000..d10b506
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/CheckWord/src/CheckWord.mxml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" applicationComplete="init()">
+<mx:Script>
+	<![CDATA[
+		import com.adobe.linguistics.spelling.*;
+		
+		private var _newdict:HunspellDictionary = new HunspellDictionary();
+		private var sp:SpellChecker;
+		private function init():void {
+				_newdict.addEventListener(Event.COMPLETE, handleLoadComplete);
+				_newdict.load("dictionaries/en_US/en_US.aff", "dictionaries/en_US/en_US.dic");
+		}
+		private function handleLoadComplete(evt:Event):void
+		{
+			sp = new SpellChecker(_newdict);
+		}
+
+		private function checkWord():void {
+			if( sp.checkWord( inputWord.text ) )
+				result.text = "Result:correct";
+			else
+				result.text = "Result:wrong";
+		}
+		
+	]]>
+</mx:Script>
+	<mx:TextInput id="inputWord" text ="test" keyUp="checkWord()"/>
+	<mx:Label id ="result" text="Result:"/>
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/ConfigExample/src/ConfigExample.mxml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/ConfigExample/src/ConfigExample.mxml b/Squiggly/ane/Examples/Flex/ConfigExample/src/ConfigExample.mxml
new file mode 100644
index 0000000..9d516d9
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/ConfigExample/src/ConfigExample.mxml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" viewSourceURL="srcview/index.html" applicationComplete="init()">		
+	<mx:Script>
+		<![CDATA[
+			import com.adobe.linguistics.spelling.SpellUI;
+			import com.adobe.linguistics.spelling.framework.SpellingConfiguration;
+			import com.adobe.linguistics.spelling.framework.ResourceTable;
+			
+			
+			public function init():void
+			{
+				var resourceTable:ResourceTable = new ResourceTable();
+				resourceTable.setResource("en_US", {rule:"data/en_US.aff", dict:"data/en_US.dic"});
+				resourceTable.setResource("es_ES", {rule:"data/es_ES.aff", dict:"data/es_ES.dic"});
+				SpellingConfiguration.resourceTable = resourceTable;
+			}
+			public function spellEnglish():void
+			{
+				SpellUI.enableSpelling(ta_en,"en_US");
+			}
+			public function spellSpanish():void
+			{
+				SpellUI.enableSpelling(ta_es,"es_ES");
+			}
+			
+		]]>
+	</mx:Script>
+	
+	<mx:Label text="ConfigExample.mxml Spell checks using SpellingConfiguration class. Does not need AdobeSpellingConfig.xml" fontSize="20"/>
+	
+	
+		
+		<mx:TextArea id="ta_en" width="50%" height="20%"
+						 text="I know Enlish. Use the context menu to see the suggestions of the missbelled word. " />
+		<mx:Button label="Spell English" id="b1" click="spellEnglish()"/>
+		
+		<mx:TextArea id="ta_es" width="50%" height="20%"
+						 text="Sé esbañol. Utilice el menú contextual para ver las sugerencias de la palabra mal eskrita. " />
+		<mx:Button label="Spell Spanish" id="b2" click="spellSpanish()"/>
+
+</mx:Application>
+
+

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/ContextMenuWithResource/locale/en_US/SquigglyContextMenu.properties
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/ContextMenuWithResource/locale/en_US/SquigglyContextMenu.properties b/Squiggly/ane/Examples/Flex/ContextMenuWithResource/locale/en_US/SquigglyContextMenu.properties
new file mode 100644
index 0000000..e6d6928
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/ContextMenuWithResource/locale/en_US/SquigglyContextMenu.properties
@@ -0,0 +1,23 @@
+################################################################################
+##
+##  Licensed to the Apache Software Foundation (ASF) under one or more
+##  contributor license agreements.  See the NOTICE file distributed with
+##  this work for additional information regarding copyright ownership.
+##  The ASF licenses this file to You under the Apache License, Version 2.0
+##  (the "License"); you may not use this file except in compliance with
+##  the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+##  Unless required by applicable law or agreed to in writing, software
+##  distributed under the License is distributed on an "AS IS" BASIS,
+##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+##  See the License for the specific language governing permissions and
+##  limitations under the License.
+##
+################################################################################
+
+# locale/en_US/SquigglyContextMenu.properties
+add=Add to dictionary
+enable=Enable spelling
+disable=Disable spelling

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/ContextMenuWithResource/locale/es_ES/SquigglyContextMenu.properties
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/ContextMenuWithResource/locale/es_ES/SquigglyContextMenu.properties b/Squiggly/ane/Examples/Flex/ContextMenuWithResource/locale/es_ES/SquigglyContextMenu.properties
new file mode 100644
index 0000000..e85b091
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/ContextMenuWithResource/locale/es_ES/SquigglyContextMenu.properties
@@ -0,0 +1,23 @@
+################################################################################
+##
+##  Licensed to the Apache Software Foundation (ASF) under one or more
+##  contributor license agreements.  See the NOTICE file distributed with
+##  this work for additional information regarding copyright ownership.
+##  The ASF licenses this file to You under the Apache License, Version 2.0
+##  (the "License"); you may not use this file except in compliance with
+##  the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+##  Unless required by applicable law or agreed to in writing, software
+##  distributed under the License is distributed on an "AS IS" BASIS,
+##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+##  See the License for the specific language governing permissions and
+##  limitations under the License.
+##
+################################################################################
+
+# locale/es_ES/SquigglyContextMenu.properties
+add=Añadir al diccionario
+enable=Revisar ortografía
+disable=Ignorar ortografía

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/ContextMenuWithResource/src/ContextMenuWithResource.mxml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/ContextMenuWithResource/src/ContextMenuWithResource.mxml b/Squiggly/ane/Examples/Flex/ContextMenuWithResource/src/ContextMenuWithResource.mxml
new file mode 100644
index 0000000..166255d
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/ContextMenuWithResource/src/ContextMenuWithResource.mxml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" initialize="init();">
+	<mx:Script>
+		<![CDATA[
+
+			import com.adobe.linguistics.spelling.SpellUI;
+			
+			[Bindable]
+			private var uiLocales:Array = ["en_US", "es_ES" ];
+			
+			private function uiLocaleChange():void
+			{
+				resourceManager.localeChain = [ localeComboBox.selectedItem ];
+				updateContextMenuForLocaleChange();
+			}
+				
+			private function updateContextMenuForLocaleChange():void
+			{
+				var contextMenu:Object = 
+					{add:resourceManager.getString('SquigglyContextMenu', 'add'),
+					 enable:resourceManager.getString('SquigglyContextMenu', 'enable'),
+					 disable:resourceManager.getString('SquigglyContextMenu', 'disable')};
+				SpellUI.setSpellingMenuEntries(contextMenu);
+			}
+			
+			private function init():void
+			{
+				SpellUI.enableSpelling(ta, "en_US");
+			}
+		]]>
+    </mx:Script>
+    
+    <mx:Metadata>
+    	[ResourceBundle("SquigglyContextMenu")]
+    </mx:Metadata>
+	<mx:Label text="Example for contextMenu customization with resource" fontSize="30"/>
+	<mx:HBox>
+		<mx:Text text="Locale for Squiggly contextMenu" color="blue"/>	
+		<mx:ComboBox id="localeComboBox" dataProvider="{uiLocales}" change="uiLocaleChange()"/>
+	</mx:HBox>
+	<mx:TextArea id="ta" width="50%" height="50%" fontSize="30" y="50" text="Sé esbañol. Utilice el menú contextual para ver las sugerencias de la palabra mal eskrita."/>
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/CustomContextMenu/src/CustomContextMenu.mxml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/CustomContextMenu/src/CustomContextMenu.mxml b/Squiggly/ane/Examples/Flex/CustomContextMenu/src/CustomContextMenu.mxml
new file mode 100644
index 0000000..854c450
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/CustomContextMenu/src/CustomContextMenu.mxml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" initialize="init();">
+	<mx:Script>
+		<![CDATA[
+
+			import com.adobe.linguistics.spelling.SpellUI;
+				
+			public function init():void
+			{
+				// This is just for example code purpose, we recommend using this with resource bundle rather than using hard coded string.
+				var spanishEntries:Object = {enable:"Revisar ortografía", disable:"Ignorar ortografía", add:"Añadir al diccionario"};
+				var result:Boolean = SpellUI.setSpellingMenuEntries(spanishEntries);
+				if (result == false) trace("Error customizing contextMenu, default menu will be used");
+				
+				SpellUI.enableSpelling(ta, "en_US");
+			}	
+		]]>
+    </mx:Script>
+    
+	<mx:Label text="Example for Spanish contextMenu" fontSize="30"/>
+	<mx:TextArea id="ta" width="50%" height="50%" fontSize="30" y="50"/>
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/GetSuggestion/src/GetSuggestion.mxml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/GetSuggestion/src/GetSuggestion.mxml b/Squiggly/ane/Examples/Flex/GetSuggestion/src/GetSuggestion.mxml
new file mode 100644
index 0000000..df0221f
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/GetSuggestion/src/GetSuggestion.mxml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init()" horizontalAlign="left">
+<mx:Script>
+	<![CDATA[
+		import com.adobe.linguistics.spelling.*;
+		
+		private var _newdict:HunspellDictionary = new HunspellDictionary();
+		private var sp:SpellChecker;
+		private function init():void {
+				_newdict.addEventListener(Event.COMPLETE, handleLoadComplete);
+				_newdict.load("dictionaries/en_US/en_US.aff", "dictionaries/en_US/en_US.dic");
+		}
+		private function handleLoadComplete(evt:Event):void
+		{
+			sp = new SpellChecker(_newdict);
+		}
+
+		private function checkWord():void {
+			suggestions.text= "";
+			if( sp.checkWord( inputWord.text ) ) {
+				result.text = "Result:correct";
+			}
+			else {
+				result.text = "Result:wrong";
+				var sugeestionArr:Array= sp.getSuggestions(inputWord.text);
+				if (sugeestionArr != null) {
+					for ( var i:int=0;i< sugeestionArr.length; i++ ) {
+						suggestions.text= suggestions.text + sugeestionArr[i] + "\n";
+					}
+				}
+			}
+		}
+		
+	]]>
+</mx:Script>
+	<mx:HBox>
+		<mx:TextInput id="inputWord" text ="test" keyUp="checkWord()"/>
+		<mx:Button id="check" label="Check Word" click="checkWord()"  />
+		<mx:Label id ="result" text="Result:"/>	
+	</mx:HBox>
+	<mx:TextArea id="suggestions" height="300" width="100"/>
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/SpellingServiceEsg/src/SpellingServiceEsg.mxml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/SpellingServiceEsg/src/SpellingServiceEsg.mxml b/Squiggly/ane/Examples/Flex/SpellingServiceEsg/src/SpellingServiceEsg.mxml
new file mode 100644
index 0000000..b1afb2d
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/SpellingServiceEsg/src/SpellingServiceEsg.mxml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="init();">
+	<fx:Declarations>
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+	</fx:Declarations>
+	<fx:Script>
+		<![CDATA[
+			import com.adobe.linguistics.spelling.framework.*;
+			import com.adobe.linguistics.spelling.*;
+			
+			private var spellingService:SpellingService = null;
+			
+			private function init():void {
+				result.text += "AdobeSpellingServiceFramework tests\n===================\n";
+				result.text += "Setting SpellingConfiguration and initializing SpellingService ...\n";
+				
+				var resourceTable:ResourceTable = new ResourceTable();
+				resourceTable.setResource("en_US", {rule:"data/en_US.aff", dict:"data/en_US.dic"});			
+				SpellingConfiguration.resourceTable = resourceTable;
+				
+				spellingService = new SpellingService("en_US");
+				spellingService.addEventListener(Event.COMPLETE, spellingServiceReady);
+				spellingService.init();
+			}
+			
+			private function spellingServiceReady(e:Event):void {
+				result.text += "SpellingService ready for use\n";
+				
+				result.text += "Checking \"hello\" ... " + spellingService.checkWord("hello") + "\n";
+				result.text += "Checking \"heello\" ... " + spellingService.checkWord("heello") + "\n";
+				result.text += "Getting suggestions for \"heello\" ... " + spellingService.getSuggestions("heello") + "\n";
+				
+				
+				var ud:UserDictionary = new UserDictionary();
+				result.text += "Adding \"heello\" to UserDictionary ..." + ud.addWord("heello") + "\n";
+				result.text += "Adding UserDicitonary to SpellingService ..." + spellingService.addUserDictionary(ud) +"\n";
+				result.text += "Checking \"heello\" again, expect true ..." + spellingService.checkWord("heello") + "\n";
+				
+				result.text += "Removing \"heello\" from UserDictionary ..." + ud.removeWord("heello") + "\n"
+				result.text += "Checking \"heello\" again, expect false ..." + spellingService.checkWord("heello") + "\n";
+				
+				result.text += "Number of UserDictionary, expect 1 ..." + spellingService.userDictionaries.length + "\n";
+				
+				var ud2:UserDictionary = new UserDictionary();				
+				result.text += "Adding UserDicitonary 2 to SpellingService ..." + spellingService.addUserDictionary(ud2) +"\n";
+				result.text += "Adding \"heello\" to UserDictionary 2 ..." + ud2.addWord("heello") + "\n";
+				result.text += "Checking \"heello\" again, expect true ..." + spellingService.checkWord("heello") + "\n";
+				result.text += "Number of UserDictionary, expect 2 ..." + spellingService.userDictionaries.length + "\n";
+				
+				spellingService.removeUserDictionary(ud);
+				spellingService.removeUserDictionary(ud2);
+				result.text += "Checking \"heello\" again after removing all UserDictionaries, expect false ..." + spellingService.checkWord("heello") + "\n";
+				result.text += "Number of UserDictionary, expect 0 ..." + spellingService.userDictionaries.length + "\n";
+				
+			}
+			
+		]]>
+	</fx:Script>
+	<mx:Text id="result"/>
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/SquigglyUIExample/src/SquigglyUIExample.mxml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/SquigglyUIExample/src/SquigglyUIExample.mxml b/Squiggly/ane/Examples/Flex/SquigglyUIExample/src/SquigglyUIExample.mxml
new file mode 100644
index 0000000..086a591
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/SquigglyUIExample/src/SquigglyUIExample.mxml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">		
+<mx:Script>
+	<![CDATA[
+			import com.adobe.linguistics.spelling.SpellUI;	
+			
+			private function enableFeature():void {
+				SpellUI.enableSpelling(textArea, "en_US");
+			}
+			private function disableFeature() :void {
+				SpellUI.disableSpelling(textArea);
+			
+			}
+	]]>
+</mx:Script>
+		
+	<mx:TextArea id="textArea" width="20%" height="20%" fontSize="30" text="Spell cheecking in TextArea "/>
+	<mx:Button id="tt1" label="disable Feature" click="disableFeature()" /> 
+	<mx:Button id="tt2" label="enable Feature" click="enableFeature()" /> 
+			
+</mx:Application>
+

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/Flex/TextEditor/src/TextEditor.mxml
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/Flex/TextEditor/src/TextEditor.mxml b/Squiggly/ane/Examples/Flex/TextEditor/src/TextEditor.mxml
new file mode 100644
index 0000000..b86191d
--- /dev/null
+++ b/Squiggly/ane/Examples/Flex/TextEditor/src/TextEditor.mxml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init()" horizontalAlign="left">
+<mx:Script>
+	<![CDATA[
+
+		import com.adobe.linguistics.spelling.*;
+		import mx.controls.textClasses.TextRange;
+		
+		private var _newdict:HunspellDictionary = new HunspellDictionary();
+		private var sp:SpellChecker;
+		private function init():void {
+			_newdict.addEventListener(Event.COMPLETE, handleLoadComplete);
+			_newdict.load("dictionaries/en_US/en_US.aff", "dictionaries/en_US/en_US.dic");
+		}
+		private function handleLoadComplete(evt:Event):void
+		{
+			sp = new SpellChecker(_newdict);
+		}
+
+		private function checkText():void {
+			var wordPattern:RegExp =/\b\w+\b/; // match next word...
+			var inputValue:String = inputText.text;
+			var offset:int, curPos:int;
+			for ( ; ; ) {
+				var res:Array = inputValue.match( wordPattern); // lookup word by word....
+				if ( res == null ) break;
+				if ( !sp.checkWord(res[0]) ) {
+					offset = inputText.text.length-inputValue.length;
+					curPos = inputValue.indexOf(res[0]);
+					var currentRange:TextRange = new TextRange(inputText, false, offset+ curPos, offset+ curPos+res[0].length); // mark mispelled word.
+					currentRange.color = "red";
+				}
+				inputValue = inputValue.substr(inputValue.indexOf(res[0])+ res[0].length);
+			}
+		}
+		
+	]]>
+</mx:Script>
+	<mx:HBox>
+		<mx:Button id="check" label="Check Text" click="checkText()"  />
+	</mx:HBox>
+	<mx:TextArea id="inputText" height="100%" width="100%"/>	
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/Examples/HowToUseExamples.txt
----------------------------------------------------------------------
diff --git a/Squiggly/ane/Examples/HowToUseExamples.txt b/Squiggly/ane/Examples/HowToUseExamples.txt
new file mode 100644
index 0000000..80670d8
--- /dev/null
+++ b/Squiggly/ane/Examples/HowToUseExamples.txt
@@ -0,0 +1,34 @@
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+How to use Squiggly examples
+===================================
+
+To build and run an example, please follow these steps:
+
+1. Import the project into Flex Builder 3 or Flash Builder 4 beta.
+
+2. Copy the dictionary data (including the AdobeSpellingConfig.xml file and the dictionaries folder) from ../src to <project>/src folder. If you want to place the dictionary files in a different folder, please make sure the url is referred correctly in the code or in AdobeSpellingConfig.xml file.
+
+3. Copy the Squiggly lib(s) from ../libs to <project>/libs folder
+   - CheckWord, GetSuggestion, TextEditor needs only AdobeSpellingEngine.swc
+   - SquigglyUIExample, ContextMenuWithResource, CustomContextMenu needs both AdobeSpellingEngine.swc and AdobeSpellingUI.swc
+   - SquigglyTLFExample needs AdobeSpellingUIForTLF.swc
+
+4. Build the project
+

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/EncConv.cpp
----------------------------------------------------------------------
diff --git a/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/EncConv.cpp b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/EncConv.cpp
new file mode 100644
index 0000000..3d456c6
--- /dev/null
+++ b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/EncConv.cpp
@@ -0,0 +1,294 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+	CharConv.cpp
+
+	Author: Sudhakar Pandey <sudhakar@adobe.com>
+*/
+
+
+#include <iostream>
+#include <cstring>
+#include <stdexcept>
+#include "EncConv.h"
+
+extern "C" 
+{
+    #include "unicode/ucnv.h"   //Adding this as an alternative to native iconv library
+    #include "unicode/ustring.h"   //Adding this as an alternative to native iconv library
+}
+#ifndef MAX
+		#define	MAX(a,b) (((a)>(b))?(a):(b))
+	#endif /* MAX */
+// =============================================================================
+
+namespace EncConv
+{
+
+// -----------------------------------------------------------------------------
+
+U16Char_t* convSpecialCharsInU16Str(const U16Char_t* src)
+{
+	const LM_UInt32 srcLen = GetNumOfUnits(src);
+	U16Char_t* pdst = new U16Char_t [srcLen + 1];
+	 
+	LM_UInt32 i;
+	for(i = 0; i < srcLen; ++i)
+	{
+		U16Char_t c = src[i];
+		switch (c)
+		{
+		case 0x2018:		// U+2018: Left Single Quotation Mark
+		case 0x2019:		// U+2019: Right Single Quotation Mark
+					c = '\'';	break;
+		case 0x201C:		// U+201C: Left Double Quotation Mark
+		case 0x201D:		// U+201D: Right Double Quotation Mark
+					c = '"';	break;
+		}
+		pdst[i] = c;
+	}
+	pdst[i] = 0;
+	return pdst;
+	//delete[] pdst;
+	//should be deleted by calling releaseU16CharString() function.
+}
+
+const char * getPlatformEncoding(const char* enc)
+{
+	//If encoding is null or not specified then try the default encoding "ISO-8859-1"
+	if(strlen(enc) == 0)
+		return "ISO-8859-1";
+	if(strcmp(enc,"ISO8859-1") == 0)
+		return "ISO-8859-1";
+	else if (strcmp(enc,"ISO8859-2") == 0)
+		return "ISO-8859-2";
+	else if (strcmp(enc,"ISO8859-3") == 0)
+		return "ISO-8859-3";
+	else if (strcmp(enc,"ISO8859-4") == 0)
+		return "ISO-8859-4";
+	else if (strcmp(enc,"ISO8859-5") == 0)
+		return "ISO-8859-5";
+	else if (strcmp(enc,"ISO8859-6") == 0)
+		return "ISO-8859-6";
+	else if (strcmp(enc,"ISO8859-7") == 0)
+		return "ISO-8859-7";
+	else if (strcmp(enc,"ISO8859-8") == 0)
+		return "ISO-8859-8";
+	else if (strcmp(enc,"ISO8859-9") == 0)
+		return "ISO-8859-9";
+	else if (strcmp(enc,"ISO8859-10") == 0)
+		return "ISO-8859-10";
+	else if (strcmp(enc,"KOI8-R") == 0)
+		return "KOI8-R";
+	else if (strcmp(enc,"KOI8-U") == 0)
+		return "KOI8-U";
+	else if (strcmp(enc,"microsoft-cp1251") == 0)
+		return "cp1251";
+	else if (strcmp(enc,"ISO8859-13") == 0)
+		return "ISO-8859-13";
+	else if (strcmp(enc,"ISO8859-14") == 0)
+		return "ISO-8859-14";
+	else if (strcmp(enc,"ISO8859-15") == 0)
+		return "ISO-8859-15";
+	else if (strcmp(enc,"ISCII-DEVANAGARI") == 0)
+		return "ibm-1137";
+	else if (strcmp(enc,"TIS620-2533") == 0)
+		return "TIS-620";
+	else if (strcmp(enc,"UTF-8") == 0)
+		return "UTF-8";
+	else
+		return enc;
+}
+
+
+const std::string convU16StrToCharStr(const U16Char_t* src, const char* Encoding)
+{
+	//static char const* const tocode = CHARCONV_ICONV_UTF16;
+	char const* const tocode = getPlatformEncoding(Encoding);
+    
+    UErrorCode status = U_ZERO_ERROR;
+
+#ifdef ENCCONV_DEBUG
+	std::cout << "\t" "convString" << std::endl;
+	std::cout << "\t\t" "tocode   = " << tocode   << std::endl;
+	//std::cout << "\t\t" "fromcode = " << fromcode << std::endl;
+#endif
+
+	//iconv_t cd = iconv_open(tocode, fromcode);
+    // Initializing ICU converter
+	UConverter *conv = ucnv_open(tocode, &status);
+
+#ifdef CHARCONV_DEBUG
+	std::cout << "\t\t" "aft ucnv_open: status = " << status << std::endl;
+#endif
+	if (conv == NULL)
+	{ // try default encoding "ISO-8859-1"
+		//throw std::runtime_error("Unable to create Unicode converter object");
+		status = U_ZERO_ERROR;
+		conv = ucnv_open("ISO-8859-1", &status);
+	}
+
+	//still if conv is null simply return blank string
+
+	if (conv == NULL)
+	{ 
+		return std::string("");
+	}
+
+	U16Char_t const* srcWrk = src;
+	const size_t srcSizeInUnits = GetNumOfUnits(src);
+	const size_t srcSizeInBytes = srcSizeInUnits * sizeof(U16Char_t);
+	const size_t dstSizeInBytes = MAX(256, (srcSizeInUnits + 1)) * 4;	// How much byte buffer is needed? (UTF16 --> MBCS)
+	char* dst = new char [dstSizeInBytes];
+	if(dst==NULL) 
+	{
+		//Fix for #3211945
+		ucnv_close(conv);
+		return std::string("");
+	}
+	char* dstWrk =(char*)(dst);
+	size_t srcLeftInBytes = srcSizeInBytes;
+	size_t dstLeftInBytes = dstSizeInBytes - sizeof(char);
+    status = U_ZERO_ERROR;
+
+		ucnv_fromUChars(conv, dstWrk, dstLeftInBytes, (UChar*)srcWrk, -1, &status);
+		U16Char_t* reverseConvertedVal = convCharStrToU16Str(dstWrk,Encoding);
+		if(strcmp((char*)reverseConvertedVal,(char*)src)!=0)
+		{
+			EncConv::releaseU16Str(reverseConvertedVal);
+			//Fix for #3211945
+			dstWrk = NULL;
+			ucnv_close(conv);
+	        delete[] dst;
+			
+			return std::string("");
+		}
+		EncConv::releaseU16Str(reverseConvertedVal);
+		
+	
+#ifdef CHARCONV_DEBUG
+		std::cout << "\t\t" "aft iconv: status = " << status << std::endl;
+#endif
+		if (status != U_ZERO_ERROR )
+		{
+			//	throw std::runtime_error("Unable to convert to string");
+			*dstWrk = 0;
+		}
+
+
+		std::string dst2(dst);
+		//Fix for #3211945 
+		dstWrk = NULL;
+        delete[] dst;
+	//const int err = iconv_close(cd);
+
+    ucnv_close(conv);
+
+	//if (err == -1)
+	//	throw std::runtime_error("Unable to deallocate iconv_t object");
+
+        return dst2;
+}
+
+U16Char_t* convCharStrToU16Str(const char* src, const char* Encoding)
+{
+
+	//static char const* const tocode = CHARCONV_ICONV_UTF16;
+	char const* const fromcode = getPlatformEncoding(Encoding);
+    
+    UErrorCode status = U_ZERO_ERROR;
+
+#ifdef ENCCONV_DEBUG
+	std::cout << "\t" "convString" << std::endl;
+	//std::cout << "\t\t" "tocode   = " << tocode   << std::endl;
+	std::cout << "\t\t" "fromcode = " << fromcode << std::endl;
+#endif
+
+	//iconv_t cd = iconv_open(tocode, fromcode);
+    // Initializing ICU converter
+    UConverter *conv= ucnv_open(fromcode, &status);
+#ifdef CHARCONV_DEBUG
+	std::cout << "\t\t" "aft ucnv_open: status = " << status << std::endl;
+#endif
+	if (conv == NULL)
+	{ // try default encoding "ISO-8859-1"
+		//throw std::runtime_error("Unable to create Unicode converter object");
+		conv = ucnv_open("ISO-8859-1", &status);
+	}
+
+	
+
+	char const* srcWrk = src;
+	const size_t srcSizeInBytes = std::strlen(src);
+	const size_t dstSizeInBytes = MAX(256, (srcSizeInBytes + 1)) * sizeof(U16Char_t);
+	U16Char_t* dst = new U16Char_t [dstSizeInBytes / sizeof(U16Char_t)];
+	U16Char_t* dstWrk = dst;
+	size_t srcLeftInBytes = srcSizeInBytes;
+	size_t dstLeftInBytes = dstSizeInBytes - sizeof(U16Char_t);
+
+    status = U_ZERO_ERROR;
+
+	//still if conv is null simply return blank string
+
+	if (conv == NULL)
+	{ 
+		dst[0] = NULL;
+		//Fix for #3211945
+		dstWrk = NULL;
+		return dst;
+	}
+
+	ucnv_toUChars(conv, (UChar *) dstWrk, dstLeftInBytes, (char*)srcWrk, srcLeftInBytes, &status);
+	
+#ifdef CHARCONV_DEBUG
+		std::cout << "\t\t" "aft iconv: status = " << status << std::endl;
+#endif
+		if (status != U_ZERO_ERROR )
+		{
+			//	throw std::runtime_error("Unable to convert to string");
+			*dstWrk = 0;
+		}
+
+
+	//const int err = iconv_close(cd);
+
+    ucnv_close(conv);
+
+	//if (err == -1)
+	//	throw std::runtime_error("Unable to deallocate iconv_t object");
+	//Fix for #3211945
+	dstWrk = NULL;
+	return dst;
+
+}
+
+void releaseU16Str(const U16Char_t* buf)
+{
+		if(buf != NULL)
+		{
+			delete[] buf;
+			buf = NULL;
+		}
+		return;
+}
+
+}// namespace
+// -----------------------------------------------------------------------------
+

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/EncConv.h
----------------------------------------------------------------------
diff --git a/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/EncConv.h b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/EncConv.h
new file mode 100644
index 0000000..22ee0c9
--- /dev/null
+++ b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/EncConv.h
@@ -0,0 +1,59 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+	CharConv.h
+
+	Author: Sudhakar Pandey <sudhakar@adobe.com>
+*/
+
+#ifndef __ENCCONV_H__
+#define __ENCCONV_H__
+
+
+#include <string>
+extern "C"
+{
+    #include "unicode/ucnv.h"
+}
+typedef unsigned short U16Char_t;
+typedef unsigned long	LM_UInt32;
+
+namespace EncConv
+{
+	template<class CharType>
+	static size_t GetNumOfUnits(CharType const* src)
+	{
+		size_t numOfUnits = 0;
+		while (*src++ != 0)
+			++numOfUnits;
+
+		return numOfUnits;
+	}
+
+	const char * getPlatformEncoding(char* enc);
+	const std::string convU16StrToCharStr(const U16Char_t* src, const char* Encoding);
+	U16Char_t* convCharStrToU16Str(const char* src, const char* Encoding);
+
+	U16Char_t* convSpecialCharsInU16Str( const U16Char_t* src); // caller need not allocate memory for the return value U16Char_t* 
+	void releaseU16Str(const U16Char_t* buf);
+
+}	// namespace
+
+#endif

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/English.lproj/InfoPlist.strings
----------------------------------------------------------------------
diff --git a/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/English.lproj/InfoPlist.strings b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..88f65cf
--- /dev/null
+++ b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/English.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/Exported_Sym_FIle
----------------------------------------------------------------------
diff --git a/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/Exported_Sym_FIle b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/Exported_Sym_FIle
new file mode 100644
index 0000000..1bd943b
--- /dev/null
+++ b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/Exported_Sym_FIle
@@ -0,0 +1,4 @@
+_ContextFinalizer
+_ContextInitializer
+_ExtFinalizer
+_ExtInitializer

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/HunspellNativeExtension.cpp
----------------------------------------------------------------------
diff --git a/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/HunspellNativeExtension.cpp b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/HunspellNativeExtension.cpp
new file mode 100644
index 0000000..29eddce
--- /dev/null
+++ b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/HunspellNativeExtension.cpp
@@ -0,0 +1,368 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <dlfcn.h>
+#include <string>
+#include <Adobe AIR/Adobe AIR.h>
+
+#include "hunspell.hxx"
+#include "HunspellNativeExtension.h"
+#include "EncConv.h"
+#include "Utilities.h"
+#define HUNSPELL_INIT_SUCCESS 1
+
+using namespace EncConv;
+
+
+// Symbols tagged with EXPORT are externally visible.
+// Must use the -fvisibility=hidden gcc option.
+#define EXPORT __attribute__((visibility("default")))
+
+void* hinstLib;
+typedef Hunspell * (*HUNSPELL_INIT)(char *, char*);
+typedef int (*HUNSPELL_SPELL)(Hunspell *, char *);
+typedef int (*HUNSPELL_SUGGEST)(Hunspell *, char ***, char *);
+typedef void (*HUNSPELL_FREE_LIST)(Hunspell *, char ***, int);
+typedef char *(*HUNSPELL_GET_ENCODING)(Hunspell *);
+typedef void (*HUNSPELL_UNINIT)(Hunspell *);
+
+extern "C"
+{
+	
+    Hunspell * getHunspellObject(std::string locale)
+    {
+        Hunspell_cache_iterator iter;
+        if((iter=Hunspell_cache.find(locale)) == Hunspell_cache.end() )
+            return NULL;
+        else
+            return iter->second;
+    }
+
+    
+    FREObject talkBack(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]) {
+       // const uint8_t *locale = 0;
+        const uint8_t *inpWord = 0;
+        uint32_t len = 0;
+        FREObject retObj=0;
+        
+        //get first argument
+        if(FREGetObjectAsUTF8(argv[0], &len, &inpWord) != FRE_OK)
+            return retObj;
+        
+        FRENewObjectFromUTF8((uint32_t)(strlen((char *)inpWord)),(const uint8_t*)(inpWord), &retObj);
+        
+        return retObj;
+        
+    }
+    
+    
+    FREObject initHunspellObject(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]){
+        const uint8_t *locale = 0;
+        const uint8_t *dictionaryPath = 0;
+        uint32_t len = -1;
+        FREObject retObj=0;
+       
+        Hunspell * hunspellObject;
+        //get first argument
+        if(FREGetObjectAsUTF8(argv[1], &len, &dictionaryPath) != FRE_OK)
+            return retObj;
+        len = 0;
+        
+        //get second argument
+        if(FREGetObjectAsUTF8(argv[0], &len, &locale) != FRE_OK)
+            return retObj;
+        
+        //check in cache and return if already present
+        if(!(Hunspell_cache.find(std::string((char *)locale))==Hunspell_cache.end()))
+		{
+			FRENewObjectFromInt32(HUNSPELL_INIT_SUCCESS, &retObj);
+			return retObj;
+		}
+        
+       // U16Char_t * dic_path_U16= EncConv::convCharStrToU16Str((char *)dictionaryPath, "UTF-8");
+       // U16Char_t *locale_U16= EncConv::convCharStrToU16Str((char *)locale, "UTF-8");
+  
+       // std::wstring aff_file= std::wstring((wchar_t *)dic_path_U16)+std::wstring(L"/Dictionaries/")+std::wstring((wchar_t *)locale_U16)+std::wstring(L"/")+std::wstring((wchar_t *)locale_U16)+std::wstring(L".aff");
+       // std::wstring dic_file= std::wstring((wchar_t *)dic_path_U16)+std::wstring(L"/Dictionaries/")+std::wstring((wchar_t *)locale_U16)+std::wstring(L"/")+std::wstring((wchar_t *)locale_U16)+std::wstring(L".dic");
+       // std::wstring lib_file= std::wstring((wchar_t *)dic_path_U16)+std::wstring(L"/libhunspell.dylib");
+     
+        
+        
+        //creating OS specific aff,dic file paths refer: DanishOS Issue of CS6 AHP 
+   //     std::string aff_file_U8= makeString(aff_file.c_str());
+   //     std::string dic_file_U8= makeString(dic_file.c_str());
+        
+        //make the file url's
+        std::string lib_file_U8= std::string((char *)dictionaryPath)+std::string("/libhunspell.dylib");
+        std::string aff_file_U8= std::string((char *)dictionaryPath)+std::string("/Dictionaries/")+std::string((char *)locale)+std::string("/")+std::string((char *)locale)+std::string(".aff");
+        std::string dic_file_U8= std::string((char *)dictionaryPath)+std::string("/Dictionaries/")+std::string((char *)locale)+std::string("/")+std::string((char *)locale)+std::string(".dic");
+        
+      
+    //    fprintf(stderr,"Path, %s", lib_file_U8.c_str());
+    //    fprintf(stderr,"Path, %s", aff_file_U8.c_str());
+    //    fprintf(stderr,"Path, %s", lib_file_U8.c_str());
+        
+        
+        //check for file is present
+        
+        if( (FileExists(aff_file_U8.c_str()) && FileExists(dic_file_U8.c_str()) && FileExists(lib_file_U8.c_str())) == false )
+        {
+            FRENewObjectFromInt32(RESOURCE_FILES_MISSING, &retObj);
+            return retObj;
+        }
+        
+        //make a new hunspell object
+    //    hinstLib = dlopen("/Users/ugoyal/Desktop/ThirdPartyResources/libhunspell.dylib", RTLD_LAZY); 
+        hinstLib = dlopen(lib_file_U8.c_str(), RTLD_LAZY); 
+        
+        if (hinstLib != NULL) 
+        { 
+            HUNSPELL_INIT initAdd = (HUNSPELL_INIT) dlsym(hinstLib, "Hunspell_create"); 
+            
+            // If the function address is valid, call the function.
+            
+            if (NULL != initAdd) 
+            {
+                hunspellObject = (initAdd) ((char *)aff_file_U8.c_str(), (char *)dic_file_U8.c_str());
+              // hunspellObject = (*initAdd)("/Users/ugoyal/Desktop/ThirdPartyResources/Dictionaries/de_DE/de_DE.aff","/Users/ugoyal/Desktop/ThirdPartyResources/Dictionaries/de_DE/de_DE.dic");
+            }
+            
+        } 
+        
+        //add to hunspell cache	
+        if(Hunspell_cache.find(std::string((char *)locale))==Hunspell_cache.end())	
+            Hunspell_cache[std::string((char *)locale)]= hunspellObject;
+        
+     
+        if(hunspellObject)
+        {
+            FRENewObjectFromInt32(HUNSPELL_INIT_SUCCESS, &retObj);
+        }
+        else
+        {
+            FRENewObjectFromInt32(HUNSPELL_INIT_FAIL, &retObj);
+        }
+        
+        return retObj;
+    }
+    
+    FREObject checkWord(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]) {
+        const uint8_t *locale = 0;
+        const uint8_t *inpWord = 0;
+        uint32_t len = -1;
+        FREObject retObj=0;
+        int rv=0;
+        
+        U16Char_t* inpWordU16 = NULL;
+        std::string  inpWordDictEncoded;
+        bool isConversionUnSuccesful=false;
+        //get first argument
+        if(FREGetObjectAsUTF8(argv[1], &len, &locale) != FRE_OK)
+            return retObj;
+        len = 0;
+        
+        //get second argument
+        if(FREGetObjectAsUTF8(argv[0], &len, &inpWord) != FRE_OK)
+            return retObj;
+        
+        //get the hunspell object from cache
+        Hunspell * hunspellObject=getHunspellObject(std::string((char *)locale));
+		
+        if(!hunspellObject) 
+            return retObj;
+		
+        
+        //convert input utf8 to u16 string
+         inpWordU16 = EncConv::convCharStrToU16Str((char *)inpWord, "UTF-8");
+        
+        //get dictionary encoding
+       HUNSPELL_GET_ENCODING getEncAdd=(HUNSPELL_GET_ENCODING) dlsym(hinstLib, "Hunspell_get_dic_encoding");
+        char * m_MainEncoding= (*getEncAdd)(hunspellObject);
+        
+        //convert u16 to dictionary encoding
+        inpWordDictEncoded=EncConv::convU16StrToCharStr(inpWordU16,m_MainEncoding);
+        
+        if(inpWordDictEncoded.length()==0)
+        {
+            isConversionUnSuccesful = true;
+        }
+        
+        //Get spellAddress
+        HUNSPELL_SPELL spellAdd= (HUNSPELL_SPELL) dlsym(hinstLib, "Hunspell_spell");
+        
+        //Do spell check with converted word else try with UTF-8
+        if((!isConversionUnSuccesful) )
+        {
+            rv= (*spellAdd)(hunspellObject, (char * )inpWordDictEncoded.c_str());
+           
+        }
+        else
+        { 
+            rv= (*spellAdd)(hunspellObject, (char * )inpWord);
+        }
+		
+        //return results
+        EncConv::releaseU16Str(inpWordU16);
+        FRENewObjectFromInt32(rv, &retObj);
+        return retObj;
+    }
+    
+    FREObject getSuggestions(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]) {
+        const uint8_t *locale = 0;
+        const uint8_t *inpWord = 0;
+        uint32_t len = -1;
+        FREObject retObj=0;
+        FREObject oneSuggestion=0;
+        
+        U16Char_t* inpWordU16 = NULL;
+        std::string  inpWordDictEncoded;
+        bool isConversionUnSuccesful=false;
+        char * oneSuggestionEncoded=NULL;
+        U16Char_t * oneSuggestionU16=NULL;
+        std::string oneSuggestionU8;
+        
+        //assign memory to retobj
+        FRENewObject((const uint8_t*)"Array", 0, NULL, &retObj, 0);
+        
+        //get first argument
+        if(FREGetObjectAsUTF8(argv[1], &len, &locale) != FRE_OK)
+            return retObj;
+        len = 0;
+        
+        //get second argument
+        if(FREGetObjectAsUTF8(argv[0], &len, &inpWord) != FRE_OK)
+            return retObj;
+        
+        //get the hunspell object from cache
+        Hunspell * hunspellObject=getHunspellObject(std::string((char *)locale));
+		
+        if(!hunspellObject) return retObj;
+        
+        //convert input utf8 to u16 string
+        inpWordU16 = EncConv::convCharStrToU16Str((char *)inpWord, "UTF-8");
+        
+        //get dictionary encoding
+    HUNSPELL_GET_ENCODING getEncAdd=(HUNSPELL_GET_ENCODING) dlsym(hinstLib, "Hunspell_get_dic_encoding");
+        char * m_MainEncoding= (getEncAdd)(hunspellObject);
+        
+        //convert u16 to dictionary encoding
+        inpWordDictEncoded=EncConv::convU16StrToCharStr(inpWordU16,m_MainEncoding);
+        
+        if(inpWordDictEncoded.length()==0)
+        {
+            isConversionUnSuccesful = true;
+        }
+        
+        //get suggestAddress &freelistAddress
+        HUNSPELL_SUGGEST suggestAdd= (HUNSPELL_SUGGEST) dlsym(hinstLib, "Hunspell_suggest");
+        HUNSPELL_FREE_LIST freeListAdd= (HUNSPELL_FREE_LIST) dlsym(hinstLib, "Hunspell_free_list");
+        
+        char** suggList = NULL;
+        int numSugg = 0;
+        
+        //Try getting suggestions with encoded word else try with UTF8
+        if(suggestAdd && !isConversionUnSuccesful)
+        {
+            numSugg = (suggestAdd)(hunspellObject,&suggList,(char *) (inpWordDictEncoded.c_str()));
+        }
+        else
+        {
+            numSugg = (suggestAdd)(hunspellObject,&suggList ,(char *) (inpWord));
+        }
+        
+        
+        if(numSugg)
+        {
+            FRESetArrayLength( retObj, numSugg );
+            
+            for(int iCount=0; iCount <numSugg; iCount++)
+            {
+                oneSuggestionEncoded=suggList[iCount];
+                oneSuggestionU16=EncConv::convCharStrToU16Str(oneSuggestionEncoded, m_MainEncoding);
+                oneSuggestionU8= EncConv::convU16StrToCharStr(oneSuggestionU16, "UTF-8");
+                FRENewObjectFromUTF8((uint32_t)(oneSuggestionU8.length()),(const uint8_t*)(oneSuggestionU8.c_str()), &oneSuggestion);
+                FRESetArrayElementAt(retObj, iCount, oneSuggestion);
+                EncConv::releaseU16Str(oneSuggestionU16);
+            }
+            (freeListAdd)(hunspellObject, &suggList,numSugg);
+            
+        }
+        
+        EncConv::releaseU16Str(inpWordU16);
+        
+        return retObj;
+    }
+
+    
+    
+	void ContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, 
+		uint32_t* numFunctionsToSet, const FRENamedFunction** functionsToSet)
+	{
+        *numFunctionsToSet = 4;
+        FRENamedFunction* func = (FRENamedFunction*)malloc(sizeof(FRENamedFunction)*5);
+        
+        func[0].name = (const uint8_t*)"talkBack";
+        func[0].functionData = NULL;
+        func[0].function = &talkBack;
+        
+        func[1].name = (const uint8_t*)"initHunspellObject";
+        func[1].functionData = NULL;
+        func[1].function = &initHunspellObject;
+        
+        func[2].name = (const uint8_t*)"checkWord";
+        func[2].functionData = NULL;
+        func[2].function = &checkWord;
+        
+        func[3].name = (const uint8_t*)"getSuggestions";
+        func[3].functionData = NULL;
+        func[3].function = &getSuggestions;
+        
+        *functionsToSet = func;
+	}
+
+	void ContextFinalizer(FREContext ctx)
+	{
+	}
+
+	// Framework entry point
+	EXPORT
+	void ExtInitializer(void** extDataToSet, 
+		FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet)
+	{
+        *extDataToSet = NULL;
+		*ctxInitializerToSet = ContextInitializer;
+		*ctxFinalizerToSet = ContextFinalizer;
+	}
+
+	// Framework entry point
+	EXPORT
+	void ExtFinalizer(void* extData)
+	{
+        HUNSPELL_UNINIT uninitAdd= (HUNSPELL_UNINIT) dlsym(hinstLib, "Hunspell_destroy");
+        //clear all hunspell cache
+        for(Hunspell_cache_iterator hunspell_cache_iter= Hunspell_cache.begin(); hunspell_cache_iter != Hunspell_cache.end(); hunspell_cache_iter++)
+        {
+            (uninitAdd)(hunspell_cache_iter->second);
+            hunspell_cache_iter->second=NULL;
+        }
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/a52655ac/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/HunspellNativeExtension.h
----------------------------------------------------------------------
diff --git a/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/HunspellNativeExtension.h b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/HunspellNativeExtension.h
new file mode 100644
index 0000000..4591cc9
--- /dev/null
+++ b/Squiggly/ane/MacFWHunspellANE/HunspellNativeExtension/HunspellNativeExtension.h
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef HunspellNativeExtension_HunspellNativeExtension_h
+#define HunspellNativeExtension_HunspellNativeExtension_h
+
+#include<map>
+#define HUNSPELL_INIT_FAIL -1
+#define RESOURCE_FILES_MISSING -2
+
+#define HUNSPELL_INIT_SUCCESS 1
+
+
+typedef std::map< std::string, Hunspell * > Hunspell_cache_type;
+typedef std::map< std::string, Hunspell * >::iterator Hunspell_cache_iterator;
+
+static Hunspell_cache_type Hunspell_cache;
+
+//Hunspell * getHunspellObject(std::string locale);
+
+#endif


Mime
View raw message