Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c7faf451
Commit
c7faf451
authored
Jun 02, 2006
by
Teodor Sigaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more strict check of stop and non-recognized words,
allow only recognized words in thezaurus configuration file.
parent
d77df813
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
contrib/tsearch2/dict_thesaurus.c
contrib/tsearch2/dict_thesaurus.c
+12
-3
No files found.
contrib/tsearch2/dict_thesaurus.c
View file @
c7faf451
/* $PostgreSQL: pgsql/contrib/tsearch2/dict_thesaurus.c,v 1.
1 2006/05/31 14:05:31
teodor Exp $ */
/* $PostgreSQL: pgsql/contrib/tsearch2/dict_thesaurus.c,v 1.
2 2006/06/02 15:35:42
teodor Exp $ */
/*
* thesaurus
...
...
@@ -330,8 +330,12 @@ compileTheLexeme(DictThesaurus *d) {
);
if
(
!
(
ptr
&&
ptr
->
lexeme
)
)
{
if
(
!
ptr
)
elog
(
NOTICE
,
"Thesaurus: word '%s' isn't recognized by subdictionary"
,
d
->
wrds
[
i
].
lexeme
);
else
elog
(
ERROR
,
"Thesaurus: word '%s' is recognized as stop-word, assign any stop-word"
,
d
->
wrds
[
i
].
lexeme
);
newwrds
=
addCompiledLexeme
(
newwrds
,
&
nnw
,
&
tnm
,
NULL
,
d
->
wrds
[
i
].
entries
,
0
);
elog
(
NOTICE
,
"Thesaurus: word '%s' isn't recognized by subdictionary or it's a stop-word, assign any non-recognized word"
,
d
->
wrds
[
i
].
lexeme
);
}
else
{
while
(
ptr
->
lexeme
)
{
TSLexeme
*
remptr
=
ptr
+
1
;
...
...
@@ -420,7 +424,7 @@ compileTheSubstitute(DictThesaurus *d) {
);
reml
=
lexized
;
if
(
lexized
)
{
if
(
lexized
&&
lexized
->
lexeme
)
{
int
toset
=
(
lexized
->
lexeme
&&
outptr
!=
d
->
subst
[
i
].
res
)
?
(
outptr
-
d
->
subst
[
i
].
res
)
:
-
1
;
while
(
lexized
->
lexeme
)
{
...
...
@@ -443,6 +447,8 @@ compileTheSubstitute(DictThesaurus *d) {
if
(
toset
>
0
)
d
->
subst
[
i
].
res
[
toset
].
flags
|=
TSL_ADDPOS
;
}
else
{
elog
(
NOTICE
,
"Thesaurus: word '%s' isn't recognized by subdictionary or it's a stop-word, ignored"
,
inptr
->
lexeme
);
}
if
(
inptr
->
lexeme
)
...
...
@@ -450,6 +456,9 @@ compileTheSubstitute(DictThesaurus *d) {
inptr
++
;
}
if
(
outptr
==
d
->
subst
[
i
].
res
)
elog
(
ERROR
,
"Thesaurus: all words in subsitution aren't recognized by subdictionary"
);
d
->
subst
[
i
].
reslen
=
outptr
-
d
->
subst
[
i
].
res
;
free
(
rem
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment