Return-Path: X-Original-To: apmail-flex-users-archive@www.apache.org Delivered-To: apmail-flex-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1C72911937 for ; Fri, 21 Feb 2014 18:12:05 +0000 (UTC) Received: (qmail 25105 invoked by uid 500); 21 Feb 2014 18:12:04 -0000 Delivered-To: apmail-flex-users-archive@flex.apache.org Received: (qmail 25040 invoked by uid 500); 21 Feb 2014 18:12:04 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Received: (qmail 25032 invoked by uid 99); 21 Feb 2014 18:12:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Feb 2014 18:12:04 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of javi.gg@gmail.com designates 209.85.217.179 as permitted sender) Received: from [209.85.217.179] (HELO mail-lb0-f179.google.com) (209.85.217.179) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Feb 2014 18:11:59 +0000 Received: by mail-lb0-f179.google.com with SMTP id l4so2600800lbv.10 for ; Fri, 21 Feb 2014 10:11:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=+K7WI2s6zqUNbksQ2+fvymVt4ImdxZN6brDnu2EuA4w=; b=HWeTV6ESGOde4WP7E1AwVp4nvehT3BdcKpDDhH384tlrIpiZIDvOKx9X96cadyRBU+ aUYswx466xT/QlURAg0JUgNHFoiO4LudUYDXsHfDNcgiEWpSCqKe/gY5sgcBEJwOCJKu fqvUCzCT+xJTnX+FZHWuYqj/8oqszRob3RHOvOuANddM3YKDOfsPIzmB2aLR7U+IoE+z wVexZ+vNp2QAP5YxdZM42/O56cTQRct5Xq/udXOFpJBWjpOQaDY9EF9ihr4z+FqAbIYU go9IY9NJEp3gcdBOZBvfxXqpDitzHarUMY3MnRZpZeAzk7HIlWnnjpJpp/soZmz+gBEK 1NxQ== X-Received: by 10.112.26.79 with SMTP id j15mr4754608lbg.73.1393006297807; Fri, 21 Feb 2014 10:11:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.176.69 with HTTP; Fri, 21 Feb 2014 10:11:17 -0800 (PST) In-Reply-To: References: From: =?ISO-8859-1?Q?Javier_Guerrero_Garc=EDa?= Date: Fri, 21 Feb 2014 19:11:17 +0100 Message-ID: Subject: Re: Accent insensitive search To: users Content-Type: multipart/alternative; boundary=001a1133f07c8cff1e04f2ee8dcd X-Virus-Checked: Checked by ClamAV on apache.org --001a1133f07c8cff1e04f2ee8dcd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Obvious answer here: make a cleanup function (some replaces with case insensitive regexps), and compare cleanup(string1) =3D=3D cleanup(string2). Something like (pseudocode): function cleanup(input:string):string { var result:string=3Dinput; replace [=E1=E0=E4=E3=E2] in result with a (case insensitive, /gi in regexp= ); replace [=E9=E8=EB=EA] in result with e (case insensitive, /gi in regexp); ...... replace =E7 in result with c (case insensitive, /gi in regexp); replace =F1 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=E3o Fernandes < joaopedromartinsfernandes@gmail.com> 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=E7=E3o", if I look for "tac=E3o", "ta=E7ao" 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 wrote: > > > I think the SortingCollator is what you need: > > > > > > > http://help.adobe.com/en_US/flex/using/WS19f279b149e7481c-1c03f02c12bd00c= 4763-8000.html > > > > Simon > > > > > > On 21 February 2014 14:21, Jo=E3o Fernandes < > > joaopedromartinsfernandes@gmail.com> 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=E3o Fernandes > > > > > > > > > > > -- > > *flexmonkey.co.uk | @FlexMonkey > > | +44 (0) 7973 669691* > > > > > > -- > > Jo=E3o Fernandes > --001a1133f07c8cff1e04f2ee8dcd--