| 83 | static bool multi_zall = false; |
| 84 | |
| 85 | static void init(){ |
| 86 | char sharepath[MAXPGPATH]; |
| 87 | char dict_path[MAXPGPATH]; |
| 88 | char rule_path[MAXPGPATH]; |
| 89 | int load_dict_mem_mode = 0x0; |
| 90 | |
| 91 | List *elemlist; |
| 92 | ListCell *l; |
| 93 | |
| 94 | if (!(scws = scws_new())) { |
| 95 | ereport(ERROR, |
| 96 | (errcode(ERRCODE_INTERNAL_ERROR), |
| 97 | errmsg("Failed to init Chinese Parser Lib SCWS!\"%s\"","" |
| 98 | ))); |
| 99 | } |
| 100 | |
| 101 | DefineCustomBoolVariable( |
| 102 | "zhparser.dict_in_memory", |
| 103 | "load dicts into memory", |
| 104 | "load dicts into memory", |
| 105 | &dict_in_memory, |
| 106 | false, |
| 107 | PGC_BACKEND, |
| 108 | 0, |
| 109 | NULL, |
| 110 | NULL, |
| 111 | NULL |
| 112 | ); |
| 113 | DefineCustomStringVariable( |
| 114 | "zhparser.extra_dicts", |
| 115 | "extra dicts files to load", |
| 116 | "extra dicts files to load", |
| 117 | &extra_dicts, |
| 118 | NULL, |
| 119 | PGC_BACKEND, |
| 120 | 0, |
| 121 | NULL, |
| 122 | NULL, |
| 123 | NULL |
| 124 | ); |
| 125 | DefineCustomBoolVariable( |
| 126 | "zhparser.punctuation_ignore", |
| 127 | "set if zhparser ignores the puncuation", |
| 128 | "set if zhparser ignores the puncuation,except \\r and \\n", |
| 129 | &punctuation_ignore, |
| 130 | false, |
| 131 | PGC_USERSET, |
| 132 | 0, |
| 133 | NULL, |
| 134 | NULL, |
| 135 | NULL |
| 136 | ); |
| 137 | |
| 138 | DefineCustomBoolVariable( |
| 139 | "zhparser.seg_with_duality", |
| 140 | "segment words with duality", |
| 141 | "segment words with duality", |
| 142 | &seg_with_duality, |