mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Rename built-in Snowball stemmer dictionaries to be english_stem,
russian_stem, etc. Per discussion.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Makefile for src/backend/snowball
|
# Makefile for src/backend/snowball
|
||||||
#
|
#
|
||||||
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.1 2007/08/21 01:11:15 tgl Exp $
|
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.2 2007/08/25 01:06:24 tgl Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -47,6 +47,8 @@ OBJS= dict_snowball.o api.o utilities.o \
|
|||||||
stem_UTF_8_turkish.o
|
stem_UTF_8_turkish.o
|
||||||
|
|
||||||
# second column is name of latin dictionary, if different
|
# second column is name of latin dictionary, if different
|
||||||
|
# Note order dependency: use of some other language as latin dictionary
|
||||||
|
# must come after creation of that language
|
||||||
LANGUAGES= \
|
LANGUAGES= \
|
||||||
danish danish \
|
danish danish \
|
||||||
dutch dutch \
|
dutch dutch \
|
||||||
@ -93,18 +95,19 @@ ifeq ($(enable_shared), yes)
|
|||||||
while [ "$$#" -gt 0 ] ; \
|
while [ "$$#" -gt 0 ] ; \
|
||||||
do \
|
do \
|
||||||
lang=$$1; shift; \
|
lang=$$1; shift; \
|
||||||
|
nonlatdictname=$$lang; \
|
||||||
|
latdictname=$$1; shift; \
|
||||||
if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
|
if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
|
||||||
stop=", StopWords=$${lang}" ; \
|
stop=", StopWords=$${lang}" ; \
|
||||||
else \
|
else \
|
||||||
stop=""; \
|
stop=""; \
|
||||||
fi; \
|
fi; \
|
||||||
nonlatdictname=$$lang; \
|
|
||||||
latdictname=$$1; shift; \
|
|
||||||
cat $(srcdir)/snowball.sql.in | \
|
cat $(srcdir)/snowball.sql.in | \
|
||||||
sed -e "s#_DICTNAME_#$$lang#g" | \
|
sed -e "s#_LANGNAME_#$$lang#g" | \
|
||||||
|
sed -e "s#_DICTNAME_#$${lang}_stem#g" | \
|
||||||
sed -e "s#_CFGNAME_#$$lang#g" | \
|
sed -e "s#_CFGNAME_#$$lang#g" | \
|
||||||
sed -e "s#_LATDICTNAME_#$$latdictname#g" | \
|
sed -e "s#_LATDICTNAME_#$${latdictname}_stem#g" | \
|
||||||
sed -e "s#_NONLATDICTNAME_#$$nonlatdictname#g" | \
|
sed -e "s#_NONLATDICTNAME_#$${nonlatdictname}_stem#g" | \
|
||||||
sed -e "s#_STOPWORDS_#$$stop#g" ; \
|
sed -e "s#_STOPWORDS_#$$stop#g" ; \
|
||||||
done >> $@
|
done >> $@
|
||||||
else
|
else
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
-- $PostgreSQL: pgsql/src/backend/snowball/snowball.sql.in,v 1.2 2007/08/22 01:39:44 tgl Exp $$
|
-- $PostgreSQL: pgsql/src/backend/snowball/snowball.sql.in,v 1.3 2007/08/25 01:06:25 tgl Exp $$
|
||||||
|
|
||||||
-- text search configuration for _CFGNAME_ language
|
-- text search configuration for _LANGNAME_ language
|
||||||
CREATE TEXT SEARCH DICTIONARY _DICTNAME_
|
CREATE TEXT SEARCH DICTIONARY _DICTNAME_
|
||||||
(TEMPLATE = snowball,
|
(TEMPLATE = snowball, Language = _LANGNAME_ _STOPWORDS_);
|
||||||
Language = _DICTNAME_ _STOPWORDS_);
|
|
||||||
|
|
||||||
COMMENT ON TEXT SEARCH DICTIONARY _DICTNAME_ IS 'Snowball stemmer for _DICTNAME_ language';
|
COMMENT ON TEXT SEARCH DICTIONARY _DICTNAME_ IS 'Snowball stemmer for _LANGNAME_ language';
|
||||||
|
|
||||||
CREATE TEXT SEARCH CONFIGURATION _CFGNAME_
|
CREATE TEXT SEARCH CONFIGURATION _CFGNAME_
|
||||||
(PARSER = default);
|
(PARSER = default);
|
||||||
|
|
||||||
COMMENT ON TEXT SEARCH CONFIGURATION _CFGNAME_ IS 'Configuration for _CFGNAME_ language';
|
COMMENT ON TEXT SEARCH CONFIGURATION _CFGNAME_ IS 'Configuration for _LANGNAME_ language';
|
||||||
|
|
||||||
ALTER TEXT SEARCH CONFIGURATION _CFGNAME_ ADD MAPPING
|
ALTER TEXT SEARCH CONFIGURATION _CFGNAME_ ADD MAPPING
|
||||||
FOR email, url, host, sfloat, version, uri, file, float, int, uint
|
FOR email, url, host, sfloat, version, uri, file, float, int, uint
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.417 2007/08/22 01:39:45 tgl Exp $
|
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.418 2007/08/25 01:06:25 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -53,6 +53,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 200708211
|
#define CATALOG_VERSION_NO 200708241
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -195,13 +195,13 @@ SELECT * FROM ts_stat('SELECT a FROM test_tsvector', 'AB') ORDER BY ndoc DESC, n
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
--dictionaries and to_tsvector
|
--dictionaries and to_tsvector
|
||||||
SELECT ts_lexize('english', 'skies');
|
SELECT ts_lexize('english_stem', 'skies');
|
||||||
ts_lexize
|
ts_lexize
|
||||||
-----------
|
-----------
|
||||||
{sky}
|
{sky}
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ts_lexize('english', 'identity');
|
SELECT ts_lexize('english_stem', 'identity');
|
||||||
ts_lexize
|
ts_lexize
|
||||||
-----------
|
-----------
|
||||||
{ident}
|
{ident}
|
||||||
|
@ -81,8 +81,8 @@ SELECT * FROM ts_stat('SELECT a FROM test_tsvector', 'AB') ORDER BY ndoc DESC, n
|
|||||||
|
|
||||||
--dictionaries and to_tsvector
|
--dictionaries and to_tsvector
|
||||||
|
|
||||||
SELECT ts_lexize('english', 'skies');
|
SELECT ts_lexize('english_stem', 'skies');
|
||||||
SELECT ts_lexize('english', 'identity');
|
SELECT ts_lexize('english_stem', 'identity');
|
||||||
|
|
||||||
SELECT * FROM ts_token_type('default');
|
SELECT * FROM ts_token_type('default');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user