{
Conf->useFlagAliases = true;
naffix = atoi(sflag);
- if (naffix == 0)
+ if (naffix <= 0)
ereport(ERROR,
(errcode(ERRCODE_CONFIG_FILE_ERROR),
errmsg("invalid number of flag vector aliases")));
Conf->AffixData[curaffix] = VoidString;
curaffix++;
}
- /* Other lines is aliases */
+ /* Other lines are aliases */
else
{
if (curaffix < naffix)
Conf->AffixData[curaffix] = cpstrdup(Conf, sflag);
curaffix++;
}
+ else
+ ereport(ERROR,
+ (errcode(ERRCODE_CONFIG_FILE_ERROR),
+ errmsg("number of aliases exceeds specified number %d",
+ naffix - 1)));
}
goto nextline;
}
{book}
(1 row)
+SELECT ts_lexize('hunspell_long', 'booked');
+ ts_lexize
+-----------
+ {book}
+(1 row)
+
SELECT ts_lexize('hunspell_long', 'footklubber');
ts_lexize
----------------
{ball,klubber}
(1 row)
+SELECT ts_lexize('hunspell_long', 'ballsklubber');
+ ts_lexize
+----------------
+ {ball,klubber}
+(1 row)
+
SELECT ts_lexize('hunspell_long', 'footballyklubber');
ts_lexize
---------------------
{foot,ball,klubber}
(1 row)
+SELECT ts_lexize('hunspell_long', 'ex-machina');
+ ts_lexize
+---------------
+ {ex-,machina}
+(1 row)
+
-- Test ISpell dictionary with hunspell affix file with FLAG num parameter
CREATE TEXT SEARCH DICTIONARY hunspell_num (
Template=ispell,
{sky}
(1 row)
+SELECT ts_lexize('hunspell_num', 'sk');
+ ts_lexize
+-----------
+ {sky}
+(1 row)
+
SELECT ts_lexize('hunspell_num', 'bookings');
ts_lexize
----------------
{book}
(1 row)
+SELECT ts_lexize('hunspell_num', 'booked');
+ ts_lexize
+-----------
+ {book}
+(1 row)
+
SELECT ts_lexize('hunspell_num', 'footklubber');
ts_lexize
----------------
SELECT ts_lexize('hunspell_long', 'unbookings');
SELECT ts_lexize('hunspell_long', 'unbooking');
SELECT ts_lexize('hunspell_long', 'unbook');
+SELECT ts_lexize('hunspell_long', 'booked');
SELECT ts_lexize('hunspell_long', 'footklubber');
SELECT ts_lexize('hunspell_long', 'footballklubber');
SELECT ts_lexize('hunspell_long', 'ballyklubber');
+SELECT ts_lexize('hunspell_long', 'ballsklubber');
SELECT ts_lexize('hunspell_long', 'footballyklubber');
+SELECT ts_lexize('hunspell_long', 'ex-machina');
-- Test ISpell dictionary with hunspell affix file with FLAG num parameter
CREATE TEXT SEARCH DICTIONARY hunspell_num (
);
SELECT ts_lexize('hunspell_num', 'skies');
+SELECT ts_lexize('hunspell_num', 'sk');
SELECT ts_lexize('hunspell_num', 'bookings');
SELECT ts_lexize('hunspell_num', 'booking');
SELECT ts_lexize('hunspell_num', 'foot');
SELECT ts_lexize('hunspell_num', 'unbookings');
SELECT ts_lexize('hunspell_num', 'unbooking');
SELECT ts_lexize('hunspell_num', 'unbook');
+SELECT ts_lexize('hunspell_num', 'booked');
SELECT ts_lexize('hunspell_num', 'footklubber');
SELECT ts_lexize('hunspell_num', 'footballklubber');