20 #include "utils/fmgrprotos.h"
34 bool affloaded =
false,
43 foreach(l, dictoptions)
47 if (strcmp(defel->
defname,
"dictfile") == 0)
51 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
52 errmsg(
"multiple DictFile parameters")));
58 else if (strcmp(defel->
defname,
"afffile") == 0)
62 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
63 errmsg(
"multiple AffFile parameters")));
69 else if (strcmp(defel->
defname,
"stopwords") == 0)
73 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
74 errmsg(
"multiple StopWords parameters")));
81 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
82 errmsg(
"unrecognized Ispell parameter: \"%s\"",
87 if (affloaded && dictloaded)
95 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
96 errmsg(
"missing AffFile parameter")));
101 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
102 errmsg(
"missing DictFile parameter")));
131 for (ptr = cptr; ptr->
lexeme; ptr++)
141 memcpy(cptr, ptr,
sizeof(
TSLexeme));
static void PGresult * res
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)
char * lowerstr_with_len(const char *str, int len)
char * lowerstr(const char *str)
void readstoplist(const char *fname, StopList *s, char *(*wordop)(const char *))
char * get_tsearch_config_filename(const char *basename, const char *extension)
bool searchstoplist(StopList *s, char *key)