/* *Interfacetoheadlinegenerator(tsparser'sprsheadlinefunction) * *HeadlineParsedTextdescribesthetextthatistobehighlighted. *Somefieldsarepassedfromthecorecodetotheprsheadlinefunction, *whileothersareoutputfromtheprsheadlinefunction. * *Theprincipaldataiswords[],anarrayofHeadlineWordEntry, *oneentrypertoken,oflengthcurwords. *ThefieldsofHeadlineWordEntryare: * *in,selected,replace,skip:theseflagsareinitiallyzero *andmaybesetbytheprsheadlinefunction.Aconsecutivegroup *oftokensmarked"in"forma"fragment"tobeoutput. *Suchtokensmayadditionallybemarkedselected,replace,orskip *tomodifyhowtheyareshown.(Ifyousetmorethanoneofthose *bits,yougetanunspecifiedoneofthosebehaviors.) * *type,len,pos,word:filledbycorecodetodescribethetoken. * *item:ifthetokenmatchesanyoperandofthetsqueryofinterest, *apointertosuchanoperand.(Iftherearemultiplematching *operands,wegenerateextracopiesoftheHeadlineWordEntrytohold *allthepointers.Theextrasaremarkedwithrepeated=1andshould *beignoredexceptforcheckingtheitempointer.)
*/ typedefstruct
{
uint32 selected:1, /* token is to be highlighted */
in:1, /* token is part of headline */
replace:1, /* token is to be replaced with a space */
repeated:1, /* duplicate entry to hold item pointer */
skip:1, /* token is to be skipped (not output) */
unused:3, /* available bits */
type:8, /* parser's token category */
len:16; /* length of token */
WordEntryPos pos; /* position of token */ char *word; /* text of token (not null-terminated) */
QueryOperand *item; /* a matching query operand, or NULL if none */
} HeadlineWordEntry;
typedefstruct
{ /* Fields filled by core code before calling prsheadline function: */
HeadlineWordEntry *words;
int32 lenwords; /* allocated length of words[] */
int32 curwords; /* current number of valid entries */
int32 vectorpos; /* used by ts_parse.c in filling pos fields */
/* The prsheadline function must fill these fields: */ /* Strings for marking selected tokens and separating fragments: */ char *startsel; /* palloc'd strings */ char *stopsel; char *fragdelim;
int16 startsellen; /* lengths of strings */
int16 stopsellen;
int16 fragdelimlen;
} HeadlineParsedText;
/* return struct for any lexize function */ typedefstruct
{ /*---------- *Numberofcurrentvariantofsplitword.ForexampletheNorwegian *word'fotballklubber'hastwovariantstosplit:(fotball,klubb) *and(fot,ball,klubb).So,dictionaryshouldreturn: * *nvariantlexeme *1fotball *1klubb *2fot *2ball *2klubb * *Ingeneral,aTSLexemewillbeconsideredtobelongtothesamesplit *variantasthepreviousoneiftheyhavethesamenvariantvalue. *Theexactvaluesdon'tmatter,onlychangesfromonelexemetonext. *----------
*/
uint16 nvariant;
uint16 flags; /* See flag bits below */
char *lexeme; /* C string */
} TSLexeme;
/* Flag bits that can appear in TSLexeme.flags */ #define TSL_ADDPOS 0x01 #define TSL_PREFIX 0x02 #define TSL_FILTER 0x04
/* *Structforsupportingcomplexdictionarieslikethesaurus. *4thargumentfordictlexizemethodisapointertothis
*/ typedefstruct
{ bool isend; /* in: marks for lexize_info about text end is
* reached */ bool getnext; /* out: dict wants next lexeme */ void *private_state; /* internal dict state between calls with
* getnext == true */
} DictSubState;
#endif/* _PG_TS_PUBLIC_H_ */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-08-05)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.