Changeset 12881 for trunk


Ignore:
Timestamp:
2006-09-28T10:28:56+12:00 (18 years ago)
Author:
kjdon
Message:

Accent folding patch thanks to Juan Grigera. file suffixes with numbers in them now generated using a pattern and make suffix. added some #defines for stem/case flags for use with query parser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/mgpp/text/mg_files.h

    r2468 r12881  
    5151#define MAGIC_PARAGRAPH     GEN_MAGIC('M','G','P', 0 )
    5252/* [RPAP - Jan 97: Stem Index Change] */
    53 #define MAGIC_STEM_1            GEN_MAGIC('M','G','s','1')
    54 #define MAGIC_STEM_2            GEN_MAGIC('M','G','s','2')
    55 #define MAGIC_STEM_3            GEN_MAGIC('M','G','s','3')
    56 
     53/* [JFG - Mar 06: Accent folding patch] */
     54enum stemMethods {
     55    STEM_None       =   0,
     56    STEM_CaseFolding    =   0x1,
     57    STEM_Stemming       =   0x2,
     58    STEM_AccentFolding  =   0x4,
     59};
     60
     61/* This is for the QueryParser */
     62#define CHAR_FLAG_STEM_CaseFold    'i'  // ignore case
     63#define CHAR_FLAG_STEM_NoCaseFold  'c'  // case sensitive
     64#define CHAR_FLAG_STEM_Stemming    's'  // stem words
     65#define CHAR_FLAG_STEM_NoStemming  'u'  // do not stem words
     66#define CHAR_FLAG_STEM_AccentFold  'f'  // accent fold
     67#define CHAR_FLAG_STEM_NoAccentFold  'a'    // do no accent folding
     68#define CHAR_FLAG_STEM_Validator  "icsufa"  // all of the above
     69
     70
     71#define STEM_MIN 1
     72#define STEM_MAX (STEM_CaseFolding | STEM_Stemming | STEM_AccentFolding)
     73#define STEM_PARTIAL_MATCH  (STEM_MAX+1)
     74#define STEM_INVALID        (STEM_MAX+2)
     75#define MAGIC_STEM_GEN(x)       GEN_MAGIC('M', 'G', 's', x)
    5776#define IS_MAGIC(a) ((((u_long)(a)) & 0xffff0000) == MAGIC_XXXX)
    5877
     
    219238
    220239/* [RPAP - Jan 97: Stem Index Change] */
     240/* [JFG - Mar 06: Accent folding patch]
     241 * Use the pattern with make_suffix */
    221242/* The casefolded index into the stemmed dictionary */
    222243#ifdef SHORT_SUFFIX
    223 # define INVF_DICT_BLOCKED_1_SUFFIX ".ib1"
    224 #else
    225 # define INVF_DICT_BLOCKED_1_SUFFIX ".invf.dict.blocked.1"
    226 #endif
    227 
    228 /* [RPAP - Jan 97: Stem Index Change] */
    229 /* The stemmed index into the stemmed dictionary */
    230 #ifdef SHORT_SUFFIX
    231 # define INVF_DICT_BLOCKED_2_SUFFIX ".ib2"
    232 #else
    233 # define INVF_DICT_BLOCKED_2_SUFFIX ".invf.dict.blocked.2"
    234 #endif
    235 
    236 /* [RPAP - Jan 97: Stem Index Change] */
    237 /* The casefolded and stemmed  index into the stemmed dictionary */
    238 #ifdef SHORT_SUFFIX
    239 # define INVF_DICT_BLOCKED_3_SUFFIX ".ib3"
    240 #else
    241 # define INVF_DICT_BLOCKED_3_SUFFIX ".invf.dict.blocked.3"
    242 #endif
     244# define INVF_DICT_BLOCKED_SUFFIX_PAT ".ib%d"
     245#else
     246# define INVF_DICT_BLOCKED_SUFFIX_PAT ".invf.dict.blocked.%d"
     247#endif
     248
    243249
    244250/* [RPAP - Feb 97: WIN32 Port] */
     
    264270char *make_name (const char *name, const char *suffix, char *buffer);
    265271
    266 
     272/* [JFG - Mar 06: Accent folding patch] */
     273/* This generates the suffix of a file. It places the name in the buffer
     274   specified or if that is NULL it uses a static buffer. */
     275char *make_suffix (const char *suffix_format, const char suffix_arg, char *buffer);
    267276
    268277
Note: See TracChangeset for help on using the changeset viewer.