Can you do this search on the server? Did most of the strings come from the server anyway?
Are there any constraints/assumptions that can simplify a workaround? Like are the substrings short? Or no wildcards within the substring? Then maybe you can do a character by character equality check using Collator. Would potentially be slow though. -Alex ________________________________________ From: João Fernandes [[email protected]] Sent: Friday, February 21, 2014 10:23 AM To: [email protected] Subject: Re: Accent insensitive search The problem is, that solution works ok for latin languages but the replacement table is way bigger than that. For example in german, SS and ß should be the same and I'm pretty sure there are dozens of other items in this list. My question is, isn't there any other solution, eventually any existing library that supports this without the hackish solution? BTW, I've raised a bug in the public bugbase https://bugbase.adobe.com/index.cfm?event=bug&id=3711838 but I'm not holding my breath. On 21 February 2014 18:11, Javier Guerrero García <[email protected]> wrote: > Obvious answer here: make a cleanup function (some replaces with case > insensitive regexps), and compare cleanup(string1) == cleanup(string2). > Something like (pseudocode): > > function cleanup(input:string):string > { > var result:string=input; > replace [áàäãâ] in result with a (case insensitive, /gi in regexp); > replace [éèëê] in result with e (case insensitive, /gi in regexp); > ...... > replace ç in result with c (case insensitive, /gi in regexp); > replace ñ in result with n (case insensitive, /gi in regexp); > return result; > } > > Not the most elegant solution, but it works and not too many lines of code > :) > > > On Fri, Feb 21, 2014 at 3:32 PM, João Fernandes < > [email protected]> wrote: > > > Hi, I don't want to sort, sort will compare both strings and will return > > -1,0,1 for a sort order. What I pretend is as an example, find a proper > > match in the word "Computação", if I look for "tacão", "taçao" or > "tacao". > > Case insensitivity is easily fixed by lowering both values but accent is > > not so trivial. > > > > The Flash native Collator > > > > > http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/globalization/Collator.html > > Allow me to configure ignoreCase and ignoreDiacritics which allows me to > > perform a case and accent insensitive sorting or equality but not find > > within. > > > > > > On 21 February 2014 14:23, simon gladman <[email protected]> wrote: > > > > > I think the SortingCollator is what you need: > > > > > > > > > > > > http://help.adobe.com/en_US/flex/using/WS19f279b149e7481c-1c03f02c12bd00c4763-8000.html > > > > > > Simon > > > > > > > > > On 21 February 2014 14:21, João Fernandes < > > > [email protected]> wrote: > > > > > > > Hi there, does anyone know if it's possible to find if a substring is > > > > contained in a string but performing an accent insensitive search? > > > > > > > > I tried using the flash native collator but it only supports > equals() . > > > > > > > > Regards > > > > -- > > > > > > > > João Fernandes > > > > > > > > > > > > > > > > -- > > > *flexmonkey.co.uk <http://flexmonkey.co.uk> | @FlexMonkey > > > <https://twitter.com/FlexMonkey> | +44 (0) 7973 669691* > > > > > > > > > > > -- > > > > João Fernandes > > > -- João Fernandes
