1/*-------------------------------------------------------------------------
4 * Ispell dictionary interface
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
10 * src/backend/tsearch/dict_ispell.c
12 *-------------------------------------------------------------------------
16#include "catalog/pg_collation_d.h"
20#include "utils/fmgrprotos.h"
35 bool affloaded =
false,
44 foreach(l, dictoptions)
48 if (strcmp(defel->
defname,
"dictfile") == 0)
54 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
55 errmsg(
"multiple DictFile parameters")));
62 else if (strcmp(defel->
defname,
"afffile") == 0)
68 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
69 errmsg(
"multiple AffFile parameters")));
76 else if (strcmp(defel->
defname,
"stopwords") == 0)
80 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
81 errmsg(
"multiple StopWords parameters")));
88 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
89 errmsg(
"unrecognized Ispell parameter: \"%s\"",
94 if (affloaded && dictloaded)
102 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
103 errmsg(
"missing AffFile parameter")));
108 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
109 errmsg(
"missing DictFile parameter")));
138 for (ptr = cptr; ptr->
lexeme; ptr++)
148 memcpy(cptr, ptr,
sizeof(
TSLexeme));
char * defGetString(DefElem *def)
Datum dispell_lexize(PG_FUNCTION_ARGS)
Datum dispell_init(PG_FUNCTION_ARGS)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_POINTER(n)
#define PG_GETARG_INT32(n)
#define PG_RETURN_POINTER(x)
void pfree(void *pointer)
void * palloc0(Size size)
void NIStartBuild(IspellDict *Conf)
void NIFinishBuild(IspellDict *Conf)
void NIImportAffixes(IspellDict *Conf, const char *filename)
void NISortDictionary(IspellDict *Conf)
void NISortAffixes(IspellDict *Conf)
void NIImportDictionary(IspellDict *Conf, const char *filename)
TSLexeme * NINormalizeWord(IspellDict *Conf, const char *word)
void readstoplist(const char *fname, StopList *s, char *(*wordop)(const char *, size_t, Oid))
bool searchstoplist(StopList *s, char *key)
char * get_tsearch_config_filename(const char *basename, const char *extension)