Re: Searching for "bare" letters

From: Mike Christensen <mike(at)kitchenpc(dot)com>
To: "Reuven M(dot) Lerner" <reuven(at)lerner(dot)co(dot)il>
Cc: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Uwe Schroeder <uwe(at)oss4u(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Searching for "bare" letters
Date: 2011-10-02 17:18:06
Message-ID: CABs1bs1V8DOGJBvP=hGDBcEDExbHNkPjG91anS9DAaOsUwcy9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> I don't see the problem - you can have a dictionary, which does all work
>> on recognizing bare letters and output several versions. Have you seen
>> unaccent
>> dictionary ?
>
> This seems to be the direction that everyone is suggesting, and I'm quite
> grateful for that.  (I really hadn't ever needed to deal with such issues in
> the past, having worked mostly with English and Hebrew, which don't have
> such accent marks.)
>
> As for the unaccent dictionary, I hadn't heard of it before, but just saw it
> now in contrib, and it looks like it might fit perfectly.  I'll take a look;
> thanks for the suggestion.

I wrote this code for something similar I was doing, feel free to rip
it off or copy the regular expressions:

input = Regex.Replace(input, @"[\xC0-\xC5\xE0-\xE5]", "a"); //Replace with "a"
input = Regex.Replace(input, @"[\xC8-\xCB\xE8-\xEB]", "e"); //Replace with "e"
input = Regex.Replace(input, @"[\xCC-\xCF\xEC-\xEF]", "i"); //Replace with "i"
input = Regex.Replace(input, @"[\xD1\xF1]", "n"); //Replace with "n"
input = Regex.Replace(input, @"[\xD2-\xD6\xF2-\xF6]", "o"); //Replace with "o"
input = Regex.Replace(input, @"[\xD9-\xDC\xF9-\xFC]", "u"); //Replace with "u"
input = Regex.Replace(input, @"[\xDD\xDF\xFF]", "y"); //Replace with "y"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Diego Augusto Molina 2011-10-02 17:55:27 Re: [Solved] Generic logging system for pre-hstore using plperl triggers
Previous Message Mike Christensen 2011-10-02 17:13:19 Re: Why PGSQL has no developments in the .NET area?