Re: Searching for "bare" letters - Mailing list pgsql-general

From Mike Christensen
Subject Re: Searching for "bare" letters
Date
Msg-id CABs1bs1V8DOGJBvP=hGDBcEDExbHNkPjG91anS9DAaOsUwcy9w@mail.gmail.com
Whole thread Raw
In response to Re: Searching for "bare" letters  ("Reuven M. Lerner" <reuven@lerner.co.il>)
List 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"

pgsql-general by date:

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