Rename built-in Snowball stemmer dictionaries to be english_stem,
russian_stem, etc. Per discussion.
This commit is contained in:
parent
7351b5fa17
commit
93eab9312f
@ -2,7 +2,7 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
# 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= \
|
||||
danish danish \
|
||||
dutch dutch \
|
||||
@ -93,18 +95,19 @@ ifeq ($(enable_shared), yes)
|
||||
while [ "$$#" -gt 0 ] ; \
|
||||
do \
|
||||
lang=$$1; shift; \
|
||||
nonlatdictname=$$lang; \
|
||||
latdictname=$$1; shift; \
|
||||
if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
|
||||
stop=", StopWords=$${lang}" ; \
|
||||
else \
|
||||
stop=""; \
|
||||
fi; \
|
||||
nonlatdictname=$$lang; \
|
||||
latdictname=$$1; shift; \
|
||||
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#_LATDICTNAME_#$$latdictname#g" | \
|
||||
sed -e "s#_NONLATDICTNAME_#$$nonlatdictname#g" | \
|
||||
sed -e "s#_LATDICTNAME_#$${latdictname}_stem#g" | \
|
||||
sed -e "s#_NONLATDICTNAME_#$${nonlatdictname}_stem#g" | \
|
||||
sed -e "s#_STOPWORDS_#$$stop#g" ; \
|
||||
done >> $@
|
||||
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_
|
||||
(TEMPLATE = snowball,
|
||||
Language = _DICTNAME_ _STOPWORDS_);
|
||||
(TEMPLATE = snowball, Language = _LANGNAME_ _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_
|
||||
(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
|
||||
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) 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 */
|
||||
#define CATALOG_VERSION_NO 200708211
|
||||
#define CATALOG_VERSION_NO 200708241
|
||||
|
||||
#endif
|
||||
|
@ -195,13 +195,13 @@ SELECT * FROM ts_stat('SELECT a FROM test_tsvector', 'AB') ORDER BY ndoc DESC, n
|
||||
(1 row)
|
||||
|
||||
--dictionaries and to_tsvector
|
||||
SELECT ts_lexize('english', 'skies');
|
||||
SELECT ts_lexize('english_stem', 'skies');
|
||||
ts_lexize
|
||||
-----------
|
||||
{sky}
|
||||
(1 row)
|
||||
|
||||
SELECT ts_lexize('english', 'identity');
|
||||
SELECT ts_lexize('english_stem', 'identity');
|
||||
ts_lexize
|
||||
-----------
|
||||
{ident}
|
||||
|
@ -81,8 +81,8 @@ SELECT * FROM ts_stat('SELECT a FROM test_tsvector', 'AB') ORDER BY ndoc DESC, n
|
||||
|
||||
--dictionaries and to_tsvector
|
||||
|
||||
SELECT ts_lexize('english', 'skies');
|
||||
SELECT ts_lexize('english', 'identity');
|
||||
SELECT ts_lexize('english_stem', 'skies');
|
||||
SELECT ts_lexize('english_stem', 'identity');
|
||||
|
||||
SELECT * FROM ts_token_type('default');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user