PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "tsearch/ts_cache.h"
#include "tsearch/ts_utils.h"
#include "varatt.h"
Go to the source code of this file.
Data Structures | |
struct | ParsedLex |
struct | ListParsedLex |
struct | LexizeData |
Macros | |
#define | IGNORE_LONGLEXEME 1 |
Typedefs | |
typedef struct ParsedLex | ParsedLex |
typedef struct ListParsedLex | ListParsedLex |
Functions | |
static void | LexizeInit (LexizeData *ld, TSConfigCacheEntry *cfg) |
static void | LPLAddTail (ListParsedLex *list, ParsedLex *newpl) |
static ParsedLex * | LPLRemoveHead (ListParsedLex *list) |
static void | LexizeAddLemm (LexizeData *ld, int type, char *lemm, int lenlemm) |
static void | RemoveHead (LexizeData *ld) |
static void | setCorrLex (LexizeData *ld, ParsedLex **correspondLexem) |
static void | moveToWaste (LexizeData *ld, ParsedLex *stop) |
static void | setNewTmpRes (LexizeData *ld, ParsedLex *lex, TSLexeme *res) |
static TSLexeme * | LexizeExec (LexizeData *ld, ParsedLex **correspondLexem) |
void | parsetext (Oid cfgId, ParsedText *prs, char *buf, int buflen) |
static void | hladdword (HeadlineParsedText *prs, char *buf, int buflen, int type) |
static void | hlfinditem (HeadlineParsedText *prs, TSQuery query, int32 pos, char *buf, int buflen) |
static void | addHLParsedLex (HeadlineParsedText *prs, TSQuery query, ParsedLex *lexs, TSLexeme *norms) |
void | hlparsetext (Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int buflen) |
text * | generateHeadline (HeadlineParsedText *prs) |
#define IGNORE_LONGLEXEME 1 |
Definition at line 21 of file ts_parse.c.
typedef struct ListParsedLex ListParsedLex |
|
static |
Definition at line 499 of file ts_parse.c.
References TSLexeme::flags, hladdword(), hlfinditem(), ParsedLex::lemm, ParsedLex::lenlemm, TSLexeme::lexeme, ParsedLex::next, pfree(), TSL_ADDPOS, ParsedLex::type, and HeadlineParsedText::vectorpos.
Referenced by hlparsetext().
text* generateHeadline | ( | HeadlineParsedText * | prs | ) |
Definition at line 607 of file ts_parse.c.
References HeadlineParsedText::curwords, HeadlineParsedText::fragdelim, HeadlineParsedText::fragdelimlen, HeadlineWordEntry::in, HeadlineWordEntry::len, len, palloc(), pfree(), repalloc(), HeadlineWordEntry::repeated, HeadlineWordEntry::replace, HeadlineWordEntry::selected, SET_VARSIZE, HeadlineWordEntry::skip, HeadlineParsedText::startsel, HeadlineParsedText::startsellen, HeadlineParsedText::stopsel, HeadlineParsedText::stopsellen, VARHDRSZ, HeadlineWordEntry::word, and HeadlineParsedText::words.
Referenced by headline_json_value(), and ts_headline_byid_opt().
|
static |
Definition at line 440 of file ts_parse.c.
References buf, HeadlineParsedText::curwords, HeadlineWordEntry::len, HeadlineParsedText::lenwords, palloc(), repalloc(), type, HeadlineWordEntry::type, HeadlineWordEntry::word, and HeadlineParsedText::words.
Referenced by addHLParsedLex().
|
static |
Definition at line 464 of file ts_parse.c.
References buf, HeadlineParsedText::curwords, QueryOperand::distance, GETOPERAND, GETQUERY, i, HeadlineWordEntry::item, QueryOperand::length, HeadlineParsedText::lenwords, LIMITPOS, QueryOperand::prefix, QI_VAL, QueryItem::qoperand, repalloc(), HeadlineWordEntry::repeated, TSQueryData::size, tsCompareString(), QueryItem::type, word(), and HeadlineParsedText::words.
Referenced by addHLParsedLex().
void hlparsetext | ( | Oid | cfgId, |
HeadlineParsedText * | prs, | ||
TSQuery | query, | ||
char * | buf, | ||
int | buflen | ||
) |
Definition at line 540 of file ts_parse.c.
References addHLParsedLex(), buf, DatumGetInt32(), DatumGetPointer(), ereport, errcode(), errdetail(), errmsg(), ERROR, FunctionCall1, FunctionCall2, FunctionCall3, Int32GetDatum(), LexizeAddLemm(), LexizeExec(), LexizeInit(), lookup_ts_config_cache(), lookup_ts_parser_cache(), MAXSTRLEN, NOTICE, PointerGetDatum(), TSParserCacheEntry::prsend, TSConfigCacheEntry::prsId, TSParserCacheEntry::prsstart, TSParserCacheEntry::prstoken, type, and HeadlineParsedText::vectorpos.
Referenced by headline_json_value(), and ts_headline_byid_opt().
|
static |
Definition at line 100 of file ts_parse.c.
References LexizeData::curSub, ParsedLex::lemm, ParsedLex::lenlemm, LPLAddTail(), palloc(), ListParsedLex::tail, LexizeData::towork, ParsedLex::type, and type.
Referenced by hlparsetext(), and parsetext().
|
static |
Definition at line 173 of file ts_parse.c.
References LexizeData::cfg, LexizeData::curDictId, LexizeData::curSub, DatumGetObjectId(), DatumGetPointer(), TSDictionaryCacheEntry::dictData, ListDictionary::dictIds, LexizeData::dictState, FunctionCall4, DictSubState::getnext, ListParsedLex::head, i, Int32GetDatum(), InvalidOid, DictSubState::isend, LexizeData::lastRes, ParsedLex::lemm, ListDictionary::len, len, ParsedLex::lenlemm, TSConfigCacheEntry::lenmap, TSDictionaryCacheEntry::lexize, lookup_ts_dictionary_cache(), TSConfigCacheEntry::map, moveToWaste(), ParsedLex::next, PointerGetDatum(), LexizeData::posDict, DictSubState::private_state, RemoveHead(), res, setCorrLex(), setNewTmpRes(), LexizeData::tmpRes, LexizeData::towork, TSL_FILTER, and ParsedLex::type.
Referenced by hlparsetext(), and parsetext().
|
static |
Definition at line 61 of file ts_parse.c.
References LexizeData::cfg, LexizeData::curDictId, LexizeData::curSub, ListParsedLex::head, InvalidOid, LexizeData::lastRes, LexizeData::posDict, ListParsedLex::tail, LexizeData::tmpRes, LexizeData::towork, and LexizeData::waste.
Referenced by hlparsetext(), and parsetext().
|
static |
Definition at line 73 of file ts_parse.c.
References sort-test::list, and ParsedLex::next.
Referenced by LexizeAddLemm(), and RemoveHead().
|
static |
Definition at line 86 of file ts_parse.c.
References sort-test::list, and res.
Referenced by RemoveHead().
|
static |
Definition at line 142 of file ts_parse.c.
References LexizeData::curSub, ListParsedLex::head, ParsedLex::next, RemoveHead(), and LexizeData::towork.
Referenced by LexizeExec().
void parsetext | ( | Oid | cfgId, |
ParsedText * | prs, | ||
char * | buf, | ||
int | buflen | ||
) |
Definition at line 355 of file ts_parse.c.
References ParsedWord::alen, buf, ParsedText::curwords, DatumGetInt32(), DatumGetPointer(), ereport, errcode(), errdetail(), errmsg(), ERROR, TSLexeme::flags, ParsedWord::flags, FunctionCall1, FunctionCall2, FunctionCall3, Int32GetDatum(), ParsedWord::len, ParsedText::lenwords, TSLexeme::lexeme, LexizeAddLemm(), LexizeExec(), LexizeInit(), LIMITPOS, lookup_ts_config_cache(), lookup_ts_parser_cache(), MAXSTRLEN, NOTICE, TSLexeme::nvariant, ParsedWord::nvariant, pfree(), PointerGetDatum(), ParsedWord::pos, ParsedText::pos, TSParserCacheEntry::prsend, TSConfigCacheEntry::prsId, TSParserCacheEntry::prsstart, TSParserCacheEntry::prstoken, repalloc(), TSL_ADDPOS, TSL_PREFIX, type, ParsedWord::word, and ParsedText::words.
Referenced by add_to_tsvector(), pushval_morph(), to_tsvector_byid(), and tsvector_update_trigger().
|
static |
Definition at line 112 of file ts_parse.c.
References LPLAddTail(), LPLRemoveHead(), LexizeData::posDict, LexizeData::towork, and LexizeData::waste.
Referenced by LexizeExec(), and moveToWaste().
|
static |
Definition at line 120 of file ts_parse.c.
References ListParsedLex::head, ParsedLex::next, pfree(), ListParsedLex::tail, and LexizeData::waste.
Referenced by LexizeExec().
|
static |
Definition at line 158 of file ts_parse.c.
References LexizeData::lastRes, TSLexeme::lexeme, pfree(), res, and LexizeData::tmpRes.
Referenced by LexizeExec().