Re: making tsearch2 dictionaries - Mailing list pgsql-general

From Teodor Sigaev
Subject Re: making tsearch2 dictionaries
Date
Msg-id 40308819.3030900@sigaev.ru
Whole thread Raw
In response to making tsearch2 dictionaries  (Ben <bench@silentmedia.com>)
List 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@sigaev.ru

pgsql-general by date:

Previous
From: Carlos Ojea Castro
Date:
Subject: Re: Connect to PostgreSQL with kylix3
Next
From: Terry Lee Tucker
Date:
Subject: Dazed and Confused