Re: [PROPOSAL] Improvements of Hunspell dictionaries support

From: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PROPOSAL] Improvements of Hunspell dictionaries support
Date: 2016-02-11 10:03:25
Message-ID: 56BC5C6D.5030701@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you for the review.

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.

I will fix it. I had misunderstood the Alvaro's comment about it.

>
> 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.

I will fix it. Here I had misunderstood too.

>
> 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().

I think it can be done.

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

Now in spell.c there are more comments. I wanted to send fixed patch
after adding all comments that I want to add. But I can send the patch now.
Also I will merge this commit
http://www.postgresql.org/message-id/E1aTf9o-0001ga-LG@gemulon.postgresql.org

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

I will add.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2016-02-11 10:21:27 Re: [patch] Proposal for \crosstabview in psql
Previous Message Pavel Stehule 2016-02-11 10:01:39 Re: custom function for converting human readable sizes to bytes