Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8829af4

Browse files
committed
Fix merge affixes for numeric ones
Some dictionaries have duplicated base words with different affix set, wejust merge that sets into one set. But previously merging of sets of affixeswas actually a concatenation of strings but it's wrong for numericrepresentation of affixes because such representation uses comma toseparate affixes.Author: Artur Zakirov
1 parenta9eb6c8 commit8829af4

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

‎src/backend/tsearch/spell.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,12 @@ MergeAffix(IspellDict *Conf, int a1, int a2)
14651465
{
14661466
char**ptr;
14671467

1468+
/* Do not merge affix flags if one of affix flags is empty */
1469+
if (*Conf->AffixData[a1]=='\0')
1470+
returna2;
1471+
elseif (*Conf->AffixData[a2]=='\0')
1472+
returna1;
1473+
14681474
while (Conf->nAffixData+1 >=Conf->lenAffixData)
14691475
{
14701476
Conf->lenAffixData *=2;
@@ -1473,10 +1479,20 @@ MergeAffix(IspellDict *Conf, int a1, int a2)
14731479
}
14741480

14751481
ptr=Conf->AffixData+Conf->nAffixData;
1476-
*ptr=cpalloc(strlen(Conf->AffixData[a1])+
1477-
strlen(Conf->AffixData[a2])+
1478-
1/* space */+1/* \0 */ );
1479-
sprintf(*ptr,"%s %s",Conf->AffixData[a1],Conf->AffixData[a2]);
1482+
if (Conf->flagMode==FM_NUM)
1483+
{
1484+
*ptr=cpalloc(strlen(Conf->AffixData[a1])+
1485+
strlen(Conf->AffixData[a2])+
1486+
1/* comma */+1/* \0 */ );
1487+
sprintf(*ptr,"%s,%s",Conf->AffixData[a1],Conf->AffixData[a2]);
1488+
}
1489+
else
1490+
{
1491+
*ptr=cpalloc(strlen(Conf->AffixData[a1])+
1492+
strlen(Conf->AffixData[a2])+
1493+
1/* \0 */ );
1494+
sprintf(*ptr,"%s%s",Conf->AffixData[a1],Conf->AffixData[a2]);
1495+
}
14801496
ptr++;
14811497
*ptr=NULL;
14821498
Conf->nAffixData++;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp