flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From João Fernandes <joaopedromartinsfernan...@gmail.com>
Subject Re: Accent insensitive search
Date Tue, 04 Mar 2014 08:42:32 GMT
Thank Alex, I've raised the bug
https://bugbase.adobe.com/index.cfm?event=bug&id=3711838 and they already
posted that is a valid enhancement request but it will depend on the votes.

Regarding your questions, it's a local search and can't use server-side
because it's a lookup for dynamic loaded content.

 Like are the substrings short?


yes, probably under 20 chars to search in strings up to 80 chars max.

Or no wildcards within the substring?


No, we don't provide wildcard match.


>  Then maybe you can do a character by character equality check using
> Collator.  Would potentially be slow though.


I'll try this approach.


On 22 February 2014 07:07, Alex Harui <aharui@adobe.com> wrote:

> 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 [joaopedromartinsfernandes@gmail.com]
> Sent: Friday, February 21, 2014 10:23 AM
> To: users@flex.apache.org
> 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 <javi.gg@gmail.com>
> 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 <
> > 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çã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 <sgladman@gmail.com> 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 <
> > > > 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ão Fernandes
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > *flexmonkey.co.uk <http://flexmonkey.co.uk> | @FlexMonkey
> > > > <https://twitter.com/FlexMonkey> | +44 (0) 7973 669691*
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > João Fernandes
> > >
> >
>
>
>
> --
>
> João Fernandes
>



-- 

João Fernandes

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message