Fix pg_dump bug in the database-level collation patch. "datcollate" and
[PostgreSQL.git] / src / include / tsearch / ts_public.h
blob9c0edca45390b132a987df55bb2d8eefbb22d9ad
1 /*-------------------------------------------------------------------------
3 * ts_public.h
4 * Public interface to various tsearch modules, such as
5 * parsers and dictionaries.
7 * Copyright (c) 1998-2008, PostgreSQL Global Development Group
9 * $PostgreSQL$
11 *-------------------------------------------------------------------------
13 #ifndef _PG_TS_PUBLIC_H_
14 #define _PG_TS_PUBLIC_H_
16 #include "tsearch/ts_type.h"
19 * Parser's framework
23 * returning type for prslextype method of parser
25 typedef struct
27 int lexid;
28 char *alias;
29 char *descr;
30 } LexDescr;
33 * Interface to headline generator
35 typedef struct
37 uint32 selected:1,
38 in:1,
39 replace:1,
40 repeated:1,
41 unused:4,
42 type:8,
43 len:16;
44 char *word;
45 QueryOperand *item;
46 } HeadlineWordEntry;
48 typedef struct
50 HeadlineWordEntry *words;
51 int4 lenwords;
52 int4 curwords;
53 char *startsel;
54 char *stopsel;
55 int2 startsellen;
56 int2 stopsellen;
57 } HeadlineParsedText;
60 * Common useful things for tsearch subsystem
62 extern char *get_tsearch_config_filename(const char *basename,
63 const char *extension);
66 * Often useful stopword list management
68 typedef struct
70 int len;
71 char **stop;
72 } StopList;
74 extern void readstoplist(const char *fname, StopList *s,
75 char *(*wordop) (const char *));
76 extern bool searchstoplist(StopList *s, char *key);
79 * Interface with dictionaries
82 /* return struct for any lexize function */
83 typedef struct
86 * number of variant of split word , for example Word 'fotballklubber'
87 * (norwegian) has two varian to split: ( fotball, klubb ) and ( fot,
88 * ball, klubb ). So, dictionary should return: nvariant lexeme 1 fotball
89 * 1 klubb 2 fot 2 ball 2 klubb
91 uint16 nvariant;
93 uint16 flags;
95 /* C-string */
96 char *lexeme;
97 } TSLexeme;
99 #define TSL_ADDPOS 0x01
100 #define TSL_PREFIX 0x02
103 * Struct for supporting complex dictionaries like thesaurus.
104 * 4th argument for dictlexize method is a pointer to this
106 typedef struct
108 bool isend; /* in: marks for lexize_info about text end is
109 * reached */
110 bool getnext; /* out: dict wants next lexeme */
111 void *private; /* internal dict state between calls with
112 * getnext == true */
113 } DictSubState;
115 #endif /* _PG_TS_PUBLIC_H_ */