Re: How to switch off Snowball stemmer for tsearch2? - Mailing list pgsql-general

From Dmitry Koterov
Subject Re: How to switch off Snowball stemmer for tsearch2?
Date
Msg-id d7df81620708230610p5d20d009md959e6885c5c0aa3@mail.gmail.com
Whole thread Raw
In response to Re: How to switch off Snowball stemmer for tsearch2?  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-general
write your own dictionary, which implements any logic you need. In your
case it's just a wrapper around ispell, which will returns original string
not stem. See example
http://www.sai.msu.su/~megera/postgres/fts/doc/fts-intdict-xmp.html
and russian article
http://www.sai.msu.su/~megera/postgres/talks/fts_pgsql_intro.html#ftsdict
Ah, I understand you!
You offer to write a small Postgres contrib module (new dictionary) in C and implement all logic in it.
Seems it's a bit complex solution for such a simple task (exclude surnames for lexization), but - it could be implemented, of course.
 
> Of course I can create all word-forms of all Russian names using ispell and
> then - subtract this full list from Ispell dictionary (so I will remove
> "Ivan", "Ivanami" etc. from it). But possily tsearch2 has this subtraction
> algorythm already.
>

don't do that ! Just go plain way.

Another method is to generate a singular synonym dictionary based on all Russian names word-forms using ispell (we will get all suspicous surnames in this set) and add it before ispell. This solution does not need to write anything in C.

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: %TYPE
Next
From: Michael Glaesemann
Date:
Subject: Re: Converting non-null unique idx to pkey