pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: search on accents -> Why not include this function
3+ messages / 3 participants
[nested] [flat]
* Re: search on accents -> Why not include this function
@ 2001-03-29 18:13 Peter Eisentraut <peter_e@gmx.net>
2001-03-29 18:18 ` Re: search on accents -> Why not include this function Jaume Teixi <teixi@6tems.com>
0 siblings, 1 reply; 3+ messages in thread
From: Peter Eisentraut @ 2001-03-29 18:13 UTC (permalink / raw)
To: Jaume Teixi <teixi@6tems.com>; +Cc: pgsql-admin; Patrice Hédé <patrice.hede@idf.net>
Jaume Teixi writes:
> > The reason there is no such implementation, and probably won't be any time
> > soon, is that this tool would either have to hard-code or ignore natural
> > language semantics, neither of which would make it practical. Not all
> > languages have the same accent ignoring or accent folding rules or
> > conventions.
>
> This function is really fast.
> The accent method is a REAL need for almost all non-english languages.
> You should to explicity call this funciton like:
> select accents ('dali');
> accents
> ----------------------------------
> [dðÐ][aáÁàÀâÂäÄåÅãÃ]l[iíÍìÌîÎïÏ]
>
> so why to not to include on the next release ?
For the reason I cited above: it is a too abstract approach for many
languages and/or applications. For example in Swedish, a search for 'e'
should probably include 'é', since most users will not type that in
explicitly (it's not on the keyboard), but a search for 'a' should
normally not include 'å', since that it a completely separate letter (and
it is on the keyboard). Additionally, this particular implementation
seems to be ISO-8859-1 charset specific. I know a number of accented
letters that are a lot closer "siblings" to 'd' than 'ð' is.
--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: search on accents -> Why not include this function
2001-03-29 18:13 Re: search on accents -> Why not include this function Peter Eisentraut <peter_e@gmx.net>
@ 2001-03-29 18:18 ` Jaume Teixi <teixi@6tems.com>
2001-03-29 21:00 ` Re: search on accents -> Why not include this function Patrice Hédé <patrice@islande.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jaume Teixi @ 2001-03-29 18:18 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-admin; patrice.hede@idf.net
But the thing is that you must explicity call this function in order to
use it.
Also in order to some stetics maybe you should call it accents_iso-8859-1
The thing is that this should be consider a big need for non-english
languages.
On a major approx also could be possible to modify it in order to accept
parameters to include ('å','à') or ('ca_ES','fr_FR')....
bests,
jaume.
> For the reason I cited above: it is a too abstract approach for many
> languages and/or applications. For example in Swedish, a search for 'e'
> should probably include 'é', since most users will not type that in
> explicitly (it's not on the keyboard), but a search for 'a' should
> normally not include 'å', since that it a completely separate letter
(and
> it is on the keyboard). Additionally, this particular implementation
> seems to be ISO-8859-1 charset specific. I know a number of accented
> letters that are a lot closer "siblings" to 'd' than 'ð' is.
>
> --
> Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: search on accents -> Why not include this function
2001-03-29 18:13 Re: search on accents -> Why not include this function Peter Eisentraut <peter_e@gmx.net>
2001-03-29 18:18 ` Re: search on accents -> Why not include this function Jaume Teixi <teixi@6tems.com>
@ 2001-03-29 21:00 ` Patrice Hédé <patrice@islande.org>
0 siblings, 0 replies; 3+ messages in thread
From: Patrice Hédé @ 2001-03-29 21:00 UTC (permalink / raw)
To: Jaume Teixi <teixi@6tems.com>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-admin
Hi,
First, thank you for having including me in this thread : I haven't
been involved with PostgreSQL for 3 years now, and it's nice to see
that this hack is still useful to some persons ! (I should however
soon get involved again with databases :) ).
About this programme, I agree with Peter that it is too biased to be
included as a standard function. It is biased towards ISO-8859-1, and
towards some european languages I know ("d" or "dh" => "ð" is for
Icelandic, for example)... although "a" => "å" makes sense : not all
people involved with swedish/norwegian/danish have a scandinavic
keyboard, and they may not be sure whether the programme will do the
"aa" => "å" translation correctly (which this function does ;) ).
Back to the subject, though. This function also has another
limitation, namely, it has a fixed length buffer of 4096 bytes, and
that's not so nice (but it takes care of buffer overflows...).
Maybe, if it's not already the case, the source code could be put in a
contribution directory, available for anyone to adapt to his/her
needs without having to go through 3 years of archives, since it seems
to be a fairly common problem. The code should be simple enough for
anyone with a basic knowledge of C to customise :)
I know that localisation, and collation, and "acceptable alternatives"
are following quite different rules from country to country, making it
difficult to come with a general solution. This is why I didn't even
try to make one ;)
Patrice
* Jaume Teixi <teixi@6tems.com> [010329 22:04]:
> But the thing is that you must explicity call this function in order
> to use it.
> Also in order to some stetics maybe you should call it
> accents_iso-8859-1 The thing is that this should be consider a big
> need for non-english languages.
>
> On a major approx also could be possible to modify it in order to
> accept parameters to include ('å','à') or ('ca_ES','fr_FR')....
>
> bests,
> jaume.
>
>
> > For the reason I cited above: it is a too abstract approach for
> > many languages and/or applications. For example in Swedish, a
> > search for 'e' should probably include 'é', since most users will
> > not type that in explicitly (it's not on the keyboard), but a
> > search for 'a' should normally not include 'å', since that it a
> > completely separate letter (and it is on the keyboard).
> > Additionally, this particular implementation seems to be
> > ISO-8859-1 charset specific. I know a number of accented
> > letters that are a lot closer "siblings" to 'd' than 'ð' is.
> >
> > --
> > Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/
>
--
Patrice HÉDÉ --------------------------------- patrice@islande.org -----
-- Isn't it weird how scientists can imagine all the matter of the
universe exploding out of a dot smaller than the head of a pin, but they
can't come up with a more evocative name for it than "The Big Bang" ?
-- What would _you_ call the creation of the universe ?
-- "The HORRENDOUS SPACE KABLOOIE !" - Calvin and Hobbes
------------------------------------------ http://www.islande.org/ -----
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-03-29 21:00 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-29 18:13 Re: search on accents -> Why not include this function Peter Eisentraut <peter_e@gmx.net>
2001-03-29 18:18 ` Jaume Teixi <teixi@6tems.com>
2001-03-29 21:00 ` Patrice Hédé <patrice@islande.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox