20 #define IGNORE_LONGLEXEME 1
76 list->tail->next = newpl;
92 if (
list->head == NULL)
189 char *curValLemm = curVal->
lemm;
190 int curValLenLemm = curVal->
lenlemm;
233 curValLemm =
res->lexeme;
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)
598 int numfragments = 0;
610 int dist = ptr - ((
char *) out);
614 ptr = ((
char *) out) + dist;
626 if (numfragments > 1)
644 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)
#define DatumGetObjectId(X)
#define DatumGetPointer(X)
#define SET_VARSIZE(PTR, len)
#define PointerGetDatum(X)
static void word(struct vars *, int, struct state *, struct state *)
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)