mirror of
https://github.com/postgres/postgres.git
synced 2026-01-05 23:38:41 +03:00
Add thesaurus dictionary which can replace N>0 lexemes by M>0 lexemes.
It required some changes in lexize algorithm, but interface with dictionaries stays compatible with old dictionaries. Funded by Georgia Public Library Service and LibLime, Inc.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "catalog/pg_proc.h"
|
||||
#include "catalog/pg_namespace.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "miscadmin.h"
|
||||
|
||||
#include "ts_cfg.h"
|
||||
#include "dict.h"
|
||||
@@ -163,3 +164,23 @@ get_oidnamespace(Oid funcoid)
|
||||
|
||||
return nspoid;
|
||||
}
|
||||
|
||||
/* if path is relative, take it as relative to share dir */
|
||||
char *
|
||||
to_absfilename(char *filename) {
|
||||
if (!is_absolute_path(filename)) {
|
||||
char sharepath[MAXPGPATH];
|
||||
char *absfn;
|
||||
#ifdef WIN32
|
||||
char delim = '\\';
|
||||
#else
|
||||
char delim = '/';
|
||||
#endif
|
||||
get_share_path(my_exec_path, sharepath);
|
||||
absfn = palloc(strlen(sharepath) + strlen(filename) + 2);
|
||||
sprintf(absfn, "%s%c%s", sharepath, delim, filename);
|
||||
filename = absfn;
|
||||
}
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user