20 #define IGNORE_LONGLEXEME 1 92 if (list->
head == NULL)
189 char *curValLemm = curVal->
lemm;
190 int curValLenLemm = curVal->
lenlemm;
201 for (i = ld->
posDict; i < map->len; i++)
234 curValLenLemm = strlen(res->
lexeme);
260 if (curVal->
type != 0)
262 bool dictExists =
false;
276 for (i = 0; i < map->
len && !dictExists; i++)
383 #ifdef IGNORE_LONGLEXEME 385 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
386 errmsg(
"word is too long to be indexed"),
387 errdetail(
"Words longer than %d characters are ignored.",
392 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
393 errmsg(
"word is too long to be indexed"),
394 errdetail(
"Words longer than %d characters are ignored.",
401 while ((norms =
LexizeExec(&ldata, NULL)) != NULL)
467 for (i = 0; i < query->
size; i++)
501 while (ptr && ptr->
lexeme)
509 tmplexs = lexs->
next;
559 #ifdef IGNORE_LONGLEXEME 561 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
562 errmsg(
"word is too long to be indexed"),
563 errdetail(
"Words longer than %d characters are ignored.",
568 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
569 errmsg(
"word is too long to be indexed"),
570 errdetail(
"Words longer than %d characters are ignored.",
579 if ((norms =
LexizeExec(&ldata, &lexs)) != NULL)
599 int numfragments = 0;
611 int dist = ptr - ((
char *) out);
615 ptr = ((
char *) out) + dist;
627 if (numfragments > 1)
646 memcpy(ptr, wrd->
word, wrd->
len);
static void addHLParsedLex(HeadlineParsedText *prs, TSQuery query, ParsedLex *lexs, TSLexeme *norms)
#define PointerGetDatum(X)
#define DatumGetObjectId(X)
#define FunctionCall2(flinfo, arg1, arg2)
static void moveToWaste(LexizeData *ld, ParsedLex *stop)
int errcode(int sqlerrcode)
TSParserCacheEntry * lookup_ts_parser_cache(Oid prsId)
static void setCorrLex(LexizeData *ld, ParsedLex **correspondLexem)
static ParsedLex * LPLRemoveHead(ListParsedLex *list)
TSDictionaryCacheEntry * lookup_ts_dictionary_cache(Oid dictId)
#define FunctionCall3(flinfo, arg1, arg2, arg3)
void pfree(void *pointer)
void parsetext(Oid cfgId, ParsedText *prs, char *buf, int buflen)
TSConfigCacheEntry * lookup_ts_config_cache(Oid cfgId)
static void LPLAddTail(ListParsedLex *list, ParsedLex *newpl)
static void LexizeInit(LexizeData *ld, TSConfigCacheEntry *cfg)
HeadlineWordEntry * words
int errdetail(const char *fmt,...)
#define FunctionCall4(flinfo, arg1, arg2, arg3, arg4)
struct ListParsedLex ListParsedLex
static void setNewTmpRes(LexizeData *ld, ParsedLex *lex, TSLexeme *res)
static void hlfinditem(HeadlineParsedText *prs, TSQuery query, int32 pos, char *buf, int buflen)
static TSLexeme * LexizeExec(LexizeData *ld, ParsedLex **correspondLexem)
static void hladdword(HeadlineParsedText *prs, char *buf, int buflen, int type)
#define ereport(elevel,...)
text * generateHeadline(HeadlineParsedText *prs)
struct ParsedLex ParsedLex
void hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int buflen)
int32 tsCompareString(char *a, int lena, char *b, int lenb, bool prefix)
void * repalloc(void *pointer, Size size)
#define DatumGetPointer(X)
static void word(struct vars *, int, struct state *, struct state *)
int errmsg(const char *fmt,...)
#define FunctionCall1(flinfo, arg1)
#define SET_VARSIZE(PTR, len)
static void LexizeAddLemm(LexizeData *ld, int type, char *lemm, int lenlemm)
static void RemoveHead(LexizeData *ld)