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
df9d87f6
Commit
df9d87f6
authored
Jun 23, 2004
by
Teodor Sigaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Previous commit wasnt full...
parent
de55c0ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
contrib/tsearch2/ispell/spell.c
contrib/tsearch2/ispell/spell.c
+9
-9
No files found.
contrib/tsearch2/ispell/spell.c
View file @
df9d87f6
...
...
@@ -11,7 +11,7 @@
#define MAXNORMLEN 256
#define STRNCASECMP(x,y) pg_strncasecmp(x, y, strlen(y))
#define GETWCHAR(W,L,N,T) ( ((uint8*)(W))[ ((T)==
'p'
) ? (N) : ( (L) - 1 - (N) ) ] )
#define GETWCHAR(W,L,N,T) ( ((uint8*)(W))[ ((T)==
FF_PREFIX
) ? (N) : ( (L) - 1 - (N) ) ] )
#define GETCHAR(A,N,T) GETWCHAR( (A)->repl, (A)->replen, N, T )
...
...
@@ -103,7 +103,7 @@ cmpaffix(const void *s1, const void *s2)
return
-
1
;
if
(((
const
AFFIX
*
)
s1
)
->
type
>
((
const
AFFIX
*
)
s2
)
->
type
)
return
1
;
if
(((
const
AFFIX
*
)
s1
)
->
type
==
'p'
)
if
(((
const
AFFIX
*
)
s1
)
->
type
==
FF_PREFIX
)
return
(
strcmp
(((
const
AFFIX
*
)
s1
)
->
repl
,
((
const
AFFIX
*
)
s2
)
->
repl
));
else
return
(
strbcmp
(((
const
AFFIX
*
)
s1
)
->
repl
,
((
const
AFFIX
*
)
s2
)
->
repl
));
...
...
@@ -620,7 +620,7 @@ NISortAffixes(IspellDict * Conf)
for
(
i
=
0
;
i
<
Conf
->
naffixes
;
i
++
)
{
Affix
=
&
(((
AFFIX
*
)
Conf
->
Affix
)[
i
]);
if
(
Affix
->
type
==
's'
)
{
if
(
Affix
->
type
==
FF_SUFFIX
)
{
if
(
firstsuffix
<
0
)
firstsuffix
=
i
;
if
(
Affix
->
flagflags
&
FF_COMPOUNDONLYAFX
)
{
if
(
!
ptr
->
affix
||
strbncmp
((
ptr
-
1
)
->
affix
,
Affix
->
repl
,
(
ptr
-
1
)
->
len
)
)
{
...
...
@@ -635,8 +635,8 @@ NISortAffixes(IspellDict * Conf)
ptr
->
affix
=
NULL
;
Conf
->
CompoundAffix
=
(
CMPDAffix
*
)
realloc
(
Conf
->
CompoundAffix
,
sizeof
(
CMPDAffix
)
*
(
ptr
-
Conf
->
CompoundAffix
+
1
)
);
Conf
->
Prefix
=
mkANode
(
Conf
,
0
,
firstsuffix
,
0
,
'p'
);
Conf
->
Suffix
=
mkANode
(
Conf
,
firstsuffix
,
Conf
->
naffixes
,
0
,
's'
);
Conf
->
Prefix
=
mkANode
(
Conf
,
0
,
firstsuffix
,
0
,
FF_PREFIX
);
Conf
->
Suffix
=
mkANode
(
Conf
,
firstsuffix
,
Conf
->
naffixes
,
0
,
FF_SUFFIX
);
mkVoidAffix
(
Conf
,
1
,
firstsuffix
);
mkVoidAffix
(
Conf
,
0
,
firstsuffix
);
}
...
...
@@ -773,7 +773,7 @@ NormalizeSubWord(IspellDict * Conf, char *word, char flag) {
pnode
=
Conf
->
Prefix
;
plevel
=
0
;
while
(
pnode
)
{
prefix
=
FinfAffixes
(
pnode
,
word
,
wrdlen
,
&
plevel
,
'p'
);
prefix
=
FinfAffixes
(
pnode
,
word
,
wrdlen
,
&
plevel
,
FF_PREFIX
);
if
(
!
prefix
)
break
;
for
(
j
=
0
;
j
<
prefix
->
naff
;
j
++
)
{
if
(
CheckAffix
(
word
,
wrdlen
,
prefix
->
aff
[
j
],
flag
,
newword
)
)
{
...
...
@@ -792,7 +792,7 @@ NormalizeSubWord(IspellDict * Conf, char *word, char flag) {
/* Find all other NORMAL forms of the 'word' (check suffix and then prefix)*/
while
(
snode
)
{
/* find possible suffix */
suffix
=
FinfAffixes
(
snode
,
word
,
wrdlen
,
&
slevel
,
's'
);
suffix
=
FinfAffixes
(
snode
,
word
,
wrdlen
,
&
slevel
,
FF_SUFFIX
);
if
(
!
suffix
)
break
;
/* foreach suffix check affix */
for
(
i
=
0
;
i
<
suffix
->
naff
;
i
++
)
{
...
...
@@ -809,7 +809,7 @@ NormalizeSubWord(IspellDict * Conf, char *word, char flag) {
plevel
=
0
;
swrdlen
=
strlen
(
newword
);
while
(
pnode
)
{
prefix
=
FinfAffixes
(
pnode
,
newword
,
swrdlen
,
&
plevel
,
'p'
);
prefix
=
FinfAffixes
(
pnode
,
newword
,
swrdlen
,
&
plevel
,
FF_PREFIX
);
if
(
!
prefix
)
break
;
for
(
j
=
0
;
j
<
prefix
->
naff
;
j
++
)
{
if
(
CheckAffix
(
newword
,
swrdlen
,
prefix
->
aff
[
j
],
flag
,
pnewword
)
)
{
...
...
@@ -894,7 +894,7 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word,
StopLow
=
node
->
data
;
StopHigh
=
node
->
data
+
node
->
length
;
while
(
StopLow
<
StopHigh
)
{
StopMiddle
=
StopLow
+
(
StopHigh
-
StopLow
)
/
2
;
StopMiddle
=
StopLow
+
(
(
StopHigh
-
StopLow
)
>>
1
)
;
if
(
StopMiddle
->
val
==
((
uint8
*
)(
word
))[
level
]
)
{
break
;
}
else
if
(
StopMiddle
->
val
<
((
uint8
*
)(
word
))[
level
]
)
{
...
...
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