Fix obsolete comment regarding FSM truncation.
[PostgreSQL.git] / src / include / tsearch / ts_public.h
blobe51f616eba4d2861a691854efcbbdcbeb4e12c85
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 char *fragdelim;
56 int2 startsellen;
57 int2 stopsellen;
58 int2 fragdelimlen;
59 } HeadlineParsedText;
62 * Common useful things for tsearch subsystem
64 extern char *get_tsearch_config_filename(const char *basename,
65 const char *extension);
68 * Often useful stopword list management
70 typedef struct
72 int len;
73 char **stop;
74 } StopList;
76 extern void readstoplist(const char *fname, StopList *s,
77 char *(*wordop) (const char *));
78 extern bool searchstoplist(StopList *s, char *key);
81 * Interface with dictionaries
84 /* return struct for any lexize function */
85 typedef struct
88 * number of variant of split word , for example Word 'fotballklubber'
89 * (norwegian) has two varian to split: ( fotball, klubb ) and ( fot,
90 * ball, klubb ). So, dictionary should return: nvariant lexeme 1 fotball
91 * 1 klubb 2 fot 2 ball 2 klubb
93 uint16 nvariant;
95 uint16 flags;
97 /* C-string */
98 char *lexeme;
99 } TSLexeme;
101 #define TSL_ADDPOS 0x01
102 #define TSL_PREFIX 0x02
105 * Struct for supporting complex dictionaries like thesaurus.
106 * 4th argument for dictlexize method is a pointer to this
108 typedef struct
110 bool isend; /* in: marks for lexize_info about text end is
111 * reached */
112 bool getnext; /* out: dict wants next lexeme */
113 void *private; /* internal dict state between calls with
114 * getnext == true */
115 } DictSubState;
117 #endif /* _PG_TS_PUBLIC_H_ */