Re: [PROPOSAL] Improvements of Hunspell dictionaries support

Поиск
Список
Период
Сортировка
От Artur Zakirov
Тема Re: [PROPOSAL] Improvements of Hunspell dictionaries support
Дата
Msg-id 56C33CCB.6080902@postgrespro.ru
обсуждение исходный текст
Ответ на Re: [PROPOSAL] Improvements of Hunspell dictionaries support  (Teodor Sigaev <teodor@sigaev.ru>)
Ответы Re: [PROPOSAL] Improvements of Hunspell dictionaries support  (Artur Zakirov <a.zakirov@postgrespro.ru>)
Список pgsql-hackers
I attached a new version of the patch.

On 10.02.2016 19:46, Teodor Sigaev wrote:
>
>> I duplicate the patch here.
>
> it's very good thing to update disctionaries to support modern versions.
> And thank you for improving documentation. Also I've impressed by long
> description in spell.c header.
>
> Som notices about code:
>
> 1
>   struct SPELL. Why do you remove union p? You leave comment
>   about using d struct instead of flag field and as can see
>   it's right comment. It increases size of SPELL structure.

Fixed.

>
> 2 struct AFFIX. I'm agree with Alvaro taht sum of sizes of bit fields
> should be less or equal to size of integer. In opposite case, suppose,
> we can get undefined behavior. Please, split  bitfields  to two integers.

Fixed.

>
> 3 unsigned char flagval[65000];
>    Is it forbidden to use 65555 number? In any case, decodeFlag() doesn't
>    restrict return value. I suggest to enlarge array to 1<<16 and add limit
>    to return value of decodeFlag().

flagval array was enlarged. Added verification of return value of
DecodeFlag() for for various FLAG parameter (FM_LONG, FM_NUM and FM_CHAR).

>
> 4
>   I'd like to see a short comment describing at least new functions

Added some comments which describe new functions and old functions for
loading dictionaries into PostgreSQL. This patch adds new functions and
modifies functions which is used for loading dictionaries.

At the moment, comments does not describe functions which used for word
normalization. But I can add more comments.

>
> 5
>   Pls, add tests for new code.
>
>

Added tests. Old sample dictionaries files was moved to the folder
"dicts". New sample dictionaries files was added:
- hunspell_sample_long.affix
- hunspell_sample_long.dict
- hunspell_sample_num.affix
- hunspell_sample_num.dict

--
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Remove or weaken hints about "effective resolution of sleep delays is 10 ms"?
Следующее
От: Dmitry Ivanov
Дата:
Сообщение: Re: [WIP] ALTER ... OWNER TO ... CASCADE