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

Commit0829b20

Browse files
author
Artur Zakirov
committed
Fix tests. Restore old tests
1 parent1d14ead commit0829b20

File tree

8 files changed

+318
-234
lines changed

8 files changed

+318
-234
lines changed
Lines changed: 68 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,77 @@
11
CREATE EXTENSION hunspell_en_us;
2-
SELECT ts_lexize('english_hunspell', 'stories');
3-
ts_lexize
4-
-----------
5-
{story}
6-
(1 row)
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('english_hunspell', 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)
716

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

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)
25-
26-
SELECT ts_lexize('english_hunspell', 'Saturdays');
27-
ts_lexize
27+
SELECT * FROM table1 WHERE to_tsvector('english_hunspell', name)
28+
@@ to_tsquery('english_hunspell', 'abilities');
29+
name
2830
------------
29-
{saturday}
30-
(1 row)
31-
32-
SELECT ts_lexize('english_hunspell', 'healthcare');
33-
ts_lexize
34-
--------------
35-
{healthcare}
36-
(1 row)
31+
inability
32+
abilities
33+
disability
34+
ability
35+
(4 rows)
3736

38-
SELECT ts_lexize('english_hunspell', 'generally');
39-
ts_lexize
40-
-----------
41-
{general}
42-
(1 row)
37+
SELECT * FROM table1 WHERE to_tsvector('english_hunspell', name)
38+
@@ to_tsquery('english_hunspell', 'ability');
39+
name
40+
------------
41+
inability
42+
abilities
43+
disability
44+
ability
45+
(4 rows)
4346

44-
SELECT ts_lexize('english_hunspell', 'integrating');
45-
ts_lexize
46-
-------------
47-
{integrate}
48-
(1 row)
47+
DROP INDEX name_idx;
48+
CREATE INDEX name_idx ON table1 USING GIST (to_tsvector('english_hunspell', "name"));
49+
SELECT * FROM table1 WHERE to_tsvector('english_hunspell', name)
50+
@@ to_tsquery('english_hunspell', 'leaving');
51+
name
52+
---------
53+
leaves
54+
leaved
55+
leaving
56+
(3 rows)
4957

50-
SELECT ts_lexize('english_hunspell', 'lankiness''s');
51-
ts_lexize
52-
-------------
53-
{lankiness}
54-
(1 row)
58+
SELECT * FROM table1 WHERE to_tsvector('english_hunspell', name)
59+
@@ to_tsquery('english_hunspell', 'abilities');
60+
name
61+
------------
62+
inability
63+
abilities
64+
disability
65+
ability
66+
(4 rows)
5567

56-
SELECT ts_lexize('english_hunspell', 'rewritten');
57-
ts_lexize
58-
-----------
59-
{written}
60-
(1 row)
68+
SELECT * FROM table1 WHERE to_tsvector('english_hunspell', name)
69+
@@ to_tsquery('english_hunspell', 'ability');
70+
name
71+
------------
72+
inability
73+
abilities
74+
disability
75+
ability
76+
(4 rows)
6177

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

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');
3+
CREATETABLEtable1(namevarchar);
4+
INSERT INTO table1VALUES ('leaves'), ('leaved'), ('leaving'),
5+
('inability'), ('abilities'), ('disability'), ('ability');
6+
7+
SELECT d.*FROM table1AS t, LATERAL ts_debug('english_hunspell',t.name)AS d;
8+
9+
CREATEINDEXname_idxON table1 USING GIN (to_tsvector('english_hunspell',"name"));
10+
SELECT*FROM table1WHERE to_tsvector('english_hunspell', name)
11+
@@ to_tsquery('english_hunspell','leaving');
12+
SELECT*FROM table1WHERE to_tsvector('english_hunspell', name)
13+
@@ to_tsquery('english_hunspell','abilities');
14+
SELECT*FROM table1WHERE to_tsvector('english_hunspell', name)
15+
@@ to_tsquery('english_hunspell','ability');
16+
17+
DROPINDEX name_idx;
18+
CREATEINDEXname_idxON table1 USING GIST (to_tsvector('english_hunspell',"name"));
19+
SELECT*FROM table1WHERE to_tsvector('english_hunspell', name)
20+
@@ to_tsquery('english_hunspell','leaving');
21+
SELECT*FROM table1WHERE to_tsvector('english_hunspell', name)
22+
@@ to_tsquery('english_hunspell','abilities');
23+
SELECT*FROM table1WHERE to_tsvector('english_hunspell', name)
24+
@@ to_tsquery('english_hunspell','ability');
Lines changed: 51 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,57 @@
11
CREATE EXTENSION hunspell_fr;
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
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('french_hunspell', 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('french_hunspell', "name"));
18+
SELECT * FROM table1 WHERE to_tsvector('french_hunspell', name)
19+
@@ to_tsquery('french_hunspell', 'batifolant');
20+
name
3421
------------
35-
{anglaise}
36-
(1 row)
37-
38-
SELECT ts_lexize('french_hunspell', 'comprends');
39-
ts_lexize
22+
batifoler
23+
batifolant
24+
batifole
25+
batifolait
26+
(4 rows)
27+
28+
SELECT * FROM table1 WHERE to_tsvector('french_hunspell', name)
29+
@@ to_tsquery('french_hunspell', 'consentiriez');
30+
name
4031
--------------
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
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('french_hunspell', "name"));
39+
SELECT * FROM table1 WHERE to_tsvector('french_hunspell', name)
40+
@@ to_tsquery('french_hunspell', 'batifolant');
41+
name
6442
------------
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
43+
batifoler
44+
batifolant
45+
batifole
46+
batifolait
47+
(4 rows)
48+
49+
SELECT * FROM table1 WHERE to_tsvector('french_hunspell', name)
50+
@@ to_tsquery('french_hunspell', 'consentiriez');
51+
name
7652
--------------
77-
{rapprocher}
78-
(1 row)
53+
consentant
54+
consentir
55+
consentiriez
56+
(3 rows)
7957

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
CREATE EXTENSION hunspell_fr;
22

3-
SELECT ts_lexize('french_hunspell','beau');
4-
SELECT ts_lexize('french_hunspell','antérieur');
5-
SELECT ts_lexize('french_hunspell','fraternel');
6-
SELECT ts_lexize('french_hunspell','plaît');
7-
SELECT ts_lexize('french_hunspell','m''appelle');
8-
SELECT ts_lexize('french_hunspell','l''anglais');
9-
SELECT ts_lexize('french_hunspell','comprends');
10-
SELECT ts_lexize('french_hunspell','désolée');
11-
SELECT ts_lexize('french_hunspell','cents');
12-
SELECT ts_lexize('french_hunspell','grammairiens');
13-
SELECT ts_lexize('french_hunspell','résistèrent');
14-
SELECT ts_lexize('french_hunspell','derniers');
15-
SELECT ts_lexize('french_hunspell','rapprochent');
3+
CREATETABLEtable1(namevarchar);
4+
INSERT INTO table1VALUES ('batifoler'), ('batifolant'), ('batifole'), ('batifolait'),
5+
('consentant'), ('consentir'), ('consentiriez');
6+
7+
SELECT d.*FROM table1AS t, LATERAL ts_debug('french_hunspell',t.name)AS d;
8+
9+
CREATEINDEXname_idxON table1 USING GIN (to_tsvector('french_hunspell',"name"));
10+
SELECT*FROM table1WHERE to_tsvector('french_hunspell', name)
11+
@@ to_tsquery('french_hunspell','batifolant');
12+
SELECT*FROM table1WHERE to_tsvector('french_hunspell', name)
13+
@@ to_tsquery('french_hunspell','consentiriez');
14+
15+
DROPINDEX name_idx;
16+
CREATEINDEXname_idxON table1 USING GIST (to_tsvector('french_hunspell',"name"));
17+
SELECT*FROM table1WHERE to_tsvector('french_hunspell', name)
18+
@@ to_tsquery('french_hunspell','batifolant');
19+
SELECT*FROM table1WHERE to_tsvector('french_hunspell', name)
20+
@@ to_tsquery('french_hunspell','consentiriez');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp