Skip to content

Commit 92e05bc

Browse files
committed
Unaccent dictionary.
1 parent a88a480 commit 92e05bc

12 files changed

+808
-3
lines changed

contrib/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/contrib/Makefile,v 1.88 2009/08/07 20:50:21 petere Exp $
1+
# $PostgreSQL: pgsql/contrib/Makefile,v 1.89 2009/08/18 10:34:39 teodor Exp $
22

33
subdir = contrib
44
top_builddir = ..
@@ -39,6 +39,7 @@ SUBDIRS = \
3939
tablefunc \
4040
test_parser \
4141
tsearch2 \
42+
unaccent \
4243
vacuumlo
4344

4445
ifeq ($(with_openssl),yes)

contrib/README

+4
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ tsearch2 -
169169
Pavel Stehule <pavel.stehule@gmail.com>, based on code originally by
170170
Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov <oleg@sai.msu.su>.
171171

172+
unaccent -
173+
Unaccent dictionary for text search
174+
Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov <oleg@sai.msu.su>.
175+
172176
uuid-ossp -
173177
UUID generation functions
174178
by Peter Eisentraut <peter_e@gmx.net>

contrib/unaccent/Makefile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# $PostgreSQL: pgsql/contrib/unaccent/Makefile,v 1.1 2009/08/18 10:34:39 teodor Exp $
2+
3+
MODULE_big = unaccent
4+
OBJS = unaccent.o
5+
6+
DATA_built = unaccent.sql
7+
DATA = uninstall_unaccent.sql
8+
DATA_TSEARCH = unaccent.rules
9+
REGRESS = unaccent
10+
11+
12+
ifdef USE_PGXS
13+
PG_CONFIG = pg_config
14+
PGXS := $(shell $(PG_CONFIG) --pgxs)
15+
include $(PGXS)
16+
else
17+
subdir = contrib/pg_trgm
18+
top_builddir = ../..
19+
include $(top_builddir)/src/Makefile.global
20+
include $(top_srcdir)/contrib/contrib-global.mk
21+
endif
22+
23+
#redefine REGRESS_OPTS because of needings of UTF8 database
24+
REGRESS_OPTS = --dbname=$(CONTRIB_TESTDB) --multibyte=UTF8 --no-locale
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
SET client_min_messages = warning;
2+
\set ECHO none
3+
RESET client_min_messages;
4+
SET client_encoding TO 'KOI8';
5+
SELECT unaccent('foobar');
6+
unaccent
7+
----------
8+
foobar
9+
(1 row)
10+
11+
SELECT unaccent('����');
12+
unaccent
13+
----------
14+
����
15+
(1 row)
16+
17+
SELECT unaccent('����');
18+
unaccent
19+
----------
20+
����
21+
(1 row)
22+
23+
SELECT unaccent('unaccent', 'foobar');
24+
unaccent
25+
----------
26+
foobar
27+
(1 row)
28+
29+
SELECT unaccent('unaccent', '����');
30+
unaccent
31+
----------
32+
����
33+
(1 row)
34+
35+
SELECT unaccent('unaccent', '����');
36+
unaccent
37+
----------
38+
����
39+
(1 row)
40+
41+
SELECT ts_lexize('unaccent', 'foobar');
42+
ts_lexize
43+
-----------
44+
45+
(1 row)
46+
47+
SELECT ts_lexize('unaccent', '����');
48+
ts_lexize
49+
-----------
50+
{����}
51+
(1 row)
52+
53+
SELECT ts_lexize('unaccent', '����');
54+
ts_lexize
55+
-----------
56+
{����}
57+
(1 row)
58+

contrib/unaccent/sql/unaccent.sql

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SET client_min_messages = warning;
2+
\set ECHO none
3+
\i unaccent.sql
4+
\set ECHO all
5+
RESET client_min_messages;
6+
7+
SET client_encoding TO 'KOI8';
8+
9+
SELECT unaccent('foobar');
10+
SELECT unaccent('L肆');
11+
SELECT unaccent('出殡');
12+
13+
SELECT unaccent('unaccent', 'foobar');
14+
SELECT unaccent('unaccent', 'L肆');
15+
SELECT unaccent('unaccent', '出殡');
16+
17+
SELECT ts_lexize('unaccent', 'foobar');
18+
SELECT ts_lexize('unaccent', 'L肆');
19+
SELECT ts_lexize('unaccent', '出殡');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy