1 /*-------------------------------------------------------------------------
4 * Public interface to various tsearch modules, such as
5 * parsers and dictionaries.
7 * Copyright (c) 1998-2021, PostgreSQL Global Development Group
9 * src/include/tsearch/ts_public.h
11 *-------------------------------------------------------------------------
13 #ifndef _PG_TS_PUBLIC_H_
14 #define _PG_TS_PUBLIC_H_
16 #include "tsearch/ts_type.h"
23 * returning type for prslextype method of parser
33 * Interface to headline generator
52 HeadlineWordEntry
*words
;
55 int32 vectorpos
; /* positions a-la tsvector */
65 * Common useful things for tsearch subsystem
67 extern char *get_tsearch_config_filename(const char *basename
,
68 const char *extension
);
71 * Often useful stopword list management
79 extern void readstoplist(const char *fname
, StopList
*s
,
80 char *(*wordop
) (const char *));
81 extern bool searchstoplist(StopList
*s
, char *key
);
84 * Interface with dictionaries
87 /* return struct for any lexize function */
91 * Number of current variant of split word. For example the Norwegian
92 * word 'fotballklubber' has two variants to split: ( fotball, klubb )
93 * and ( fot, ball, klubb ). So, dictionary should return:
102 * In general, a TSLexeme will be considered to belong to the same split
103 * variant as the previous one if they have the same nvariant value.
104 * The exact values don't matter, only changes from one lexeme to next.
109 uint16 flags
; /* See flag bits below */
111 char *lexeme
; /* C string */
114 /* Flag bits that can appear in TSLexeme.flags */
115 #define TSL_ADDPOS 0x01
116 #define TSL_PREFIX 0x02
117 #define TSL_FILTER 0x04
120 * Struct for supporting complex dictionaries like thesaurus.
121 * 4th argument for dictlexize method is a pointer to this
125 bool isend
; /* in: marks for lexize_info about text end is
127 bool getnext
; /* out: dict wants next lexeme */
128 void *private_state
; /* internal dict state between calls with
132 #endif /* _PG_TS_PUBLIC_H_ */