21 #define IGNORE_LONGLEXEME 1
77 list->tail->next = newpl;
93 if (
list->head == NULL)
190 char *curValLemm = curVal->
lemm;
191 int curValLenLemm = curVal->
lenlemm;
234 curValLemm =
res->lexeme;
235 curValLenLemm = strlen(
res->lexeme);
261 if (curVal->
type != 0)
263 bool dictExists =
false;
277 for (
i = 0;
i < map->
len && !dictExists;
i++)
384 #ifdef IGNORE_LONGLEXEME
386 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
387 errmsg(
"word is too long to be indexed"),
388 errdetail(
"Words longer than %d characters are ignored.",
393 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
394 errmsg(
"word is too long to be indexed"),
395 errdetail(
"Words longer than %d characters are ignored.",
402 while ((norms =
LexizeExec(&ldata, NULL)) != NULL)
478 for (
i = 0;
i < query->
size;
i++)
512 while (ptr && ptr->
lexeme)
520 tmplexs = lexs->
next;
570 #ifdef IGNORE_LONGLEXEME
572 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
573 errmsg(
"word is too long to be indexed"),
574 errdetail(
"Words longer than %d characters are ignored.",
579 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
580 errmsg(
"word is too long to be indexed"),
581 errdetail(
"Words longer than %d characters are ignored.",
590 if ((norms =
LexizeExec(&ldata, &lexs)) != NULL)
612 int numfragments = 0;
624 int dist = ptr - ((
char *) out);
628 ptr = ((
char *) out) + dist;
640 if (numfragments > 1)
658 memcpy(ptr, wrd->
word, wrd->
len);
static void PGresult * res
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define FunctionCall4(flinfo, arg1, arg2, arg3, arg4)
#define FunctionCall1(flinfo, arg1)
#define FunctionCall2(flinfo, arg1, arg2)
#define FunctionCall3(flinfo, arg1, arg2, arg3)
void pfree(void *pointer)
void * repalloc(void *pointer, Size size)
static Datum PointerGetDatum(const void *X)
static Oid DatumGetObjectId(Datum X)
static Pointer DatumGetPointer(Datum X)
static Datum Int32GetDatum(int32 X)
static int32 DatumGetInt32(Datum X)
static void word(struct vars *v, int dir, struct state *lp, struct state *rp)
HeadlineWordEntry * words
TSDictionaryCacheEntry * lookup_ts_dictionary_cache(Oid dictId)
TSConfigCacheEntry * lookup_ts_config_cache(Oid cfgId)
TSParserCacheEntry * lookup_ts_parser_cache(Oid prsId)
static void hlfinditem(HeadlineParsedText *prs, TSQuery query, int32 pos, char *buf, int buflen)
static ParsedLex * LPLRemoveHead(ListParsedLex *list)
static void setNewTmpRes(LexizeData *ld, ParsedLex *lex, TSLexeme *res)
struct ListParsedLex ListParsedLex
static void RemoveHead(LexizeData *ld)
static void setCorrLex(LexizeData *ld, ParsedLex **correspondLexem)
void parsetext(Oid cfgId, ParsedText *prs, char *buf, int buflen)
void hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int buflen)
static TSLexeme * LexizeExec(LexizeData *ld, ParsedLex **correspondLexem)
static void hladdword(HeadlineParsedText *prs, char *buf, int buflen, int type)
static void LPLAddTail(ListParsedLex *list, ParsedLex *newpl)
text * generateHeadline(HeadlineParsedText *prs)
static void moveToWaste(LexizeData *ld, ParsedLex *stop)
struct ParsedLex ParsedLex
static void addHLParsedLex(HeadlineParsedText *prs, TSQuery query, ParsedLex *lexs, TSLexeme *norms)
static void LexizeAddLemm(LexizeData *ld, int type, char *lemm, int lenlemm)
static void LexizeInit(LexizeData *ld, TSConfigCacheEntry *cfg)
int32 tsCompareString(char *a, int lena, char *b, int lenb, bool prefix)
#define SET_VARSIZE(PTR, len)