pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedsearch on accents over all possible matches
3+ messages / 3 participants
[nested] [flat]
* search on accents over all possible matches
@ 2001-03-27 16:24 Jaume Teixi <teixi@6tems.com>
0 siblings, 2 replies; 3+ messages in thread
From: Jaume Teixi @ 2001-03-27 16:24 UTC (permalink / raw)
To: pgsql-admin
Hello,
I'm developing a search tool with php against a posgresql database.
As the database is in catalan an in spanish is obvious that a simple
search like:
(SELECT * FROM painters WHERE artist_name ~* 'Dali');
should perform over Dd Aa Ll Ii (and will not found Dalí).
but on an accent based language also should perform over ÍíÌìÏï
question is:
this c function from Patrice Hédé is the most appropiate tool for
searching on an accent based language ?
http://www.postgresql.org/mhonarc/pgsql-sql/1998-06/msg00119.html
or should I use an implemented function inside postgres right now ?
bests from barcelona,
jaume teixi.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: search on accents over all possible matches
@ 2001-03-27 17:00 David Lizano <david.lizano@izanet.com>
parent: Jaume Teixi <teixi@6tems.com>
1 sibling, 0 replies; 3+ messages in thread
From: David Lizano @ 2001-03-27 17:00 UTC (permalink / raw)
To: pgsql-admin
At 18.24 27/3/01 +0200, you wrote:
>Hello,
>
>I'm developing a search tool with php against a posgresql database.
>As the database is in catalan an in spanish is obvious that a simple
>search like:
>(SELECT * FROM painters WHERE artist_name ~* 'Dali');
>
>should perform over Dd Aa Ll Ii (and will not found Dalí).
>but on an accent based language also should perform over ÍíÌìÏï
>
>question is:
>
>this c function from Patrice Hédé is the most appropiate tool for
>searching on an accent based language ?
>http://www.postgresql.org/mhonarc/pgsql-sql/1998-06/msg00119.html
>
>or should I use an implemented function inside postgres right now ?
>
>bests from barcelona,
>jaume teixi.
Using regular expressions from PHP you can convert "a" into "[Aaáä]" and
from the original SQL query:
(SELECT * FROM painters WHERE artist_name ~* 'Dali');
You obtain
(SELECT * FROM painters WHERE artist_name ~* 'D[Aaáä]l[Iiíï]');
generating a new complete regular expression for the SQL language.
It should be valid for Dali, Dáli, Dalí, Dálí, and others.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Lizano - Director área técnica
correo-e: david.lizano@izanet.com
I Z A N E T - Servicios integrales de internet.
web: http://www.izanet.com/
Dirección: C/ Checa, 57-59, 3º D - 50.007 Zaragoza (España)
Teléfono: +34 976 25 80 23 Fax: +34 976 25 80 24
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: search on accents over all possible matches
@ 2001-03-27 17:24 Peter Eisentraut <peter_e@gmx.net>
parent: Jaume Teixi <teixi@6tems.com>
1 sibling, 0 replies; 3+ messages in thread
From: Peter Eisentraut @ 2001-03-27 17:24 UTC (permalink / raw)
To: Jaume Teixi <teixi@6tems.com>; +Cc: pgsql-admin
Jaume Teixi writes:
> this c function from Patrice Hédé is the most appropiate tool for
> searching on an accent based language ?
> http://www.postgresql.org/mhonarc/pgsql-sql/1998-06/msg00119.html
Looks good to me.
> or should I use an implemented function inside postgres right now ?
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.
--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-03-27 17:24 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-27 16:24 search on accents over all possible matches Jaume Teixi <teixi@6tems.com>
2001-03-27 17:00 ` David Lizano <david.lizano@izanet.com>
2001-03-27 17:24 ` Peter Eisentraut <peter_e@gmx.net>
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