Re: making tsearch2 dictionaries

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Ben <bench(at)silentmedia(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: making tsearch2 dictionaries
Date: 2004-02-16 09:06:33
Message-ID: 40308819.3030900@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From http://www.sai.msu.su/~megera/oddmuse/index.cgi/Tsearch_V2_in_Brief

Table for storing dictionaries. Dict_init field store Oid of function
that initialize dictionary. Dict_init has one option: text value from
dict_initoption and should return internal representation (structure)
of dictionary. Structure must be malloced or palloced in
TopMemoryContext. Dict_init is called only one times per process.
dict_lexize field store Oid of function that lemmatize lexem.
Input values: structure of dictionary, pionter to string and it's
length. Output: pointer to array of pointers to C-strings. Last pointer
in array must be NULL. Returns NULL means that dictionary can't resolve
this word, but return void array means that dictionary know input word,
but suppose that word is stop-word.

Ben wrote:
> I'm trying to make myself a dictionary for tsearch2 that converts
> numbers to their english word equivalents. This seems to be working
> great, except that I can't figure out how to make my lexize function
> return multiple lexemes. For instance, I'd like "100" to get converted
> to {one,hundred}, not {"one hundred"} as is currently happening.
>
> How do I specify the output of the lexize function so that this will
> happen?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mark Gibson 2004-02-16 10:50:38 Re: dblink - custom datatypes NOW work :)
Previous Message Carlos Ojea Castro 2004-02-16 08:00:50 Re: Connect to PostgreSQL with kylix3