Commit 46a25ce6 authored by Teodor Sigaev's avatar Teodor Sigaev

1 Fix bug with very short word: prefix and suffix might be overlapped,

  sorry but fix can't be applyed to previous version: it's require
  refill tsvector...
2 Small optimize of load time for huge dictionaries
3 use palloc instead of malloc during load dict file
parent a815a579
This diff is collapsed.
...@@ -32,7 +32,6 @@ typedef struct SPNode ...@@ -32,7 +32,6 @@ typedef struct SPNode
typedef struct spell_struct typedef struct spell_struct
{ {
char *word;
union union
{ {
char flag[16]; char flag[16];
...@@ -41,9 +40,12 @@ typedef struct spell_struct ...@@ -41,9 +40,12 @@ typedef struct spell_struct
int affix; int affix;
int len; int len;
} d; } d;
} p; } p;
char word[1];
} SPELL; } SPELL;
#define SPELLHDRSZ (offsetof(SPELL, word))
typedef struct aff_struct typedef struct aff_struct
{ {
uint32 uint32
...@@ -106,7 +108,7 @@ typedef struct ...@@ -106,7 +108,7 @@ typedef struct
int nspell; int nspell;
int mspell; int mspell;
SPELL *Spell; SPELL **Spell;
AffixNode *Suffix; AffixNode *Suffix;
AffixNode *Prefix; AffixNode *Prefix;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment