Re: [sqlite] feature request: built-in FLIP(string) function

2009-11-17 Thread Tim Romano
If there were two flip() functions, Simon, a naive one that understands nothing more than raw codepoints, and a sophisticated one that is "aware" of combined Unicode forms/graphemes, then the excellent would not become the enemy of the good and the raw one could be put in place without much

Re: [sqlite] feature request: built-in FLIP(string) function

2009-11-17 Thread Tim Romano
'cba', right. I don't mean to dismiss the sophisticated version as unnecessary; rather I was thinking there could be a "naive" flip() function where the raw codepoints were simply reversed irrespective of whether the source string contained combining forms, and a different, sophisticated

Re: [sqlite] feature request: built-in FLIP(string) function

2009-11-17 Thread Igor Tandetnik
Simon Slavin wrote: > On 17 Nov 2009, at 5:52pm, Igor Tandetnik wrote: > >> But for your goals, it has to be sortable, right? In a proper >> Unicode collation, U+0041 U+0301 would behave quite differently from >> U+0301 U+0041. Consider "A ' E" (where ' stands for a

Re: [sqlite] feature request: built-in FLIP(string) function

2009-11-17 Thread Jean-Christophe Deschamps
>So, for example, if one wanted to find all rows where myNormalColumn >ENDS WITH 'fi c d', one could search myFlippedColumn like this: > >select * from LEXICON where myFlippedColumn LIKE 'd c if%' -- >allows index use Make this select * from LEXICON where myFlippedColumn LIKE flip('fi c

Re: [sqlite] feature request: built-in FLIP(string) function

2009-11-17 Thread Simon Slavin
On 17 Nov 2009, at 5:52pm, Igor Tandetnik wrote: > But for your goals, it has to be sortable, right? In a proper Unicode > collation, U+0041 U+0301 would behave quite differently from U+0301 U+0041. > Consider "A ' E" (where ' stands for a combining acute accent). In most > locales, this

Re: [sqlite] feature request: built-in FLIP(string) function

2009-11-17 Thread Igor Tandetnik
Tim Romano wrote: > Understood that an index cannot be placed on a function; I wasn't > thinking of a "virtual field" as one can have in Oracle or MS-Access, > or in legacy non-1NF databases such as Revelation, for example. The > flip() function would simply be a utility

Re: [sqlite] feature request: built-in FLIP(string) function

2009-11-17 Thread Tim Romano
Thanks for the reply, Igor. Understood that an index cannot be placed on a function; I wasn't thinking of a "virtual field" as one can have in Oracle or MS-Access, or in legacy non-1NF databases such as Revelation, for example. The flip() function would simply be a utility that would enable me

Re: [sqlite] feature request: built-in FLIP(string) function

2009-11-17 Thread Igor Tandetnik
Tim Romano wrote: > You can accomplish this on the front-end, of course, but it would be > much more convenient and efficient to have a built-in function. It is difficult to define a "reverse" operation on arbitrary Unicode strings in a useful way. E.g., consider the string 'Á' (U+0041 Lating

[sqlite] feature request: built-in FLIP(string) function

2009-11-17 Thread Tim Romano
STARTS-WITH and ENDS-WITH searches are the bread-and-butter of text-centric/word-centric applications (e.g. in linguistics and philology) where you have to work with suffixes, prefixes, and enclitic|proclitic particles quite often. You must routinely examine the ends of strings in a wide range