~ubuntu-branches/ubuntu/precise/postgresql-9.1/precise-security

« back to all changes in this revision

Viewing changes to contrib/dict_xsyn/expected/dict_xsyn.out

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
CREATE EXTENSION dict_xsyn;
 
2
-- default configuration - match first word and return it among with all synonyms
 
3
ALTER TEXT SEARCH DICTIONARY xsyn (RULES='xsyn_sample', KEEPORIG=true, MATCHORIG=true, KEEPSYNONYMS=true, MATCHSYNONYMS=false);
 
4
--lexize
 
5
SELECT ts_lexize('xsyn', 'supernova');
 
6
        ts_lexize         
 
7
--------------------------
 
8
 {supernova,sn,sne,1987a}
 
9
(1 row)
 
10
 
 
11
SELECT ts_lexize('xsyn', 'sn');
 
12
 ts_lexize 
 
13
-----------
 
14
 
 
15
(1 row)
 
16
 
 
17
SELECT ts_lexize('xsyn', 'grb');
 
18
 ts_lexize 
 
19
-----------
 
20
 
 
21
(1 row)
 
22
 
 
23
-- the same, but return only synonyms
 
24
ALTER TEXT SEARCH DICTIONARY xsyn (RULES='xsyn_sample', KEEPORIG=false, MATCHORIG=true, KEEPSYNONYMS=true, MATCHSYNONYMS=false);
 
25
SELECT ts_lexize('xsyn', 'supernova');
 
26
   ts_lexize    
 
27
----------------
 
28
 {sn,sne,1987a}
 
29
(1 row)
 
30
 
 
31
SELECT ts_lexize('xsyn', 'sn');
 
32
 ts_lexize 
 
33
-----------
 
34
 
 
35
(1 row)
 
36
 
 
37
SELECT ts_lexize('xsyn', 'grb');
 
38
 ts_lexize 
 
39
-----------
 
40
 
 
41
(1 row)
 
42
 
 
43
-- match any word and return all words
 
44
ALTER TEXT SEARCH DICTIONARY xsyn (RULES='xsyn_sample', KEEPORIG=true, MATCHORIG=true, KEEPSYNONYMS=true, MATCHSYNONYMS=true);
 
45
SELECT ts_lexize('xsyn', 'supernova');
 
46
        ts_lexize         
 
47
--------------------------
 
48
 {supernova,sn,sne,1987a}
 
49
(1 row)
 
50
 
 
51
SELECT ts_lexize('xsyn', 'sn');
 
52
        ts_lexize         
 
53
--------------------------
 
54
 {supernova,sn,sne,1987a}
 
55
(1 row)
 
56
 
 
57
SELECT ts_lexize('xsyn', 'grb');
 
58
 ts_lexize 
 
59
-----------
 
60
 
 
61
(1 row)
 
62
 
 
63
-- match any word and return all words except first one
 
64
ALTER TEXT SEARCH DICTIONARY xsyn (RULES='xsyn_sample', KEEPORIG=false, MATCHORIG=true, KEEPSYNONYMS=true, MATCHSYNONYMS=true);
 
65
SELECT ts_lexize('xsyn', 'supernova');
 
66
   ts_lexize    
 
67
----------------
 
68
 {sn,sne,1987a}
 
69
(1 row)
 
70
 
 
71
SELECT ts_lexize('xsyn', 'sn');
 
72
   ts_lexize    
 
73
----------------
 
74
 {sn,sne,1987a}
 
75
(1 row)
 
76
 
 
77
SELECT ts_lexize('xsyn', 'grb');
 
78
 ts_lexize 
 
79
-----------
 
80
 
 
81
(1 row)
 
82
 
 
83
-- match any synonym but not first word, and return first word instead
 
84
ALTER TEXT SEARCH DICTIONARY xsyn (RULES='xsyn_sample', KEEPORIG=true, MATCHORIG=false, KEEPSYNONYMS=false, MATCHSYNONYMS=true);
 
85
SELECT ts_lexize('xsyn', 'supernova');
 
86
 ts_lexize 
 
87
-----------
 
88
 
 
89
(1 row)
 
90
 
 
91
SELECT ts_lexize('xsyn', 'sn');
 
92
  ts_lexize  
 
93
-------------
 
94
 {supernova}
 
95
(1 row)
 
96
 
 
97
SELECT ts_lexize('xsyn', 'grb');
 
98
 ts_lexize 
 
99
-----------
 
100
 
 
101
(1 row)
 
102
 
 
103
-- do not match or return anything
 
104
ALTER TEXT SEARCH DICTIONARY xsyn (RULES='xsyn_sample', KEEPORIG=false, MATCHORIG=false, KEEPSYNONYMS=false, MATCHSYNONYMS=false);
 
105
SELECT ts_lexize('xsyn', 'supernova');
 
106
 ts_lexize 
 
107
-----------
 
108
 
 
109
(1 row)
 
110
 
 
111
SELECT ts_lexize('xsyn', 'sn');
 
112
 ts_lexize 
 
113
-----------
 
114
 
 
115
(1 row)
 
116
 
 
117
SELECT ts_lexize('xsyn', 'grb');
 
118
 ts_lexize 
 
119
-----------
 
120
 
 
121
(1 row)
 
122
 
 
123
-- match any word but return nothing
 
124
ALTER TEXT SEARCH DICTIONARY xsyn (RULES='xsyn_sample', KEEPORIG=false, MATCHORIG=true, KEEPSYNONYMS=false, MATCHSYNONYMS=true);
 
125
SELECT ts_lexize('xsyn', 'supernova');
 
126
 ts_lexize 
 
127
-----------
 
128
 {}
 
129
(1 row)
 
130
 
 
131
SELECT ts_lexize('xsyn', 'sn');
 
132
 ts_lexize 
 
133
-----------
 
134
 {}
 
135
(1 row)
 
136
 
 
137
SELECT ts_lexize('xsyn', 'grb');
 
138
 ts_lexize 
 
139
-----------
 
140
 
 
141
(1 row)
 
142