Skip to content

Commit 2860041

Browse files
committed
August 13, 2002
Use parser of OpenFTS v0.33. -- Teodor Sigaev
1 parent 1276356 commit 2860041

File tree

5 files changed

+129
-100
lines changed

5 files changed

+129
-100
lines changed

contrib/tsearch/README.tsearch

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ a searchable data type (textual) with indexed access.
44
All work was done by Teodor Sigaev (teodor@stack.net) and Oleg Bartunov
55
(oleg@sai.msu.su).
66

7+
CHANGES:
8+
9+
August 13, 2002
10+
Use parser of OpenFTS v0.33.
11+
712
IMPORTANT NOTICE:
813

914
This is a first step of our work on integration of OpenFTS

contrib/tsearch/deflex.h

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,33 @@
22
#define __DEFLEX_H__
33

44
/* rememder !!!! */
5-
#define LASTNUM 19
5+
#define LASTNUM 23
66

77
#define LATWORD 1
8-
#define NONLATINWORD 2
8+
#define CYRWORD 2
99
#define UWORD 3
1010
#define EMAIL 4
1111
#define FURL 5
1212
#define HOST 6
13-
#define FLOAT 7
14-
#define FINT 8
15-
#define PARTWORD 9
16-
#define NONLATINPARTWORD 10
17-
#define LATPARTWORD 11
18-
#define SPACE 12
19-
#define SYMTAG 13
20-
#define HTTP 14
21-
#define DEFISWORD 15
22-
#define DEFISLATWORD 16
23-
#define DEFISNONLATINWORD 17
13+
#define SCIENTIFIC 7
14+
#define VERSIONNUMBER 8
15+
#define PARTHYPHENWORD 9
16+
#define CYRPARTHYPHENWORD 10
17+
#define LATPARTHYPHENWORD 11
18+
#define SPACE 12
19+
#define TAG 13
20+
#define HTTP 14
21+
#define HYPHENWORD 15
22+
#define LATHYPHENWORD 16
23+
#define CYRHYPHENWORD 17
2424
#define URI 18
2525
#define FILEPATH 19
26+
#define DECIMAL 20
27+
#define SIGNEDINT 21
28+
#define UNSIGNEDINT 22
29+
#define HTMLENTITY 23
2630

2731
extern const char *descr[];
2832

2933
#endif
34+

contrib/tsearch/expected/tsearch.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,9 @@ SELECT count(*) FROM test_txtidx WHERE a ## '(eq|yt)&(wR|qh)';
689689
select txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
690690
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
691691
<i <b> wow < jqw <> qwerty');
692-
txt2txtidx
693-
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
694-
'ad' 'dw' 'jf' '234' '345' '4.2' '455' 'jqw' 'qwe' 'wer' 'wow' 'asdf' 'ewr1' 'qwer' 'sdjk' '5.005' 'ewri2' 'qwqwe' 'wefjn' 'gist.c' 'gist.h' 'qwerti' '234.435' ':8100/?' 'qwe-wer' 'readlin' 'www.com' '+4.0e-10' 'gist.h.c' 'rewt/ewr' 'qwe@efd.r' '/?ad=qwe&dw' '/wqe-324/ewr' 'aew.werc.ewr' '1aew.werc.ewr' '2aew.werc.ewr' '3aew.werc.ewr' '4aew.werc.ewr' '5aew.werc.ewr' '6aew.werc.ewr' '7aew.werc.ewr' '/usr/local/fff' '/awdf/dwqe/4325' ':8100/?ad=qwe&dw' 'teodor@stack.net' '5aew.werc.ewr:8100/?' ':8100/?ad=qwe&dw=%20%32' 'aew.werc.ewr/?ad=qwe&dw' '1aew.werc.ewr/?ad=qwe&dw' '3aew.werc.ewr/?ad=qwe&dw' '6aew.werc.ewr:8100/?ad=qwe&dw' '7aew.werc.ewr:8100/?ad=qwe&dw=%20%32'
692+
txt2txtidx
693+
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
694+
'ad' 'dw' 'jf' '234' '345' '4.2' '455' 'jqw' 'qwe' 'wer' 'wow' 'asdf' 'ewr1' 'qwer' 'sdjk' '5.005' 'ewri2' 'qwqwe' 'wefjn' 'gist.c' 'gist.h' 'qwerti' '234.435' ':8100/?' 'qwe-wer' 'readlin' 'www.com' '+4.0e-10' 'gist.h.c' 'rewt/ewr' 'qwe@efd.r' 'readline-4' '/?ad=qwe&dw' '/wqe-324/ewr' 'aew.werc.ewr' '1aew.werc.ewr' '2aew.werc.ewr' '3aew.werc.ewr' '4aew.werc.ewr' '5aew.werc.ewr' '6aew.werc.ewr' '7aew.werc.ewr' '/usr/local/fff' '/awdf/dwqe/4325' ':8100/?ad=qwe&dw' 'teodor@stack.net' '5aew.werc.ewr:8100/?' ':8100/?ad=qwe&dw=%20%32' 'aew.werc.ewr/?ad=qwe&dw' '1aew.werc.ewr/?ad=qwe&dw' '3aew.werc.ewr/?ad=qwe&dw' '6aew.werc.ewr:8100/?ad=qwe&dw' '7aew.werc.ewr:8100/?ad=qwe&dw=%20%32'
695695
(1 row)
696696

697697
select txtidxsize(txt2txtidx('345 qw'));
@@ -705,7 +705,7 @@ select txtidxsize(txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.e
705705
<i <b> wow < jqw <> qwerty'));
706706
txtidxsize
707707
------------
708-
52
708+
53
709709
(1 row)
710710

711711
insert into test_txtidx (a) values ('345 qwerty');

contrib/tsearch/morph.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,23 @@ static MAPDICT mapdict[] = {
7575
{NODICT, NODICT}, /* EMAIL */
7676
{NODICT, NODICT}, /* FURL */
7777
{NODICT, NODICT}, /* HOST */
78-
{NODICT, NODICT}, /* FLOAT */
79-
{NODICT, NODICT}, /* FINT */
80-
{BYLOCALE, DEFAULTDICT}, /* PARTWORD */
81-
{BYLOCALE, NODICT}, /* NONLATINPARTWORD */
82-
{DEFAULTDICT, NODICT}, /* LATPARTWORD */
78+
{NODICT, NODICT}, /* SCIENTIFIC */
79+
{NODICT, NODICT}, /* VERSIONNUMBER */
80+
{BYLOCALE, DEFAULTDICT}, /* PARTHYPHENWORD */
81+
{BYLOCALE, NODICT}, /* CYRPARTHYPHENWORD */
82+
{DEFAULTDICT, NODICT}, /* LATPARTHYPHENWORD */
8383
{STOPLEXEM, NODICT}, /* SPACE */
84-
{STOPLEXEM, NODICT}, /* SYMTAG */
84+
{STOPLEXEM, NODICT}, /* TAG */
8585
{STOPLEXEM, NODICT}, /* HTTP */
86-
{BYLOCALE, DEFAULTDICT}, /* DEFISWORD */
87-
{DEFAULTDICT, NODICT}, /* DEFISLATWORD */
88-
{BYLOCALE, NODICT}, /* DEFISNONLATINWORD */
86+
{BYLOCALE, DEFAULTDICT}, /* HYPHENWORD */
87+
{DEFAULTDICT, NODICT}, /* LATHYPHENWORD */
88+
{BYLOCALE, NODICT}, /* CYRHYPHENWORD */
8989
{NODICT, NODICT}, /* URI */
90-
{NODICT, NODICT} /* FILEPATH */
90+
{NODICT, NODICT}, /* FILEPATH */
91+
{NODICT, NODICT}, /* DECIMAL */
92+
{NODICT, NODICT}, /* SIGNEDINT */
93+
{NODICT, NODICT}, /* UNSIGNEDINT */
94+
{STOPLEXEM, NODICT} /* HTMLENTITY */
9195
};
9296

9397
static bool inited = false;

0 commit comments

Comments
 (0)