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++)
236 curValLenLemm = strlen(res->
lexeme);
262 if (curVal->
type != 0)
264 bool dictExists =
false;
278 for (i = 0; i < map->
len && !dictExists; i++)
387 #ifdef IGNORE_LONGLEXEME 389 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
390 errmsg(
"word is too long to be indexed"),
391 errdetail(
"Words longer than %d characters are ignored.",
396 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
397 errmsg(
"word is too long to be indexed"),
398 errdetail(
"Words longer than %d characters are ignored.",
405 while ((norms =
LexizeExec(&ldata, NULL)) != NULL)
471 for (i = 0; i < query->
size; i++)
505 while (ptr && ptr->
lexeme)
513 tmplexs = lexs->
next;
563 #ifdef IGNORE_LONGLEXEME 565 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
566 errmsg(
"word is too long to be indexed"),
567 errdetail(
"Words longer than %d characters are ignored.",
572 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
573 errmsg(
"word is too long to be indexed"),
574 errdetail(
"Words longer than %d characters are ignored.",
583 if ((norms =
LexizeExec(&ldata, &lexs)) != NULL)
603 int numfragments = 0;
615 int dist = ptr - ((
char *) out);
619 ptr = ((
char *) out) + dist;
631 if (numfragments > 1)
650 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)
#define ereport(elevel, rest)
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)
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)