You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2014/08/28 02:58:21 UTC

[16/21] remove Adobe from directory names (package name still contains Adobe)

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/LinguisticRuleLoader.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/LinguisticRuleLoader.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/LinguisticRuleLoader.as
deleted file mode 100644
index 1b5bac9..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/LinguisticRuleLoader.as
+++ /dev/null
@@ -1,977 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.core.utils
-{
-	import com.adobe.linguistics.spelling.core.LinguisticRule;
-	import com.adobe.linguistics.spelling.core.env.InternalConstants;
-	import com.adobe.linguistics.spelling.core.error.*;
-	import com.adobe.linguistics.spelling.core.logging.*;
-	
-	import flash.errors.IllegalOperationError;
-	import flash.events.ErrorEvent;
-	import flash.events.Event;
-	import flash.events.EventDispatcher;
-	import flash.events.IOErrorEvent;
-	import flash.events.SecurityErrorEvent;
-	import flash.net.URLRequest;
-	import flash.utils.ByteArray;
-
-	public class LinguisticRuleLoader extends EventDispatcher
-	{
-		private var _attrMgr:LinguisticRule;
-		private var _rulePath:String;
-		private var snp:SimpleNumberParser = new SimpleNumberParser();
-		
-		private var unrecognizedLines:int = 0;
-
-		
-		//setup logger for sending message.
-		private var className:String = flash.utils.getQualifiedClassName(this).split("::").join(".");
-		private var logger:ILogger = Log.getLogger( className );
-
-		public function LinguisticRuleLoader()
-		{
-			init();
-		}
-		
-		private function init():void {
-			_attrMgr = null;
-			_rulePath = null ;
-			unrecognizedLines = 0;
-			
-		}
-
-		public function load(ruleURL:String):void {
-			if ( ruleURL == null) {
-				throw new IllegalOperationError("Linguistics rule load function received an invalid URL.");
-			}
-			if ( this._attrMgr ) {
-				logger.warn("You already did call the load function muliti-times, The orginal linguistic data will be overiden." );
-				init();
-			}
-			_rulePath = ruleURL;
-			var request:URLRequest = new URLRequest( _rulePath );
-			var dloader:DictionaryLoader = new DictionaryLoader(request);
-			dloader.addEventListener(Event.COMPLETE,loadRuleComplete);
-			dloader.addEventListener(IOErrorEvent.IO_ERROR,handleError);
-			dloader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,handleError);
-		}
-		//Private method to dispatch an error event.
-		private function handleError(evt:Event):void {
-			bounceEvent(evt);
-		}
-		private function bounceEvent(evt:Event):void {
-			dispatchEvent(evt.clone());
-		}
-
-		public function get linguisticRule():LinguisticRule {
-			return _attrMgr;
-		}
-
-		private function loadRuleComplete(evt:Event):void {
-			_attrMgr = new LinguisticRule();
-			if( !_attrMgr ) {
-				logger.fatal("Rule File[{0}] Operation[parsing]:Could not locate memory for Linguistic Rule", this._rulePath  );
-				return;
-			}
-			var bytes:ByteArray = evt.target.data;
-			detectEncoding(bytes);
-			bytes.position = 0;
-			parseRule(bytes);
-			dispatchEvent(new Event(Event.COMPLETE));
-		}
-		
-		private function parseRule(bytes:ByteArray):void {
-			
-			var str:String = 	bytes.readMultiByte(bytes.length, _attrMgr.encoding);
-			/*
-			In DOS, a line break is a single '\n'.
-			In Unix, a line break is the sequence '\r\n'.
-			In MAC, a line break is a single '\r'.
-			Correct me if I'm wrong.
-			so step 1:
-			replace "\r\n" with "\n"
-			step 2:
-			replace "\r" with "\n";
-			finally ,we get "\n" line seperator.
-			*/
-			str=str.split("\r\n").join("\n");
-			str=str.split("\r").join("\n");
-			var lineContentArr:Array = str.split("\n");
-			
-			//bof of parsing the text.
-			if( (lineContentArr== null) || (lineContentArr.length== 1) ) {
-				logger.fatal("Rule File[{0}] Operation[parsing] has nothing in the file.", this._rulePath  );
-				return;
-			}
-			/* remove byte order mark */
-			if ( lineContentArr[0].match(new RegExp("^\xEF\xBB\xBF[.]+$") ) ) lineContentArr[0]=lineContentArr[0].substr(3);
-
-			var lineContent:String;
-			var res:int;
-			for( var line:int = 0; line<lineContentArr.length; ) {
-				lineContent= lineContentArr[line];
-				
-				
-				if ( parseAttribute( lineContent, line ) ) {
-					++line;
-					continue;
-				}
-				//parsing for AF rule make aliasf table before loading alias rules
-				if( (res=parseAliasf(lineContent, lineContentArr, line) ) !=0){
-					++line;
-					line+=res;
-					continue;
-				}
-					
-				if ( (res=parseAffix(lineContent, lineContentArr, line)) != 0 ) {
-					line++;
-					line += res;
-					continue;
-				}
-				
-				
-				if ( (res=parseReplaceTable(lineContent, lineContentArr,line)) !=0 ) {
-					line++;
-					line += res;
-					continue;
-				}
-				if ( (res=parseMapTable(lineContent, lineContentArr, line) ) != 0 ) {
-					line++;
-					line += res;
-					continue;
-				}
-/*				//Parse phone table
-				if ( (res=parsePhoneTable(lineContent, lineContentArr,line)) !=0 ) {
-					line++;
-					line += res;
-					continue;
-				}
-*/				/*parse for ICONV/OCONV field*/
-				if ((res=parseConvTable(lineContent, lineContentArr,line)) !=0 ) {
-					line++;
-					line+=res;
-					continue;
-				}
-				
-				/*parse for BREAK rule*/
-				if ((res=parseBreakTable(lineContent, lineContentArr,line)) !=0 ) {
-					line++;
-					line+=res;
-					continue;
-				}
-				
-				if ( !isCommentOrEmpty( lineContent ) ) {
-					line++;
-					unrecognizedLines++;
-					logger.warn("Rule File[{0}] Operation[parsing] Line Number:{1}, Content:{2}",this._rulePath , (line+1).toString(),lineContent );
-					continue;
-				}
-				line++;
-			}
-			//eof of parsing the text.
-			logger.info("Rule File[{0}] Operation[parsing] Total Lines:{1}, Unrecognized Lines:{2}", this._rulePath ,lineContentArr.length.toString(), unrecognizedLines.toString() );
-			
-		}
-
-		private function detectEncoding(bytes:ByteArray):void {
-			var str:String = 	bytes.readUTFBytes(bytes.length);
-			/*
-			In DOS, a line break is a single '\n'.
-			In Unix, a line break is the sequence '\r\n'.
-			In MAC, a line break is a single '\r'.
-			Correct me if I'm wrong.
-			so step 1:
-			replace "\r\n" with "\n"
-			step 2:
-			replace "\r" with "\n";
-			finally ,we get "\n" line seperator.
-			*/
-			str=str.split("\r\n").join("\n");
-			str=str.split("\r").join("\n");
-			var lineContentArr:Array = str.split("\n");
-			
-			//bof of parsing the text.
-			if(lineContentArr== null ) {
-				logger.fatal("Rule File[{0}] Operation[parsing] has nothing in the file.", this._rulePath  );
-				return;
-			}
-			/* remove byte order mark */
-			if ( lineContentArr[0].match(new RegExp("^\xEF\xBB\xBF[.]+$") ) ) lineContentArr[0]=lineContentArr[0].substr(3);
-
-			var lineContent:String;
-			var res:int;
-			for( var line:int = 0; line<lineContentArr.length; ) {
-				lineContent= lineContentArr[line];
-				if ( parseEncoding( lineContent, line ) ) {
-					break;
-				}
-				++line;
-			}
-			//eof of parsing the text.
-			if( _attrMgr.encoding == null ) {
-				logger.fatal("Rule File[{0}] Operation[parsing] Error[no encoding specified] in file.",this._rulePath );
-				_attrMgr.encoding= InternalConstants.DEFAULTENCODING;
-			}
-			
-		}
-		
-		private function parseEncoding(lineContent:String, lineNumber:int):Boolean {
-			var result:String;
-			/* parse in the name of the character set used by the .dict and .aff */
-			if ( (result=parseStringAttribute("SET",lineContent)) != null ){
-				if ( _attrMgr.encoding != null ) {
-					//"error: line xxx: multiple definitions"
-					logger.error("Rule File[{0}] Operation[parsing] Error[multiple definitions] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}else{ 
-					result = getEncodingByString( result );
-					if ( result == "" ) {
-						logger.fatal("Rule File[{0}] Operation[parsing] Error[unsupported encoding] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent);
-						result = InternalConstants.DEFAULTENCODING;
-					}
-					_attrMgr.encoding = result;
-				}
-				return true;
-			}
-			return false;
-		}
-
-
-		private function parseMapTable( lineContent:String, lineContentArray:Array, lineNumber:int ) :int {
-			var res:int = 0;
-			if ( !testKeyString("MAP",lineContent)  )
-				return res;
-			var seperatorPattern:RegExp = /[\t ]+/;
-			if ( _attrMgr.mapFilterTable.length != 0 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[multiple definitions] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			/*
-			MAP number_of_map_definitions
-			MAP string_of_related_chars
-				We can define language-dependent information on characters that should be considered related (ie. nearer than other chars not in the set) in the affix file (.aff) by a character map table. With this table, Hunspell can suggest the right forms for words, which incorrectly choose the wrong letter from a related set more than once in a word. 
-			For example a possible mapping could be for the German umlauted ü versus the regular u; the word Frühstück really should be written with umlauted u's and not regular ones
-			MAP 1
-			MAP uü
-			word support in spell checking (forbidding generated compound words, if they are also simple words with typical fault). 
-			*/
-			var strArr:Array = lineContent.split(seperatorPattern);
-			if ( strArr == null || strArr.length < 2 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			var numberOfEntries:int = snp.parse(strArr[1]); 
-			var parsedLines:int = 0;
-			lineNumber++;
-			while( lineNumber < lineContentArray.length && parsedLines<numberOfEntries ) {
-				lineContent = lineContentArray[lineNumber];
-				lineNumber++;
-				parsedLines++;
-				strArr = lineContent.split(seperatorPattern);
-				if ( strArr == null || (strArr.length < 2) ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				if ( strArr[0]!="MAP" ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				var mapString:String =strArr[1];
-				/* special handling for the rule file include mixed-case mapping string:
-					MAP 5
-					MAP aáAÁ
-					MAP eéEÉ
-					MAP iíIÍ
-					MAP oóOÓ
-					MAP uúüUÚÜ
-				*/
-				var capaType:int = StringUtils.getCapType(mapString);
-				if ( capaType == InternalConstants.ALLCAP ||  capaType == InternalConstants.NOCAP ) {
-					_attrMgr.addMapFilter(mapString);
-				}else {
-					var upperStr:String="";
-					var lowerStr:String=""; 
-					for ( var i:int=0;i< mapString.length;++i ) {
-						if ( mapString.charAt(i) != mapString.charAt(i).toLocaleUpperCase() ) {
-							lowerStr+=mapString.charAt(i);
-						}else {
-							upperStr+=mapString.charAt(i);
-						}
-					}
-					_attrMgr.addMapFilter(upperStr);
-					_attrMgr.addMapFilter(lowerStr);
-				}
-			}
-			if ( parsedLines != numberOfEntries ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			return (numberOfEntries);
-			
-		}
-		
-		private function parseReplaceTable( lineContent:String, lineContentArray:Array, lineNumber:int ) :int {
-			var res:int = 0;
-			if ( !testKeyString("REP",lineContent)  )
-				return res;
-			var seperatorPattern:RegExp = /[\t ]+/;
-			if ( _attrMgr.simpleFilterTable.length != 0 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			/*
-			REP number_of_replacement_definitions
-			REP what replacement
-			    We can define language-dependent phonetic information in the affix file (.aff) by a replacement table. 
-			    First REP is the header of this table and one or more REP data line are following it. With this table, 
-			    Hunspell can suggest the right forms for the typical faults of spelling when the incorrect form differs 
-			    by more, than 1 letter from the right form. For example a possible English replacement table definition 
-			    to handle misspelled consonants: 
-			REP 8
-			REP f ph
-			REP ph f
-			REP f gh
-			REP gh f
-			REP j dg
-			REP dg j
-			REP k ch
-			REP ch k
-			Replacement table is also usable in robust morphological analysis (accepting bad forms) or stricter compound 
-			word support in spell checking (forbidding generated compound words, if they are also simple words with typical fault). 
-			*/
-			var strArr:Array = lineContent.split(seperatorPattern);
-			if ( strArr == null || strArr.length != 2 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			var numberOfEntries:int = snp.parse(strArr[1]); 
-			var parsedLines:int = 0;
-			lineNumber++;
-			while( lineNumber < lineContentArray.length && parsedLines<numberOfEntries ) {
-				lineContent = lineContentArray[lineNumber];
-				lineNumber++;
-				parsedLines++;
-				strArr = lineContent.split(seperatorPattern);
-				if ( strArr == null || (strArr.length != 3) ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				if ( strArr[0]!="REP" ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				var matchString:String =strArr[1];
-				var replacement:String =strArr[2];
-				_attrMgr.addSimpleFilter(matchString,replacement);
-			}
-			if ( parsedLines != numberOfEntries ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			return (numberOfEntries);
-		}
-		
-		/*---------parse phone table
-		Param: Line content, lince content array, and line number
-		Return: number of parsed lines
-		*/
-/*		private function parsePhoneTable( lineContent:String, lineContentArray:Array, lineNumber:int ) :int {
-			var res:int = 0;
-			if ( !testKeyString("PHONE",lineContent)  )
-				return res;
-			var seperatorPattern:RegExp = /[\t ]+/;
-			if ( _attrMgr.phoneTable ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			
-			PHONE number_of_phone_definitions
-			PHONE what replacement
-			PHONE uses a table-driven phonetic transcription algorithm borrowed from Aspell. It is useful for
-			languages with not pronunciation based orthography. You can add a full alphabet conversion and
-			other rules for conversion of special letter sequences. For detailed documentation see
-			http://aspell.net/man-html/Phonetic-Code.html. Note: Multibyte UTF-8 characters have not
-			worked with bracket expression yet. Dash expression has signed bytes and not UTF-8 characters
-			yet.
-			
-			var strArr:Array = lineContent.split(seperatorPattern);
-			if ( strArr == null || strArr.length != 2 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			var numberOfEntries:int = snp.parse(strArr[1]); 
-			var parsedLines:int = 0;
-			lineNumber++;
-			//now parse the remaining lines
-			while( lineNumber < lineContentArray.length && parsedLines<numberOfEntries ) {
-				lineContent = lineContentArray[lineNumber];
-				lineNumber++;
-				parsedLines++;
-				strArr = lineContent.split(seperatorPattern);
-				if ( strArr == null || (strArr.length != 3) ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				if ( strArr[0]!="PHONE" ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				var matchString:String =strArr[1];
-				var replacement:String =strArr[2];
-				_attrMgr.phoneTable.addPhoneticFilter(matchString,replacement);//TODO: edit this
-			}
-			if ( parsedLines != numberOfEntries ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			return (numberOfEntries);
-		}
-*/		//---------parse phone table ends----//
-		
-		//---------parse conv table starts
-		private function parseConvTable( lineContent:String, lineContentArray:Array, lineNumber:int ) :int {
-			var res:int = 0;
-			var ioflag:Boolean;
-			var convTable:Array;
-			if(testKeyString("ICONV",lineContent)!=false){
-			//do for iconvtable	
-			ioflag=true;
-			convTable=_attrMgr.iconvFilterTable;
-			}
-			else if(testKeyString("OCONV",lineContent)!=false){
-			//do for oconvtable
-			ioflag=false;
-			convTable=_attrMgr.oconvFilterTable;
-			}
-			else return res;
-			
-			var seperatorPattern:RegExp = /[\t ]+/;
-			if ( (!convTable)||(convTable && convTable.length != 0 )) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			/*ICONV number_of_ICONV_definitions
-			ICONV pattern pattern2
-			Define input conversion table.
-			OCONV number_of_OCONV_definitions
-			OCONV pattern pattern2
-			Define output conversion table.
-			*/
-			var strArr:Array = lineContent.split(seperatorPattern);
-			if ( strArr == null || strArr.length != 2 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			var numberOfEntries:int = snp.parse(strArr[1]); 
-			var parsedLines:int = 0;
-			lineNumber++;
-			while( lineNumber < lineContentArray.length && parsedLines<numberOfEntries ) {
-				lineContent = lineContentArray[lineNumber];
-				lineNumber++;
-				parsedLines++;
-				strArr = lineContent.split(seperatorPattern);
-				if ( strArr == null || (strArr.length != 3) ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				if ( strArr[0]!="REP" ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				var matchString:String =strArr[1];
-				var replacement:String =strArr[2];
-				_attrMgr.addConvFilter(matchString,replacement,ioflag);//todo
-			}
-			if ( parsedLines != numberOfEntries ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			return (numberOfEntries);
-		}
-		//--parse Convtable ends
-		//--parse BreakTable starts
-		private function parseBreakTable( lineContent:String, lineContentArray:Array, lineNumber:int ) :int {
-			var res:int = 0;
-			if( !testKeyString("BREAK",lineContent) )
-				return res;
-			
-			var seperatorPattern:RegExp = /[\t ]+/;
-			if ( _attrMgr && _attrMgr.breakTable && _attrMgr.breakTable.length != 0 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			/*
-			BREAK number_of_break_definitions
-			BREAK character_or_character_sequence
-			Define new break points for breaking words and checking word parts separately. Use ˆ and $ to
-			delete characters at end and start of the word. Rationale: useful for compounding with joining
-			character or strings (for example, hyphen in English and German or hyphen and n-dash in Hungarian).
-			Dashes are often bad break points for tokenization, because compounds with dashes may
-			contain not valid parts, too.) With BREAK, Hunspell can check both side of these compounds,
-			breaking the words at dashes and n-dashes:
-			BREAK 2
-			BREAK -
-			BREAK -- # n-dash
-			*/
-			var strArr:Array = lineContent.split(seperatorPattern);
-			if ( strArr == null || strArr.length != 2 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			var numberOfEntries:int = snp.parse(strArr[1]); 
-			var parsedLines:int = 0;
-			lineNumber++;
-			while( lineNumber < lineContentArray.length && parsedLines<numberOfEntries ) {
-				lineContent = lineContentArray[lineNumber];
-				lineNumber++;
-				parsedLines++;
-				strArr = lineContent.split(seperatorPattern);
-				if ( strArr == null || (strArr.length != 2) ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				if ( strArr[0]!="BREAK" ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-			if(_attrMgr.breakTable)	_attrMgr.breakTable.push(strArr[1]);
-			}
-			if ( parsedLines != numberOfEntries ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			return (numberOfEntries);
-		}
-		//--parse Breaktable Endas
-		
-		private function parseAffix(lineContent:String, lineContentArray:Array, lineNumber:int ) : int {
-			var res:int = 0;
-			if ( !testKeyString("PFX",lineContent) && !testKeyString("SFX",lineContent) )
-				return res;
-			var seperatorPattern:RegExp = /[\t ]+/;
-			var slashInsidePattern:RegExp = /^(.+)\/(.+)$/
-			
-			var resStrArr:Array;
-			
-			/* 
-			Affix classes are signed with affix flags. The first line of an affix class definition is the header. The fields of an affix class header:
-			(0) Option name (PFX or SFX)
-			(1) Flag (name of the affix class)
-			(2) Cross product (permission to combine prefixes and suffixes). Possible values: Y (yes) or N (no)
-			(3) Line count of the following rules. 
-			*/
-			var strArr:Array = lineContent.split( seperatorPattern );
-			if ( strArr == null || strArr.length < 4 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			// piece 1 - is type of affix
-			var atype:int = (strArr[0]=="PFX") ? 0 : 1;
-			 // piece 2 - is affix char
-			var aflag:int = decodeFlag( strArr[1], this._attrMgr.flagMode );
-			// piece 3 - is cross product indicator 
-			var aPermission:Boolean = (strArr[2]=="Y") ? true : false;
-			// piece 4 - is number of affentries
-			var numberOfEntries:int = snp.parse(strArr[3]); 
-			var stripStr:String;
-			var affixStr:String;
-			var conditionsStr:String;
-			var morphStr:String;
-			var conditionPattern:RegExp;
-			var contclass:String;
-			
-			if ( numberOfEntries == 0 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			
-			var parsedLines:int = 0;
-			lineNumber++;
-			while( lineNumber < lineContentArray.length && parsedLines<numberOfEntries ) {
-				var warnFlag:Boolean = false;
-				lineContent = lineContentArray[lineNumber];
-				lineNumber++;
-				parsedLines++;
-				/*
-				Fields of an affix rules:
-				(0) Option name
-				(1) Flag
-				(2) stripping characters from beginning (at prefix rules) or end (at suffix rules) of the word
-				(3) affix (optionally with flags of continuation classes, separated by a slash)
-				(4) condition.
-				Zero stripping or affix are indicated by zero. Zero condition is indicated by dot. Condition is a simplified, regular expression-like pattern, which must be met before the affix can be applied. (Dot signs an arbitrary character. Characters in braces sign an arbitrary character from the character subset. Dash hasn’t got special meaning, but circumflex (^) next the first brace sets the complementer character set.)
-				(5) Optional morphological fields separated by spaces or tabulators. 				
-				*/
-				strArr = lineContent.split(seperatorPattern);
-				if ( strArr == null || (strArr.length < 5) ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				// piece 1 - is type of affix
-				var aatype:int = (strArr[0]=="PFX") ? 0 : 1;
-				if ( aatype != atype ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				 // piece 2 - is affix char
-				var aaflag:int = decodeFlag( strArr[1],this._attrMgr.flagMode );
-				if ( aaflag != aflag ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				// piece 3 - is string to strip or 0 for null 
-				stripStr = strArr[2];
-				if ( stripStr == "0" ) stripStr="";
-				
-				/*complex affix bof*/
-				if ( (resStrArr=stripStr.match(slashInsidePattern)) != null ) {
-					stripStr = resStrArr[1];
-					warnFlag = true;
-					logger.warn("Rule File[{0}] Operation[parsing] Warn[complex affix] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				/*complex affix eof*/
-				
-				// piece 4 - is affix string or 0 for null
-				/*complex affix bof*/
-				if (strArr[3] && (resStrArr=strArr[3].match(slashInsidePattern)) != null ) //if contclass in Affix Rules
-				{
-					if(this._attrMgr && this._attrMgr.aliasfTable && this._attrMgr.aliasfTable.length>0)//if AF rule 
-					{
-						affixStr = resStrArr[1];
-						contclass=this._attrMgr.aliasfTable[parseInt(resStrArr[2],10)-1];
-					}
-					else// If not AF rule
-					{
-						affixStr =resStrArr[1];
-						contclass=decodeFlags(resStrArr[2],this._attrMgr.flagMode);
-						
-					}
-					
-					this._attrMgr.haveContClass=true;
-					
-					for(var i:int=0;i<contclass.length; i++ )//record the possible contclass in possible contclass array
-						this._attrMgr.contClasses[contclass.charCodeAt(i)]=true;
-				}
-				else
-				{
-					affixStr=strArr[3];
-					contclass=null;
-				}
-				if ( affixStr == "0" ) affixStr="";
-				if ( _attrMgr.ignoredChars != null ) StringUtils.removeIgnoredChars(affixStr, _attrMgr.ignoredChars );
-				/*complex affix eof*/
-
-
-				
-				// piece 5 - is the conditions descriptions
-				conditionsStr = strArr[4];
-				if ( conditionsStr.length == 0 ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				
-				//piece 6  morph information... ToDo....
-				morphStr = (strArr.length == 6) ? strArr[5]: "";
-			/*if(contclass && affixStr=="lit")	
-				for(var c:int=0;c<contclass.length;c++){
-				if(_attrMgr.flagMode== InternalConstants.FLAG_LONG)
-					trace(" contclasslong   "+c+"           " + String.fromCharCode(contclass.charCodeAt(c)>>8)+String.fromCharCode(contclass.charCodeAt(c)-((contclass.charCodeAt(c)>>8)<<8)));
-				else
-					trace(" contclassnormal   "+c+"           " + contclass[c]);
-			}*/
-				_attrMgr.addAffixEntry( aflag, stripStr, affixStr, conditionsStr, morphStr, aPermission, atype, contclass );
-				
-			}
-			if ( parsedLines != numberOfEntries ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			
-			return (numberOfEntries);
-		}
-		
-		//-------parseAliasf
-		private function parseAliasf(lineContent:String, lineContentArray:Array, lineNumber:int ) : int {
-			var res:int = 0;
-			if ( !testKeyString("AF",lineContent))
-				return res;
-			var seperatorPattern:RegExp = /[\t ]+/;
-			var slashInsidePattern:RegExp = /^(.+)\/(.+)$/
-			
-			var resStrArr:Array;
-			
-			/* 
-			AF number_of_flag_vector_aliases
-			AF flag_vector
-			Hunspell can substitute affix flag sets with ordinal numbers in affix rules ( compression, see
-			makealias tool). First example with  compression:
-			3
-			hello
-			try/1
-			work/2
-			AF definitions in the affix file:
-			SET UTF-8
-			TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ’
-			AF 2
-			AF A
-			AF AB
-			It is equivalent of the following dic file:
-			3
-			hello
-			try/A
-			work/AB
-			*/
-			var strArr:Array = lineContent.split(seperatorPattern);
-			if ( strArr == null || strArr.length != 2 ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			var numberOfEntries:int = snp.parse(strArr[1]); 
-			var parsedLines:int = 0;
-			lineNumber++;
-			while( lineNumber < lineContentArray.length && parsedLines<numberOfEntries ) {
-				lineContent = lineContentArray[lineNumber];
-				lineNumber++;
-				parsedLines++;
-				strArr = lineContent.split(seperatorPattern);
-				if ( strArr == null || (strArr.length != 2) ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				if ( strArr[0]!="AF" ) {
-					logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-				}
-				//Decode Flags and store as long numbers. In normal case without AF rule we do this step later. Here we are decoding and storing the flags.
-				var flags:String=decodeFlags(strArr[1],this._attrMgr.flagMode);
-				_attrMgr.aliasfTable.push(flags);
-			}
-			if ( parsedLines != numberOfEntries ) {
-				logger.error("Rule File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			}
-			return (numberOfEntries);
-		}
-		//--------parseAliasf
-		//------decodeflags
-		/*
-		* Squiggly is using utf16 by default...
-		* for utf8 string conversion,we need extra work later.
-		* we might also need a better toString() fuction for Flag_long and flag_num mode.
-		*/
-		private function decodeFlags(flags:String, flagMode:int):String {
-			var result:String="";
-			var i:int;
-			switch ( flagMode )  {
-				case InternalConstants.FLAG_LONG:
-					if ( (flags.length)%2 == 1 ) {
-						logger.error("Dictionary File[{0}] Operation[parsing] Error[decoding error] target flags:{1}",this._rulePath , flags );
-						throw new ContentError(ErrorTable.CONTENTPARSINGERROR_MSG,ErrorTable.CONTENTPARSINGERROR_ID);
-					}
-					var len:int = flags.length/2;
-					for ( i = 0; i< len; ++i ) {
-						result +=  String.fromCharCode( ((flags.charCodeAt((i * 2))) << 8) + (flags.charCodeAt((i * 2 + 1))) );
-					}
-					break;
-				case InternalConstants.FLAG_NUM:
-					var strArr:Array = flags.split(",");
-					for ( i = 0;i< strArr.length;++i) {
-						var num:Number = snp.parse(strArr[i]);
-						if ( num >= InternalConstants.DEFAULTFLAGS ) {
-							logger.error("Dictionary File[{0}] Operation[parsing] Error[decoding error] target flags:{1}",this._rulePath , flags );
-						}
-						result += String.fromCharCode(num);
-					}
-					break;
-				case InternalConstants.FLAG_UNI:
-					result = flags;
-					break;
-				default:
-					result = flags;
-					break;
-			}
-			return result;
-		}
-//-----------decode flags ends
-		
-		
-		private function decodeFlag( flagString:String, flag_mode:int=InternalConstants.FLAG_CHAR  ) : int {
-			var s:int;
-			var i:int;
-			switch ( flag_mode ) {
-				case InternalConstants.FLAG_LONG:
-					if ( flagString.length != 2 ) {
-						logger.error("Rule File[{0}] Operation[decodeFlag] Error[Unknown Flags] The length of flag id {1} is not equal 2.",this._rulePath , flagString);
-					}
-					s = ( flagString.charCodeAt(0) << 8) + flagString.charCodeAt(1);
-					break;
-				case InternalConstants.FLAG_NUM:
-					i = snp.parse(flagString);
-					if (i >= InternalConstants.DEFAULTFLAGS) {
-						logger.error("Rule File[{0}] Operation[decodeFlag] Error[Unknown Flags] flag id {1} is too large (max: {2})",this._rulePath , i.toString(),InternalConstants.DEFAULTFLAGS.toString() );
-					}
-					s = i;
-					break;
-				case InternalConstants.FLAG_UNI: // utf-8
-				default:
-					s = flagString.charCodeAt(0);
-			}
-			return s;
-		}
-
-		private function parseFlagMode(lineContent:String, lineNumber:int):Boolean {
-			var result:String;
-			/* parse in the name of the character set used by the .dict and .aff */
-			if ( (result=parseStringAttribute("FLAG",lineContent)) != null ){
-	            if (result == "long") _attrMgr.flagMode = InternalConstants.FLAG_LONG;
-	            if (result == "num") _attrMgr.flagMode = InternalConstants.FLAG_NUM;
-	            if (result == "UTF-8") _attrMgr.flagMode = InternalConstants.FLAG_UNI;
-	            if ( result == "char" ) _attrMgr.flagMode = InternalConstants.FLAG_CHAR;
-				return true;
-			}
-			return false;
-		}
-
-
-		private function parseAttribute(lineContent:String, lineNumber:int):Boolean {
-			var result:String;
-			
-			/* parse in the name of the character set used by the .dict and .aff */
-			if ( parseFlagMode(lineContent,lineNumber) ){
-				return true;
-			}
-			
-			 /* parse in the keyboard string */
-			if ( (result=parseStringAttribute("KEY",lineContent)) != null ){
-				_attrMgr.keyString = result;
-				return true;
-			}
-			
-			/* parse in the try string */
-			if ( (result=parseStringAttribute("TRY",lineContent)) != null ){
-				if ( _attrMgr.tryString != null ) {
-					//"error: line %d: multiple definitions\n"
-					throw new ContentError(ErrorTable.CONTENTPARSINGERROR_MSG,ErrorTable.CONTENTPARSINGERROR_ID); 
-				}else _attrMgr.tryString = result;
-				return true;
-			}
-			
-			/* parse in the name of the character set used by the .dict and .aff */
-			if ( (result=parseStringAttribute("SET",lineContent)) != null ){
-				return true;
-			}
-			
-			/* parse in the noSuggest flag */
-			if ( (result=parseStringAttribute("NOSUGGEST",lineContent)) != null ){
-			//	_attrMgr.noSuggest = result.charCodeAt(0); //Depreceated old function, had to be changed for supporting FLAG_LONG
-				_attrMgr.noSuggest = decodeFlag(result, this._attrMgr.flagMode);
-
-				return true;
-			}
-			
-			/* parse in the flag used by forbidden words */
-			if ( (result=parseStringAttribute("FORBIDDENWORD",lineContent)) != null ){
-				//_attrMgr.forbiddenWord = result.charCodeAt(0);//Depreceated old function, had to be changed for supporting FLAG_LONG
-				_attrMgr.forbiddenWord = decodeFlag(result, this._attrMgr.flagMode);
-
-				return true;
-			}
-
-			 /* parse in the ignored characters (for example, Arabic optional diacretics charachters */
-			if ( (result=parseStringAttribute("IGNORE",lineContent)) != null ){
-				if ( _attrMgr.ignoredChars != null ) {
-					//"error: line %d: multiple definitions\n"
-					throw new ContentError(ErrorTable.CONTENTPARSINGERROR_MSG,ErrorTable.CONTENTPARSINGERROR_ID); 
-				}else _attrMgr.ignoredChars = result;
-				return true;
-			}
-
-			/* parse in the extra word characters */
-			if ( (result=parseStringAttribute("WORDCHARS",lineContent)) != null ){
-				if ( _attrMgr.wordChars != null ) {
-					//"error: line %d: multiple definitions\n"
-					throw new ContentError(ErrorTable.CONTENTPARSINGERROR_MSG,ErrorTable.CONTENTPARSINGERROR_ID); 
-				}else _attrMgr.wordChars = result;
-				return true;
-			}
-			
-			/* parse in the language for language specific codes */
-			if ( (result=parseStringAttribute("LANG",lineContent)) != null ){
-				if ( _attrMgr.languageCode != null ) {
-					//"error: line %d: multiple definitions\n"
-					throw new ContentError(ErrorTable.CONTENTPARSINGERROR_MSG,ErrorTable.CONTENTPARSINGERROR_ID); 
-				}else {
-					_attrMgr.languageCode = result;
-					//langnum = get_lang_num(lang);
-				}
-				return true;
-			}
-			
-			/* parse in the version */
-			if ( (result=parseStringAttribute("VERSION",lineContent)) != null ){
-				_attrMgr.version = result;
-				return true;
-			}
-
-			if ( (result=parseStringAttribute("MAXNGRAMSUGS",lineContent)) != null ){
-				_attrMgr.maxNgramSuggestions = snp.parse(result);
-				return true;
-			}
-			
-			if ( testKeyString("NOSPLITSUGS",lineContent) ) {
-				_attrMgr.nosplitSuggestions = 1;
-			}
-			
-			if ( testKeyString("SUGSWITHDOTS",lineContent) ) {
-				_attrMgr.suggestionsWithDots = 1;
-			}
-			
-			if ( testKeyString("FULLSTRIP",lineContent) ) {
-				_attrMgr.fullStrip = 1;
-			}
-			/* parse in the noSuggest flag */
-			if ( (result=parseStringAttribute("KEEPCASE",lineContent)) != null ){
-				//_attrMgr.keepCase = result.charCodeAt(0);//Depreceated old function, had to be changed for supporting FLAG_LONG
-				_attrMgr.keepCase = decodeFlag(result, this._attrMgr.flagMode);
-				return true;
-			}
-			
-			/*parse in the CIRCUMFIX flag*/
-			if ( (result=parseStringAttribute("CIRCUMFIX",lineContent)) != null ){
-			//	_attrMgr.circumfix =result.charCodeAt(0);//Depreceated old function, had to be changed for supporting FLAG_LONG
-				_attrMgr.circumfix =decodeFlag(result, this._attrMgr.flagMode);
-				return true;
-			}
-			/*parse in the NEEDAFFIX flag*/
-			if ( (result=parseStringAttribute("NEEDAFFIX",lineContent)) != null ){
-				//_attrMgr.needAffix = result.charCodeAt(0); ////Depreceated old function, had to be changed for supporting FLAG_LONG
-				_attrMgr.needAffix = decodeFlag(result, this._attrMgr.flagMode);
-				return true;
-			}
-			
-		return false;
-		}
-		
-		private function parseStringAttribute(key:String, lineContent:String):String {
-			if ( lineContent == null || key == null ) return null;
-			var keyPattern:RegExp = new RegExp("^"+key+"[\\t ]+(.+)$");
-			var parseArr:Array;
-			if ( (parseArr=lineContent.match(keyPattern)) != null ) {
-				return parseArr[1];
-			}		
-			return null;
-		}
-		
-		private function testKeyString(key:String,lineContent:String):Boolean {
-			if ( key == null ) return false;
-			var keyPattern:RegExp = new RegExp("^"+key+".*$");
-			return keyPattern.test( lineContent );
-		}
-
-		private function isCommentOrEmpty(lineContent:String):Boolean{
-			var str:String = lineContent;
-			str = StringUtils.trim( lineContent);
-			if ( str == "" ) return true;
-			if ( testKeyString("#",str) ) return true;
-			return false;
-		}
-
-		private function getEncodingByString(key:String):String {
-			var result:String = "";
-			var keyEncodingTable:Object = {"UTF-8":"utf-8", "ISO8859-1":"iso-8859-1","ISO8859-2":"iso-8859-2","ISO8859-3":"iso-8859-3",
-			"ISO8859-4":"iso-8859-4","ISO8859-5":"iso-8859-5","ISO8859-6":"iso-8859-6","ISO8859-7":"iso-8859-7","ISO8859-8":"iso-8859-8",
-			"ISO8859-9":"iso-8859-9", "ISO8859-15":"iso-8859-15", "KOI8-R":"koi8-r", "KOI8-U":"koi8-u", "microsoft-cp1251":"windows-1251", 
-			"ISCII-DEVANAGARI":"x-iscii-de"};
-			var unsupportedTable:Object = {"ISO8859-10":"", "ISO8859-13":""};
-			if ( key == null ) return InternalConstants.DEFAULTENCODING;
-			
-			if ( keyEncodingTable[key] == undefined || keyEncodingTable[key] == "" ) return result;
-			result = keyEncodingTable[key];
-			
-			return result;
-		}
-
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/MathUtils.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/MathUtils.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/MathUtils.as
deleted file mode 100644
index 2c79756..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/MathUtils.as
+++ /dev/null
@@ -1,66 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.core.utils
-{
-	public class MathUtils
-	{
-		/**
-		 *  Return next prime; assume N >= 10 
-		 */
-		public static function nextPrime( N:int ):int
-		{
-			var i:int;
-			var continueFlag:Boolean;
-			if( N % 2 == 0 )
-				N++;
-			for( ; ; N += 2 )
-			{
-				continueFlag = false;
-				for( i = 3; i * i <= N; i += 2 )
-					if( N % i == 0 ) {
-						continueFlag = true;    //Sorry about this!
-						break;
-					}
-				if ( continueFlag ) continue;
-				return N;
-			}
-			return -1; // failure branch... it should never happen.
-		}
-
-		/**
-		 * Rounds a number to a specific number of decimal places.
-		 */
-		public static function roundPrecision(number:Number, precision:int=0):Number
-		{
-			var places:Number = Math.pow(10, precision);
-			return Math.round(places * number) / places;
-		}
-
-		/**
-		 * Generates a random number between two number values.
-		 */
-		public static function randomBetween(min:Number=0, max:Number=99999999, precision:int=0):Number
-		{
-			return roundPrecision(Math.random() * (max - min) + min, precision);
-		}
-
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/RefObject.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/RefObject.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/RefObject.as
deleted file mode 100644
index ef1a99d..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/RefObject.as
+++ /dev/null
@@ -1,36 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.core.utils
-{
-	public class RefObject
-	{
-		private var _ref:int;
-		public function RefObject(value:int) {
-			this._ref = value;
-		}
-		public function set ref(v:int):void {
-			this._ref = v;
-		}
-		public function get ref():int {
-			return this._ref;
-		}
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SimpleNumberParser.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SimpleNumberParser.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SimpleNumberParser.as
deleted file mode 100644
index 29bdc4b..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SimpleNumberParser.as
+++ /dev/null
@@ -1,54 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.core.utils
-{
-	/*
-	 * A simple number parsing class...
-	 */
-	public class SimpleNumberParser
-	{
-		private var numberPattern:RegExp = /^((\d+,?)*\d+)?\.?\d*$|^[-+]?\d+\.?\d*[eE]{1}[-+]?\d+$/;
-		private var negativePattern:RegExp = /^-[ ]?([0-9\.,]+)$|^([0-9\.,]+)[ ]?-$|^\([ ]?([0-9\.,]+)[ ]?\)$/;
-		private var _decimalSymbol:String, _grouppingSymbol:String;
-		
-		public function SimpleNumberParser(decimalSymbol:String=".", grouppingSymbol:String=",")
-		{
-			this._decimalSymbol = decimalSymbol; this._grouppingSymbol = grouppingSymbol;
-		}
-		
-		public function parse(inputString:String):Number {
-			var neg:int = 1;
-			inputString= inputString.split(_decimalSymbol).join("."); 
-			inputString= inputString.split(_grouppingSymbol).join(",");
-			inputString= StringUtils.trim(inputString);
-			if ( negativePattern.test(inputString) ) {
-				var result:Array = inputString.match( negativePattern );
-				for ( var i:int = 1; i < result.length; i++ )
-					if ( result[i]!= undefined ) break;
-				inputString= result[i];
-				neg=-1;
-			}
-			if ( !numberPattern.test( inputString ) ) return NaN;
-			inputString= inputString.split(_grouppingSymbol).join(""); 
-			return (new Number(inputString))*neg;
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SquigglyDictionaryLoader.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SquigglyDictionaryLoader.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SquigglyDictionaryLoader.as
deleted file mode 100644
index e97000c..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SquigglyDictionaryLoader.as
+++ /dev/null
@@ -1,369 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.core.utils
-{
-	import com.adobe.linguistics.spelling.core.LinguisticRule;
-	import com.adobe.linguistics.spelling.core.SquigglyDictionary;
-	import com.adobe.linguistics.spelling.core.env.InternalConstants;
-	import com.adobe.linguistics.spelling.core.error.*;
-	import com.adobe.linguistics.spelling.core.logging.*;
-	
-	import flash.errors.IllegalOperationError;
-	import flash.events.ErrorEvent;
-	import flash.events.Event;
-	import flash.events.EventDispatcher;
-	import flash.events.IOErrorEvent;
-	import flash.events.SecurityErrorEvent;
-	import flash.net.URLRequest;
-	import flash.utils.*;
-	public class SquigglyDictionaryLoader extends EventDispatcher
-	{
-		private var _dict:SquigglyDictionary;
-		private var _dictionaryPath:String;
-		private var _attrMgr:LinguisticRule;
-
-
-		private var snp:SimpleNumberParser = new SimpleNumberParser();
-
-		//setup logger for sending message.
-		private var className:String = flash.utils.getQualifiedClassName(this).split("::").join(".");
-		private var logger:ILogger = Log.getLogger( className );
-		//vars shifted up
-        private var wordList:Array;
-		private var dp:String;//description;
-		private var ts:String;
-		private var ap:String;
-		private var flags:String;
-		
-		private var dpPattern1:RegExp; 	//patterns to split rule line into fileds according to new morphological field separator
-		private var dpPattern2:RegExp;	//patterns to split rule line into fileds according to old morphological field separator
-		private var tsPattern1:RegExp;	//extracts the affix string
-		private var strArr:Array;
-		private var lineContent:String;
-		private var totalPart:int;
-		private var delay:int;
-		//vars shifted up
-		
-		//variables added to accomodate property
-		private var _enableDictionarySplit:Boolean;
-		private var _wordsPerDictionarySplit:int;
-		
-		public function SquigglyDictionaryLoader()
-		{
-			_dict = null;
-			_dictionaryPath = null;
-			_attrMgr = null;
-			dpPattern1= /^(.+)[ \t]+.{2}:(.+)$/ ; 	//patterns to split rule line into fileds according to new morphological field separator
-			dpPattern2= /^(.+)[\t]{1}(.+)$/ ; 		//patterns to split rule line into fileds according to old morphological field separator
-			tsPattern1= /^(.*[^\\])\/(.+)$/ ; 
-			delay=InternalConstants.DICT_LOAD_DELAY; //the timeout period between two parts 10 ms
-		}
-		
-		public function set linguisticRule(value:LinguisticRule):void {
-			this._attrMgr = value;
-		}
-		
-		public function get linguisticRule():LinguisticRule {
-			return this._attrMgr;
-		}
-		
-		public function load(dictionaryURL:String,enableDictionarySplit:Boolean,wordsPerDictionarySplit:int):void {
-			if ( dictionaryURL == null ) {
-				throw new IllegalOperationError("load function did not receive two valid URLs.");
-			}
-			_dictionaryPath = dictionaryURL;
-			_enableDictionarySplit=enableDictionarySplit;
-			_wordsPerDictionarySplit=wordsPerDictionarySplit;
-			var request:URLRequest = new URLRequest( _dictionaryPath );
-			var dloader:DictionaryLoader = new DictionaryLoader(request);
-			dloader.addEventListener(Event.COMPLETE,loadDictionaryComplete);
-			dloader.addEventListener(IOErrorEvent.IO_ERROR,handleError);
-			dloader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,handleError);
-			
-		}
-
-		//Private method to dispatch an error event.
-		private function handleError(evt:Event):void {
-			bounceEvent(evt);
-		}
-		private function bounceEvent(evt:Event):void {
-			dispatchEvent(evt.clone());
-		}
-
-
-		public function get squigglyDictionary():SquigglyDictionary {
-			return  _dict;
-		}
-		
-		private function loadDictionaryComplete(evt:Event):void {
-			_dict = new SquigglyDictionary(_attrMgr);
-
-			var bytes:ByteArray = evt.target.data;
-			//trace("load complete handler: "+getTimer()+" "+bytes.bytesAvailable);
-			var charSet:String;
-			if ( _attrMgr ) {
-				charSet = _attrMgr.encoding;
-			}else {
-				charSet = InternalConstants.DEFAULTENCODING;
-			}
-			var str:String = 	bytes.readMultiByte(bytes.length, charSet);
-			//trace("Bytes read at: "+getTimer());
-
-			/*
-			In DOS, a line break is a single '\n'.
-			In Unix, a line break is the sequence '\r\n'.
-			In MAC, a line break is a single '\r'.
-			Correct me if I'm wrong.
-			so step 1:
-			replace "\r\n" with "\n"
-			step 2:
-			replace "\r" with "\n";
-			finally ,we get "\n" line seperator.
-			*/
-			str=str.split("\r\n").join("\n");
-			str=str.split("\r").join("\n");
-			wordList= str.split("\n");
-			//bof of parsing the text.
-			//trace("Wordlist length: "+wordList.length);
-			if(wordList== null ) {
-				logger.error("Dictionary File[{0}] Operation[parsing] Error[corrupt data]",this._dictionaryPath);
-			}
-			if(wordList.length== 1){
-				logger.error("Dictionary File[{0}] Operation[parsing] Error[corrupt data]",this._dictionaryPath );
-//				logger.error("Dictionary File[{0}] Operation[parsing] Error[corrupt data] Line Number:{1}, Content:{2}",this._rulePath , (lineNumber+1).toString(),lineContent );
-			} 
-			//fix for 	Bug #: 	2855795 now if greater load to a max of wordList.length
-			if(wordList.length<this._wordsPerDictionarySplit){
-				this._wordsPerDictionarySplit=wordList.length;				
-			}
-			
-			/* remove byte order mark */
-			if ( wordList[0].match(new RegExp("^\xEF\xBB\xBF[.]+$") ) ) wordList[0]=wordList[0].substr(3);
-			var snp:SimpleNumberParser = new SimpleNumberParser();
-			/* get the table size */
-			var tablesize:int = snp.parse(wordList[0]);
-			if (tablesize == 0) throw new ContentError(ErrorTable.CONTENTPARSINGERROR_MSG,ErrorTable.CONTENTPARSINGERROR_ID);
-			
-			//trace("Before parsing: "+getTimer());
-			
-			if(this._enableDictionarySplit ){
-				setTimeout(loadWithTimeouts,1,1);//go to loadWithTimeouts
-			}
-			else
-			{	
-				setTimeout(loadWithoutTimeouts,1,1);//directly go to finish. This will cause words to load from 1 to wordList.length
-			}
-			
-		}
-	
-		private function loadWithTimeouts(part:int):void	{
-			for( var line:int = part; line<part+(this._wordsPerDictionarySplit)-1; ++line) { 
-				lineContent = wordList[line];
-				/* : is the new morphological field separator */
-				if ( (strArr = lineContent.match(dpPattern1)) != null ) {
-					dp=strArr[2];
-					ts = strArr[1];
-				/* tabulator is the old morphological field separator */
-				}else if ( (strArr = lineContent.match(dpPattern2)) != null ) {
-					ts = strArr[1];
-					dp=strArr[2];
-				}else {
-					ts = lineContent;//so ts has the word and dp has morphological desc
-					dp = null;
-				}
-				
-				ts= StringUtils.trim(ts);
-				if( dp != null ) dp= StringUtils.trim(dp);
-				// eof: split each line into word and morphological description
-
-				// bof:split each line into word and affix char strings
-				/*
-				"\/" signs slash in words (not affix separator)
-				"/" at beginning of the line is word character (not affix separator)
-				*/
-				if ( (strArr = ts.match(tsPattern1))!= null ) {
-					ap = strArr[2]; 
-					ts = strArr[1];
-					ts = ts.split('\\/').join('/');	/* replace "\/" with "/" */
-					if(_attrMgr){
-						if(_attrMgr.aliasfTable && _attrMgr.aliasfTable.length>0)
-						{ 
-						flags=_attrMgr.aliasfTable[parseInt(ap,10)-1];
-						}
-						else
-						{
-						flags = decodeFlags( ap, _attrMgr.flagMode);
-						}
-					}
-/*	
-// Todo, will remove this comments after we have complex-affix support and compound-word support.
-            if (aliasf) {
-                int index = atoi(ap + 1);
-                al = get_aliasf(index, &flags, dict);
-                if (!al) {
-                    HUNSPELL_WARNING(stderr, "error: line %d: bad flag vector alias\n", dict->getlinenum());
-                    *ap = '\0';
-                }
-            } else {
-                al = decode_flags(&flags, ap + 1, dict);
-                flag_qsort(flags, 0, al);
-            }
-*/
-				}else {
-					ap=null;
-					flags=null;
-				}
-				// eof:split each line into word and affix char strings
-				//trace(line+" WORD:"+ts);
-				_dict.addWord( ts, flags, dp );			
-		}
-				
-				if(line+(this._wordsPerDictionarySplit)>=wordList.length)//Last part reached.
-				{
-					setTimeout(loadWithoutTimeouts,delay,line);//the last part left which is less than wordsPerDictionarySplit is loaded w/o Timeouts
-				}
-				else
-				{
-				setTimeout(loadWithTimeouts,delay, line);//get delay of 10 ms
-				}
-			// } //loop ends
-			//eof of parsing the text.
-			//function ends here
-		}
-		
-		/* Squiggly function to end Asynchronous looping
-		*
-		*
-		*/
-		private function loadWithoutTimeouts(line:int):void
-		{
-			for( ; line<wordList.length; ++line) {
-				
-				// bof: split each line into word and morphological description 
-				lineContent = wordList[line];
-				/* : is the new morphological field separator */
-				if ( (strArr = lineContent.match(dpPattern1)) != null ) {
-					dp=strArr[2];
-					ts = strArr[1];
-					/* tabulator is the old morphological field separator */
-				}else if ( (strArr = lineContent.match(dpPattern2)) != null ) {
-					ts = strArr[1];
-					dp=strArr[2];
-				}else {
-					ts = lineContent;
-					dp = null;
-				}
-				ts= StringUtils.trim(ts);
-				if( dp != null ) dp= StringUtils.trim(dp);
-				// eof: split each line into word and morphological description
-				
-				// bof:split each line into word and affix char strings
-				/*
-				"\/" signs slash in words (not affix separator)
-				"/" at beginning of the line is word character (not affix separator)
-				*/
-				if ( (strArr = ts.match(tsPattern1))!= null ) {
-					ap = strArr[2]; 
-					ts = strArr[1];
-					ts = ts.split('\\/').join('/');	/* replace "\/" with "/" */
-					if(_attrMgr)
-					{
-						if(_attrMgr.aliasfTable && _attrMgr.aliasfTable.length>0)
-						{
-						flags=_attrMgr.aliasfTable[parseInt(ap,10)-1];
-						}
-						else
-						{
-						flags = decodeFlags( ap, _attrMgr.flagMode);
-						}
-					}
-					/*
-					// Todo, will remove this comments after we have complex-affix support and compound-word support.
-					if (aliasf) {
-					int index = atoi(ap + 1);
-					al = get_aliasf(index, &flags, dict);
-					if (!al) {
-					HUNSPELL_WARNING(stderr, "error: line %d: bad flag vector alias\n", dict->getlinenum());
-					*ap = '\0';
-					}
-					} else {
-					al = decode_flags(&flags, ap + 1, dict);
-					flag_qsort(flags, 0, al);
-					}
-					*/
-				}else {
-					ap=null;
-					flags=null;
-				}
-				// eof:split each line into word and affix char strings
-				//trace("WORD2:"+ts);
-				_dict.addWord( ts, flags, dp );			
-			}
-			//trace("After Parsing: "+getTimer());
-			logger.info("Dictionary File[{0}] Operation[parsing] Total Lines:{1}, Unrecognized Lines:{2}", this._dictionaryPath ,wordList.length.toString(), 0  );
-			
-			dispatchEvent(new Event(Event.COMPLETE));
-		}
-		
-		
-
-		/*
-		 * Squiggly is using utf16 by default...
-		 * for utf8 string conversion,we need extra work later.
-		 * we might also need a better toString() fuction for Flag_long and flag_num mode.
-		 */
-		private function decodeFlags(flags:String, flagMode:int):String {
-			var result:String="";
-			var i:int;
-			switch ( flagMode )  {
-				case InternalConstants.FLAG_LONG:
-				if ( (flags.length)%2 == 1 ) {
-					logger.error("Dictionary File[{0}] Operation[parsing] Error[decoding error] target flags:{1}",this._dictionaryPath , flags );
-					throw new ContentError(ErrorTable.CONTENTPARSINGERROR_MSG,ErrorTable.CONTENTPARSINGERROR_ID);
-				}
-				var len:int = flags.length/2;
-				for ( i = 0; i< len; ++i ) {
-					result +=  String.fromCharCode( ((flags.charCodeAt((i * 2))) << 8) + (flags.charCodeAt((i * 2 + 1))) );
-				}
-				break;
-				case InternalConstants.FLAG_NUM:
-				var strArr:Array = flags.split(",");
-				for ( i = 0;i< strArr.length;++i) {
-					var num:Number = snp.parse(strArr[i]);
-					if ( num >= InternalConstants.DEFAULTFLAGS ) {
-						logger.error("Dictionary File[{0}] Operation[parsing] Error[decoding error] target flags:{1}",this._dictionaryPath , flags );
-					}
-					result += String.fromCharCode(num);
-				}
-				break;
-				case InternalConstants.FLAG_UNI:
-				result = flags;
-				break;
-				default:
-				result = flags;
-				break;
-			}
-			return result;
-		}
-
-
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/StringUtils.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/StringUtils.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/StringUtils.as
deleted file mode 100644
index 63dba22..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/StringUtils.as
+++ /dev/null
@@ -1,333 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.core.utils
-{
-	import com.adobe.linguistics.spelling.core.env.InternalConstants;
-	public final class StringUtils
-	{
-		
-	    public static function isWhiteSpace( ch:Number ):Boolean {
-	    	// '\r' || '\n' || '\f' || '\t' || ' ' 
-	    	
-	    	return ch == 32 || 
-	    	ch == 32 || 
-	    	ch == 32 || 
-	    	ch == 32 || 
-	    	ch == 32; 
-	    }
-	    public static function isWhiteSpace2( ch:String ):Boolean {
-	    	// '\r' || '\n' || '\f' || '\t' || ' ' 
-	    	
-	    	return ch == '\r' || 
-	    	ch == '\n' || 
-	    	ch == '\f' || 
-	    	ch == '\t' || 
-	    	ch == ' '; 
-	    }
-    
-	    public static function trim( original:String ):String {
-	    	var i:int;
-	    	var start:int=0, end:int=original.length;
-	    	for ( i=0; (i< original.length) && isWhiteSpace(original.charCodeAt(i)) ; ++i ) {
-	    		start++;
-	    	}
-	    	for ( i=end-1; (i>=0) && isWhiteSpace(original.charCodeAt(i)) ; --i) {
-	    		end--;
-	    	}
-	    	return original.substring(start,end);
-	    }
-	    
-		/*
-		 * Deprecated function for now...
-		 * History: 
-		 *          A pre-version of implementation for error detection. After I optimized the code for performance,
-		 *          I drop this function by that time, but you know performance meassuring is a tricky problem... 
-		 * ToDo: Need a revisit when we implementing complex-affix support and compound-word support.
-		 */
-	    public static function trim2( original:String ):String {
-
-	      var characters:Array = original.split( "" );
-	      for ( var i:int = 0; i < characters.length; i++ ) {
-	        if ( isWhiteSpace2( characters[i] ) ) {
-	          characters.splice( i, 1 );
-	          i--;
-	        } else {
-	          break;
-	        }
-	      }
-	      for ( i = characters.length-1; i >= 0; i-- ) {
-	      	if (isWhiteSpace2( characters[i] )) {
-	      		characters.splice( i, 1 );
-	      	}else {
-	      		break;
-	      	}
-	      }
-	      return characters.join("");
-	    }
-	    
-	    /*
-	     * ideally, this function shouldn't be here, we should always get a word without any ill-formed character. 
-	     * ToDo, will create a normalization class in next release....
-	     * Need revisit this function.
-	     */
-	    public static var curlyQuotePattern:RegExp = /[‘’]/;
-	    public static function normalize( value:String ):String {
-	    	var result:String;
-	    	if ( (value.indexOf("‘") == -1) && (value.indexOf("’") == -1) ) return value;
-	    	result = value.replace(curlyQuotePattern,"'");
-	    	return result;
-	    	
-	    }
-	    
-		public static function reverseString(str:String):String {
-			var sTmp:String="";
-			for ( var i:int= str.length -1 ; i >=0 ; i-- ) 
-				sTmp+=str.charAt(i);
-			return sTmp;
-		}
-		
-	    public static function sort(str:String, descending:Boolean= false):String {
-	    	if ( (str==null) || (str.length<=1) ) 
-	    		return str;
-	    	var chars:Array = str.split("");
-	    	if ( descending )
-	    		chars.sort(Array.DESCENDING);
-	    	else
-	    		chars.sort();
-	    	return chars.join("");	
-	    }
-
-		public static function removeIgnoredChars(word:String, ignoreChars:String ) :String {
-			if ( ignoreChars == null || word == null ) return word;
-			for ( var i:int = 0; i< ignoreChars.length ; ++i ) {
-				word.split(ignoreChars[i]).join("");
-			}
-			return word;
-		}
-
-		public static function makeInitCap(word:String):String {
-			return word.charAt(0).toLocaleUpperCase() + word.substr(1);
-		}
-
-		/*
-		 * Deprecated function for now...
-		 * History: 
-		 *          A pre-version of implementation for error detection. After I optimized the code for performance,
-		 *          I drop this function by that time, but you know performance meassuring is a tricky problem... 
-		 * ToDo: Need a revisit when we implementing complex-affix support and compound-word support.
-		 */
-	    public static function getCapType1(word:String):int {
-			// now determine the capitalization type of the first nl letters
-			var ncap:int = 0;
-			var nneutral:int = 0;
-			var firstcap:int = 0;
-			// Potential improvment 1:
-			// It could be updated to user gslib StringUtils class in the future( after we have argo player 10.1 public). It is better for locale correction.
-			// at that time, we should consider about german language sharp SS -> beta case... the only case for changing the string length.
-			// Potential improvement 2:
-			// Using a hard code mapping table to convert the string to lowercase or uppercase. It is better for perfermance...
-			
-			if ( word == null || word=="" ) return InternalConstants.NOCAP;
-
-			var lowerStr:String = word.toLocaleLowerCase();
-			var upperStr:String = word.toLocaleUpperCase();
-
-			for ( var i:int = 0; i < word.length; ++i ) {
-				if ( upperStr.charCodeAt(i) == lowerStr.charCodeAt(i) ) 
-					nneutral++;
-				else {
-					if ( word.charCodeAt(i) == upperStr.charCodeAt(i) )
-						ncap++;
-				}
-			}
-			
-			if (ncap) {
-				if ( word.charCodeAt(0) == upperStr.charCodeAt(0) && upperStr.charCodeAt(0) != lowerStr.charCodeAt(0) )
-					firstcap = 1;
-			}
-
-			// now finally set the captype
-			if (ncap == 0) {
-				return InternalConstants.NOCAP;
-			} else if ((ncap == 1) && firstcap) {
-				return InternalConstants.INITCAP;
-			} else if ((ncap == word.length) || ((ncap + nneutral) == word.length)) {
-				return InternalConstants.ALLCAP;
-			} else if ((ncap > 1) && firstcap) {
-				return InternalConstants.HUHINITCAP;
-			}
-			return InternalConstants.HUHCAP;			
-	    }
-
-	    public static function getCapType(word:String):int {
-			// now determine the capitalization type of the first nl letters
-			var ncap:int = 0;
-			var nneutral:int = 0;
-			var firstcap:int = 0;
-			// Potential improvment 1:
-			// It could be updated to user gslib StringUtils class in the future( after we have argo player 10.1 public). It is better for locale correction.
-			// at that time, we should consider about german language sharp SS -> beta case... the only case for changing the string length.
-			// Potential improvement 2:
-			// Using a hard code mapping table to convert the string to lowercase or uppercase. It is better for perfermance...
-			
-			if ( word == null || word=="" ) return InternalConstants.NOCAP;
-			var lowerStr:String = word.toLocaleLowerCase();
-			var upperStr:String = word.toLocaleUpperCase();
-			//trying to find if non word characters are present
-			/*var nonWordCharRegex:RegExp = /\b\w+\b/;
-			var resNonWord:Array = word.match( nonWordCharRegex);
-			if(word==resNonWord[0]) then return 
-			trace("the word: "+resNonWord[0]);
-			trace("cosdfasdfnd: "+(word==resNonWord[0])+" Word "+word);*/
-			//var testWord:String= word;
-			
-			//var nonWordIndex:int= word.search(containsNonWordCharRegex);
-			//trace("**NonwordIndex : "+nonWordIndex+" Word: "+word);
-			//if(nonWordIndex!=-1) 
-			
-			if ( word == lowerStr ) return InternalConstants.NOCAP;
-			if ( word == upperStr ) return InternalConstants.ALLCAP;
-			if ( upperStr == lowerStr ) return InternalConstants.NOCAP;
-			if ( word.charCodeAt(0) == upperStr.charCodeAt(0) && upperStr.charCodeAt(0) != lowerStr.charCodeAt(0) ) {
-				ncap = 1;
-				for ( var i:int = 1; i < word.length; ++i ) {
-					if ( word.charCodeAt(i) == upperStr.charCodeAt(i) && upperStr.charCodeAt(i) != lowerStr.charCodeAt(i) ) {
-						ncap++;
-						break;
-					}
-				}
-				if ( ncap == 1 )
-					return InternalConstants.INITCAP;
-				else 
-					return InternalConstants.HUHINITCAP;
-			}else {
-		    	return InternalConstants.HUHCAP;
-			}
-	
-	    }
-	    
-		/*
-		 * Deprecated function for now...
-		 * History: 
-		 *          A pre-version of implementation for error correction. After I optimized the code for performance,
-		 *          I drop this function by that time, but you know performance meassuring is a tricky problem... 
-		 * ToDo: Need a revisit when we implementing complex-affix support and compound-word support.
-		 */
-	    static public function lcs1(a:String, b:String):String {
-	    	var aSub:String = a.substr(0,a.length-1);
-	    	var bSub:String = b.substr(0, b.length -1 );
-	    	if ( a.length == 0 || b.length == 0 ) {
-	    		return "";
-	    	}else if ( a.charAt(a.length-1) == b.charAt(b.length-1) ) {
-	    		return lcs1(aSub,bSub) + a.charAt(a.length-1);
-	    	}else {
-	    		var x:String = lcs1(a,bSub);
-	    		var y:String = lcs1(aSub,b);
-	    		return (x.length > y.length) ? x: y;
-	    	}
-	    }
-
-		/*
-		 * Longest common subsequence problem
-		 * From Wikipedia, the free encyclopedia
-		 * Jump to: navigation, search
-		 * Not to be confused with longest common substring problem.
-		 * The longest common subsequence (LCS) problem is to find the longest subsequence 
-		 * common to all sequences in a set of sequences (often just two). It is a classic computer 
-		 * science problem, the basis of diff (a file comparison program that outputs the differences 
-		 * between two files), and has applications in bioinformatics.
-		 * 
-		 * URL: http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
-		 */
-		static public function lcs(a:String, b:String):String {
-			var lengths:Array = new Array(a.length+1);
-			var i:int,j:int, x:int,y:int;
-			for ( i = 0 ; i< a.length+1; ++i ) {
-				lengths[i] = new Array(b.length+1);
-				for ( j=0; j< b.length+1; ++j) 
-					lengths[i][j]=0;
-			}
-			// row 0 and column 0 are initialized to 0 already
-			for ( i=0;i< a.length; ++i ) 
-				for( j=0;j<b.length; ++j)
-					if ( a.charAt(i) == b.charAt(j) )
-						lengths[i+1][j+1] = lengths[i][j] + 1;
-					else
-						 lengths[i+1][j+1] = Math.max(lengths[i+1][j], lengths[i][j+1]);
-			// read the substring out from the matrix
-			var res:String="";
-			for ( x = a.length,y=b.length; x!=0 && y!=0; ) {
-				if (lengths[x][y] == lengths[x-1][y])
-					x--;
-				else if ( lengths[x][y] == lengths[x][y-1] )
-					y--;
-				else {
-					res +=a.charAt(x-1);
-					x--;
-					y--;
-				}
-			}
-			return res.split("").reverse().join("");
-		}
-
-	    
-	    static public function lcslen( a:String, b:String) :int {
-	    	return lcs(a,b).length;
-	    } 
-	    
-	    static public function commonCharacterPositions( a:String, b:String, refObj:RefObject):int {
-			var num:int = 0, i:int;
-			var diff:int = 0;
-			var diffpos:Array = new Array(2);
-			refObj.ref  = 0;
-	    	b = b.toLocaleLowerCase();
-	    	for ( i =0; (i < a.length) && ( i<b.length); ++i ) {
-	    		if ( a.charAt(i) == b.charAt(i) ) {
-	    			num++;
-	    		}else {
-	    			if ( diff < 2) diffpos[diff] = i;
-	    			diff++;
-	    		}
-	    	}
-	    	if ( (diff == 2) && ( i=(a.length-1) ) && ( i==(b.length-1)) && (a.charCodeAt(diffpos[0]) == b.charCodeAt(diffpos[1])) && ( a.charCodeAt( diffpos[1]) == b.charCodeAt(diffpos[0]) ))
-	    		refObj.ref = 1;
-	    	
-	    	return num;
-	    }
-	    
-		/*
-		* To find if the Numbers are present in the word
-		* 
-		* returns true if hasNumber else returns false
-		*/
-		public static function getHasNumber(word:String):Boolean {
-			var i:int;
-			for ( i=0 ; i < word.length ; ++i ) {
-				if ( (word.charCodeAt(i) <= 57 ) && ( word.charCodeAt(i) >= 48) ) { // '0' to '9'
-					return true;
-				}
-			}
-			return false;
-		}
-	}
-}
-
-

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SuggestionsResult.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SuggestionsResult.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SuggestionsResult.as
deleted file mode 100644
index 8a43921..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/core/utils/SuggestionsResult.as
+++ /dev/null
@@ -1,142 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.core.utils
-{
-	public class SuggestionsResult
-	{
-		private var _myHeap:Array;
-		private var _count:uint=0;
-		private var _size:uint=1;
-		private var __compare:Function;
-		public function SuggestionsResult(buffersize:uint=100, compare:Function = null)
-		{
-			_size=buffersize;
-			_myHeap= new Array(_size+1);
-			_count=0;
-			if (compare == null)
-				__compare = function(a:int, b:int):int { return a - b; };
-			else
-				__compare = compare;
-		}
-		public function insert(obj:*):Boolean {
-			_myHeap[++_count]=obj;
-			return true;
-		}
-		public function find(obj:*):Boolean {
-			for (var i:int = 1; i <= _count; i++)
-			{
-				if (_myHeap[i] === obj)
-					return true;
-			}
-			return false;
-		}
-
-		public function get front():*
-		{
-			return this._myHeap[1];
-		}
-
-		public function get maxSize():int
-		{
-			return this._size;
-		}
-
-		public function isEmpty():Boolean
-		{
-			if (_count==0) {
-				return true;
-			}else {
-				return false;
-			}
-			
-		}
-		
-		public function clear():void
-		{
-			_myHeap = new Array(_size);
-			_count = 0;
-		}
-		
-		public function get size():uint {
-			return this._count;
-		}
-		
-		public function dump():String {
-			var s:String = "Suggestions Result\n{\n";
-			var k:int = _count + 1;
-			for (var i:int = 1; i < k; i++)
-				s += "\t" + _myHeap[i] + "\n";
-			s += "\n}";
-			return s;
-		}
-		
-		public function toArray():Array {
-			return _myHeap.slice(1,_count+1);
-		}
-		
-		
-		public function get data():Array {
-			return this._myHeap;
-		}
-		
-		public function buildheap():void {
-			if(this.size<2) {
-				return;
-			}
-			for ( var i:int=this.size/2;i>0;i--) {
-				minheapify(i);
-			}
-		}
-		
-		public function updateFront():void {
-			minheapify(1);
-		}
-		
-		private function minheapify(index:uint):void {
-			var i:int = index;
-			var child:int = i << 1;
-			var tmp:* = _myHeap[i];
-			var v:*;
-			
-			while (child <= _count)
-			{
-				if (child < _count - 1)
-				{
-					if (__compare(_myHeap[child], _myHeap[int(child + 1)]) > 0)
-						child++;
-				}
-				v = _myHeap[child];
-				if (__compare(tmp, v) > 0)
-				{
-					_myHeap[i] = v;
-					i = child;
-					child <<= 1;
-				}
-				else break;
-			}
-			_myHeap[i] = tmp;
-
-		}	
-		
-	}
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/Token.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/Token.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/Token.as
deleted file mode 100644
index 52e2c8a..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/Token.as
+++ /dev/null
@@ -1,47 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.utils
-{
-	public class Token
-	{
-		private var _first:uint;
-		private var _last:uint;
-		
-		public function Token(inFirst:uint, inLast:uint)
-		{
-			_first = inFirst;
-			_last = inLast;
-		}
-		
-		public function get first():uint
-		{
-			return _first;
-		}
-		
-		public function get last():uint
-		{
-			return _last;
-		}
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/Tokenizer.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/Tokenizer.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/Tokenizer.as
deleted file mode 100644
index 6ccbd8a..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/Tokenizer.as
+++ /dev/null
@@ -1,96 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.utils
-{
-
-	import com.adobe.linguistics.spelling.utils.Token;
-		
-	public class Tokenizer
-	{
-		private var _data:String;
-		private var _current:uint;
-
-		public function Tokenizer(inText:String)
-		{
-			_data = inText;
-			_current = 0;
-		}
-		public function next():Token
-		{
-			var first:uint;
-			var last:uint;
-			
-			if (_current==_data.length) return null;
-			while (isSeparator(_data.charAt(_current))) {
-				_current++;
-				if (_current==_data.length) return null;
-			}
-			first = _current;
-			while (!isSeparator(_data.charAt(_current))) {
-				_current++;
-				if (_current==_data.length) break;
-			}
-			last = _current;
-			
-			// Special handling for single quote
-			var charFirst:Number = _data.charCodeAt(first);
-			var charLast:Number = _data.charCodeAt(last-1);
-			if ((charFirst == 39) || (charFirst == 0x2018) || (charFirst == 0x2019)) first++;
-			if ((charLast == 39) || (charLast == 0x2018) || (charLast == 0x2019)) last--;
-			
-			return new Token(first, last);	
-		}
-		
-		private static var allValidChars:Array = [
-			{startingChar:65, endingChar:90}, /*Basic Latin bof */
-			{startingChar:97, endingChar:122},/*Basic Latin eof */
-			{startingChar:39, endingChar:39}, /* "'" character*/
-			{startingChar:0x2018, endingChar:0x2019}, /* "‘" and "’" character*/
-			{startingChar:192, endingChar:214},/* Latin-1 supplement  bof */
-			{startingChar:216, endingChar:246},
-			{startingChar:248, endingChar:255},/* Latin-1 supplement  eof */
-			{startingChar:256, endingChar:383},/* Lating Extended-A bof-eof    European Latin*/
-			{startingChar:384, endingChar:447}, /* Latin extended-B bof-eof */
-			{startingChar:48, endingChar:57}, /* number */
-			{startingChar:536, endingChar:537} /* "ş" character, for romanian */
-		];
-		private static function isValidCharacter( inChar:int ) :Boolean {
-			for ( var i:int = 0; i < allValidChars.length; ++i ) {
-				if ( (inChar >= allValidChars[i].startingChar) && (inChar <= allValidChars[i].endingChar) )
-					return true; 
-			}
-			return false;
-		} 
-		
-		public static function isSeparator(inChar:String):Boolean
-		{	
-			var ccode:Number = inChar.charCodeAt();
-			if ( isValidCharacter( ccode ) )
-				return false;
-			return true;
-		}
-
-	}
-	
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/4e4f9830/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/WordList.as
----------------------------------------------------------------------
diff --git a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/WordList.as b/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/WordList.as
deleted file mode 100644
index 358036b..0000000
--- a/Squiggly/main/AdobeSpellingEngine/src/com/adobe/linguistics/spelling/utils/WordList.as
+++ /dev/null
@@ -1,120 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 com.adobe.linguistics.spelling.utils
-{
-	[RemoteClass]
-	public class WordList
-	{
-		private var _words:Array;
-		private var _sorted:Boolean;  // TODO: Shouldn't be always sorted?
-
-		public function WordList(wordsList:Array=null)
-		{
-			if(wordsList!=null) {
-				_words=wordsList;	
-			}else {
-				_words=new Array();
-			}
-			
-		}
-		
-		public function toArray():Array {
-			return this._words;
-		}
-
-		public function set data(inData:Array):void {
-			this._words = inData;
-		}
-		
-		public function get data():Array {
-			return this._words;
-		}
-		
-		public function insert(value:String):Boolean {
-			if( _words.length==0 ) {
-				_words.push(value)
-				return true;
-			}
-			var low:uint= 0;
-			var high:uint= _words.length-1;
-			var middle:uint= (low+high)/2;
-			while (low<high) {
-				if(_words[middle]<value) {
-					low=middle+1;
-				}else {
-					high=middle;
-				}
-				middle= (low+high)/2;
-			}
-			if( (low <= _words.length-1) && (_words[low]!=value) ) {
-				var pos:uint=_words[low]>value?low:low+1;
-				_words.splice(pos,0,value);
-				return true;
-			}else {
-				return false;
-			}
-			_words.push(value);
-			return true;
-		}
-		
-		public function remove(value:String):Boolean {
-			var pos:int= lookup(value);
-			if( pos!= -1 ) {
-				_words.splice(pos,1);
-				return true;
-			}else {
-				return false;
-			}
-		}
-		
-		//binary search to find the word.
-		public function lookup(value:String):int {
-			if(_words.length==0) {
-				return -1;
-			}
-			var low:uint= 0;
-			var high:uint= _words.length-1;
-			var middle:uint= (low+high)/2;
-			while (low<high) {
-				if(_words[middle]<value) {
-					low=middle+1;
-				}else {
-					high=middle;
-				}
-				middle= (low+high)/2;
-			}
-			if( (low <= _words.length-1) && (_words[low]==value) ) {
-				return low;
-			}else {
-				return -1;
-			}
-			
-		}
-		
-		public function mergeWordLists(list1:WordList,list2:WordList):WordList {
-			return null;
-		}
-
-	}
-}
\ No newline at end of file