Skip to content

Commit 1d14ead

Browse files
author
Artur Zakirov
committed
Remove hard coded public location
1 parent 7c8d062 commit 1d14ead

28 files changed

+341
-411
lines changed

contrib/hunspell_en_us/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
EXTENSION = hunspell_en_us
2-
DATA = sql/hunspell_en_us--1.0.sql
2+
DATA = hunspell_en_us--1.0.sql
33

4-
DATA_TSEARCH = dict/en_us.affix dict/en_us.dict
4+
DATA_TSEARCH = en_us.affix en_us.dict
55

66
REGRESS = hunspell_en_us
77

Lines changed: 52 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,61 @@
11
CREATE EXTENSION hunspell_en_us;
2-
CREATE TABLE table1(name varchar);
3-
INSERT INTO table1 VALUES ('leaves'), ('leaved'), ('leaving'),
4-
('inability'), ('abilities'), ('disability'), ('ability');
5-
SELECT d.* FROM table1 AS t, LATERAL ts_debug('public.english', t.name) AS d;
6-
alias | description | token | dictionaries | dictionary | lexemes
7-
-----------+-----------------+------------+---------------------------------+------------------+-----------
8-
asciiword | Word, all ASCII | leaves | {english_hunspell,english_stem} | english_hunspell | {leave}
9-
asciiword | Word, all ASCII | leaved | {english_hunspell,english_stem} | english_hunspell | {leave}
10-
asciiword | Word, all ASCII | leaving | {english_hunspell,english_stem} | english_hunspell | {leave}
11-
asciiword | Word, all ASCII | inability | {english_hunspell,english_stem} | english_hunspell | {ability}
12-
asciiword | Word, all ASCII | abilities | {english_hunspell,english_stem} | english_hunspell | {ability}
13-
asciiword | Word, all ASCII | disability | {english_hunspell,english_stem} | english_hunspell | {ability}
14-
asciiword | Word, all ASCII | ability | {english_hunspell,english_stem} | english_hunspell | {ability}
15-
(7 rows)
2+
SELECT ts_lexize('english_hunspell', 'stories');
3+
ts_lexize
4+
-----------
5+
{story}
6+
(1 row)
167

17-
CREATE INDEX name_idx ON table1 USING GIN (to_tsvector('public.english', "name"));
18-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
19-
@@ to_tsquery('public.english', 'leaving');
20-
name
21-
---------
22-
leaves
23-
leaved
24-
leaving
25-
(3 rows)
8+
SELECT ts_lexize('english_hunspell', 'traveled');
9+
ts_lexize
10+
-------------------
11+
{traveled,travel}
12+
(1 row)
2613

27-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
28-
@@ to_tsquery('public.english', 'abilities');
29-
name
30-
------------
31-
inability
32-
abilities
33-
disability
34-
ability
35-
(4 rows)
14+
SELECT ts_lexize('english_hunspell', 'eaten');
15+
ts_lexize
16+
-------------
17+
{eaten,eat}
18+
(1 row)
19+
20+
SELECT ts_lexize('english_hunspell', 'I''m');
21+
ts_lexize
22+
-----------
23+
{i'm}
24+
(1 row)
3625

37-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
38-
@@ to_tsquery('public.english', 'ability');
39-
name
26+
SELECT ts_lexize('english_hunspell', 'Saturdays');
27+
ts_lexize
4028
------------
41-
inability
42-
abilities
43-
disability
44-
ability
45-
(4 rows)
29+
{saturday}
30+
(1 row)
4631

47-
DROP INDEX name_idx;
48-
CREATE INDEX name_idx ON table1 USING GIST (to_tsvector('public.english', "name"));
49-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
50-
@@ to_tsquery('public.english', 'leaving');
51-
name
52-
---------
53-
leaves
54-
leaved
55-
leaving
56-
(3 rows)
32+
SELECT ts_lexize('english_hunspell', 'healthcare');
33+
ts_lexize
34+
--------------
35+
{healthcare}
36+
(1 row)
5737

58-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
59-
@@ to_tsquery('public.english', 'abilities');
60-
name
61-
------------
62-
inability
63-
abilities
64-
disability
65-
ability
66-
(4 rows)
38+
SELECT ts_lexize('english_hunspell', 'generally');
39+
ts_lexize
40+
-----------
41+
{general}
42+
(1 row)
6743

68-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
69-
@@ to_tsquery('public.english', 'ability');
70-
name
71-
------------
72-
inability
73-
abilities
74-
disability
75-
ability
76-
(4 rows)
44+
SELECT ts_lexize('english_hunspell', 'integrating');
45+
ts_lexize
46+
-------------
47+
{integrate}
48+
(1 row)
49+
50+
SELECT ts_lexize('english_hunspell', 'lankiness''s');
51+
ts_lexize
52+
-------------
53+
{lankiness}
54+
(1 row)
55+
56+
SELECT ts_lexize('english_hunspell', 'rewritten');
57+
ts_lexize
58+
-----------
59+
{written}
60+
(1 row)
7761

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* contrib/hunspell_en_us/hunspell_en_us--1.0.sql */
2+
3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION hunspell_en_us" to load this file. \quit
5+
6+
CREATE TEXT SEARCH DICTIONARY english_hunspell (
7+
TEMPLATE = ispell,
8+
DictFile = en_us,
9+
AffFile = en_us,
10+
StopWords = english
11+
);
12+
13+
COMMENT ON TEXT SEARCH DICTIONARY english_hunspell IS 'hunspell dictionary for english language';
14+
15+
CREATE TEXT SEARCH CONFIGURATION english_hunspell (
16+
COPY = simple
17+
);
18+
19+
COMMENT ON TEXT SEARCH CONFIGURATION english_hunspell IS 'hunspell configuration for english language';
20+
21+
ALTER TEXT SEARCH CONFIGURATION english_hunspell
22+
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,
23+
word, hword, hword_part
24+
WITH english_hunspell, english_stem;

contrib/hunspell_en_us/sql/hunspell_en_us--1.0.sql

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
CREATE EXTENSION hunspell_en_us;
22

3-
CREATE TABLE table1(name varchar);
4-
INSERT INTO table1 VALUES ('leaves'), ('leaved'), ('leaving'),
5-
('inability'), ('abilities'), ('disability'), ('ability');
6-
7-
SELECT d.* FROM table1 AS t, LATERAL ts_debug('public.english', t.name) AS d;
8-
9-
CREATE INDEX name_idx ON table1 USING GIN (to_tsvector('public.english', "name"));
10-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
11-
@@ to_tsquery('public.english', 'leaving');
12-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
13-
@@ to_tsquery('public.english', 'abilities');
14-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
15-
@@ to_tsquery('public.english', 'ability');
16-
17-
DROP INDEX name_idx;
18-
CREATE INDEX name_idx ON table1 USING GIST (to_tsvector('public.english', "name"));
19-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
20-
@@ to_tsquery('public.english', 'leaving');
21-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
22-
@@ to_tsquery('public.english', 'abilities');
23-
SELECT * FROM table1 WHERE to_tsvector('public.english', name)
24-
@@ to_tsquery('public.english', 'ability');
3+
SELECT ts_lexize('english_hunspell', 'stories');
4+
SELECT ts_lexize('english_hunspell', 'traveled');
5+
SELECT ts_lexize('english_hunspell', 'eaten');
6+
SELECT ts_lexize('english_hunspell', 'I''m');
7+
SELECT ts_lexize('english_hunspell', 'Saturdays');
8+
SELECT ts_lexize('english_hunspell', 'healthcare');
9+
SELECT ts_lexize('english_hunspell', 'generally');
10+
SELECT ts_lexize('english_hunspell', 'integrating');
11+
SELECT ts_lexize('english_hunspell', 'lankiness''s');
12+
SELECT ts_lexize('english_hunspell', 'rewritten');

contrib/hunspell_fr/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
EXTENSION = hunspell_fr
2-
DATA = sql/hunspell_fr--1.0.sql
2+
DATA = hunspell_fr--1.0.sql
33

4-
DATA_TSEARCH = dict/fr.affix dict/fr.dict
4+
DATA_TSEARCH = fr.affix fr.dict
55

66
REGRESS = hunspell_fr
77

Lines changed: 73 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,79 @@
11
CREATE EXTENSION hunspell_fr;
2-
CREATE TABLE table1(name varchar);
3-
INSERT INTO table1 VALUES ('batifoler'), ('batifolant'), ('batifole'), ('batifolait'),
4-
('consentant'), ('consentir'), ('consentiriez');
5-
SELECT d.* FROM table1 AS t, LATERAL ts_debug('public.french', t.name) AS d;
6-
alias | description | token | dictionaries | dictionary | lexemes
7-
-----------+-----------------+--------------+-------------------------------+-----------------+-------------------------
8-
asciiword | Word, all ASCII | batifoler | {french_hunspell,french_stem} | french_hunspell | {batifoler}
9-
asciiword | Word, all ASCII | batifolant | {french_hunspell,french_stem} | french_hunspell | {batifolante,batifoler}
10-
asciiword | Word, all ASCII | batifole | {french_hunspell,french_stem} | french_hunspell | {batifoler}
11-
asciiword | Word, all ASCII | batifolait | {french_hunspell,french_stem} | french_hunspell | {batifoler}
12-
asciiword | Word, all ASCII | consentant | {french_hunspell,french_stem} | french_hunspell | {consentante,consentir}
13-
asciiword | Word, all ASCII | consentir | {french_hunspell,french_stem} | french_hunspell | {consentir}
14-
asciiword | Word, all ASCII | consentiriez | {french_hunspell,french_stem} | french_hunspell | {consentir}
15-
(7 rows)
16-
17-
CREATE INDEX name_idx ON table1 USING GIN (to_tsvector('public.french', "name"));
18-
SELECT * FROM table1 WHERE to_tsvector('public.french', name)
19-
@@ to_tsquery('public.french', 'batifolant');
20-
name
2+
SELECT ts_lexize('french_hunspell', 'beau');
3+
ts_lexize
4+
-----------
5+
{beau}
6+
(1 row)
7+
8+
SELECT ts_lexize('french_hunspell', 'antérieur');
9+
ts_lexize
10+
--------------
11+
{antérieure}
12+
(1 row)
13+
14+
SELECT ts_lexize('french_hunspell', 'fraternel');
15+
ts_lexize
16+
---------------
17+
{fraternelle}
18+
(1 row)
19+
20+
SELECT ts_lexize('french_hunspell', 'plaît');
21+
ts_lexize
22+
-----------
23+
{plaire}
24+
(1 row)
25+
26+
SELECT ts_lexize('french_hunspell', 'm''appelle');
27+
ts_lexize
28+
-----------
29+
{appeler}
30+
(1 row)
31+
32+
SELECT ts_lexize('french_hunspell', 'l''anglais');
33+
ts_lexize
2134
------------
22-
batifoler
23-
batifolant
24-
batifole
25-
batifolait
26-
(4 rows)
27-
28-
SELECT * FROM table1 WHERE to_tsvector('public.french', name)
29-
@@ to_tsquery('public.french', 'consentiriez');
30-
name
35+
{anglaise}
36+
(1 row)
37+
38+
SELECT ts_lexize('french_hunspell', 'comprends');
39+
ts_lexize
3140
--------------
32-
consentant
33-
consentir
34-
consentiriez
35-
(3 rows)
36-
37-
DROP INDEX name_idx;
38-
CREATE INDEX name_idx ON table1 USING GIST (to_tsvector('public.french', "name"));
39-
SELECT * FROM table1 WHERE to_tsvector('public.french', name)
40-
@@ to_tsquery('public.french', 'batifolant');
41-
name
41+
{comprendre}
42+
(1 row)
43+
44+
SELECT ts_lexize('french_hunspell', 'désolée');
45+
ts_lexize
46+
-----------
47+
{désoler}
48+
(1 row)
49+
50+
SELECT ts_lexize('french_hunspell', 'cents');
51+
ts_lexize
52+
-----------
53+
{cent}
54+
(1 row)
55+
56+
SELECT ts_lexize('french_hunspell', 'grammairiens');
57+
ts_lexize
58+
-----------------
59+
{grammairienne}
60+
(1 row)
61+
62+
SELECT ts_lexize('french_hunspell', 'résistèrent');
63+
ts_lexize
4264
------------
43-
batifoler
44-
batifolant
45-
batifole
46-
batifolait
47-
(4 rows)
48-
49-
SELECT * FROM table1 WHERE to_tsvector('public.french', name)
50-
@@ to_tsquery('public.french', 'consentiriez');
51-
name
65+
{résister}
66+
(1 row)
67+
68+
SELECT ts_lexize('french_hunspell', 'derniers');
69+
ts_lexize
70+
------------
71+
{dernière}
72+
(1 row)
73+
74+
SELECT ts_lexize('french_hunspell', 'rapprochent');
75+
ts_lexize
5276
--------------
53-
consentant
54-
consentir
55-
consentiriez
56-
(3 rows)
77+
{rapprocher}
78+
(1 row)
5779

File renamed without changes.
File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* contrib/hunspell_fr/hunspell_fr--1.0.sql */
2+
3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION hunspell_fr" to load this file. \quit
5+
6+
CREATE TEXT SEARCH DICTIONARY french_hunspell (
7+
TEMPLATE = ispell,
8+
DictFile = fr,
9+
AffFile = fr,
10+
StopWords = french
11+
);
12+
13+
COMMENT ON TEXT SEARCH DICTIONARY french_hunspell IS 'hunspell dictionary for french language';
14+
15+
CREATE TEXT SEARCH CONFIGURATION french_hunspell (
16+
COPY = simple
17+
);
18+
19+
COMMENT ON TEXT SEARCH CONFIGURATION french_hunspell IS 'hunspell configuration for french language';
20+
21+
ALTER TEXT SEARCH CONFIGURATION french_hunspell
22+
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,
23+
word, hword, hword_part
24+
WITH french_hunspell, french_stem;

0 commit comments

Comments
 (0)