Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93eab93

Browse files
committed
Rename built-in Snowball stemmer dictionaries to be english_stem,
russian_stem, etc. Per discussion.
1 parent7351b5f commit93eab93

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

‎src/backend/snowball/Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for src/backend/snowball
44
#
5-
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.1 2007/08/21 01:11:15 tgl Exp $
5+
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.2 2007/08/25 01:06:24 tgl Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -47,6 +47,8 @@ OBJS= dict_snowball.o api.o utilities.o \
4747
stem_UTF_8_turkish.o
4848

4949
# second column is name of latin dictionary, if different
50+
# Note order dependency: use of some other language as latin dictionary
51+
# must come after creation of that language
5052
LANGUAGES=\
5153
danishdanish\
5254
dutch dutch\
@@ -93,18 +95,19 @@ ifeq ($(enable_shared), yes)
9395
while [ "$$#" -gt 0 ] ;\
9496
do\
9597
lang=$$1; shift;\
98+
nonlatdictname=$$lang;\
99+
latdictname=$$1; shift;\
96100
if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then\
97101
stop=", StopWords=$${lang}" ;\
98102
else\
99103
stop="";\
100104
fi;\
101-
nonlatdictname=$$lang;\
102-
latdictname=$$1; shift;\
103105
cat $(srcdir)/snowball.sql.in |\
104-
sed -e "s#_DICTNAME_#$$lang#g" |\
106+
sed -e "s#_LANGNAME_#$$lang#g" |\
107+
sed -e "s#_DICTNAME_#$${lang}_stem#g" |\
105108
sed -e "s#_CFGNAME_#$$lang#g" |\
106-
sed -e "s#_LATDICTNAME_#$$latdictname#g" |\
107-
sed -e "s#_NONLATDICTNAME_#$$nonlatdictname#g" |\
109+
sed -e "s#_LATDICTNAME_#$${latdictname}_stem#g" |\
110+
sed -e "s#_NONLATDICTNAME_#$${nonlatdictname}_stem#g" |\
108111
sed -e "s#_STOPWORDS_#$$stop#g" ;\
109112
done >> $@
110113
else

‎src/backend/snowball/snowball.sql.in

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
-- $PostgreSQL: pgsql/src/backend/snowball/snowball.sql.in,v 1.2 2007/08/22 01:39:44 tgl Exp $$
1+
-- $PostgreSQL: pgsql/src/backend/snowball/snowball.sql.in,v 1.3 2007/08/25 01:06:25 tgl Exp $$
22

3-
-- text search configuration for_CFGNAME_ language
3+
-- text search configuration for_LANGNAME_ language
44
CREATE TEXT SEARCH DICTIONARY _DICTNAME_
5-
(TEMPLATE = snowball,
6-
Language = _DICTNAME_ _STOPWORDS_);
5+
(TEMPLATE = snowball, Language = _LANGNAME_ _STOPWORDS_);
76

8-
COMMENT ON TEXT SEARCH DICTIONARY _DICTNAME_ IS 'Snowball stemmer for_DICTNAME_ language';
7+
COMMENT ON TEXT SEARCH DICTIONARY _DICTNAME_ IS 'Snowball stemmer for_LANGNAME_ language';
98

109
CREATE TEXT SEARCH CONFIGURATION _CFGNAME_
1110
(PARSER = default);
1211

13-
COMMENT ON TEXT SEARCH CONFIGURATION _CFGNAME_ IS 'Configuration for_CFGNAME_ language';
12+
COMMENT ON TEXT SEARCH CONFIGURATION _CFGNAME_ IS 'Configuration for_LANGNAME_ language';
1413

1514
ALTER TEXT SEARCH CONFIGURATION _CFGNAME_ ADD MAPPING
1615
FOR email, url, host, sfloat, version, uri, file, float, int, uint

‎src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.417 2007/08/22 01:39:45 tgl Exp $
40+
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.418 2007/08/25 01:06:25 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200708211
56+
#defineCATALOG_VERSION_NO200708241
5757

5858
#endif

‎src/test/regress/expected/tsearch.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ SELECT * FROM ts_stat('SELECT a FROM test_tsvector', 'AB') ORDER BY ndoc DESC, n
195195
(1 row)
196196

197197
--dictionaries and to_tsvector
198-
SELECT ts_lexize('english', 'skies');
198+
SELECT ts_lexize('english_stem', 'skies');
199199
ts_lexize
200200
-----------
201201
{sky}
202202
(1 row)
203203

204-
SELECT ts_lexize('english', 'identity');
204+
SELECT ts_lexize('english_stem', 'identity');
205205
ts_lexize
206206
-----------
207207
{ident}

‎src/test/regress/sql/tsearch.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ SELECT * FROM ts_stat('SELECT a FROM test_tsvector', 'AB') ORDER BY ndoc DESC, n
8181

8282
--dictionaries and to_tsvector
8383

84-
SELECT ts_lexize('english','skies');
85-
SELECT ts_lexize('english','identity');
84+
SELECT ts_lexize('english_stem','skies');
85+
SELECT ts_lexize('english_stem','identity');
8686

8787
SELECT*FROM ts_token_type('default');
8888

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp