Ignore:
Timestamp:
1999-06-30T16:04:14+12:00 (25 years ago)
Author:
rjmcnab
Message:

made stemming functions available from mgsearch and made the stems
for the query terms available in queryinfo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/mgq.c

    r308 r319  
    1212/*
    1313   $Log$
     14   Revision 1.5  1999/06/30 04:04:11  rjmcnab
     15   made stemming functions available from mgsearch and made the stems
     16   for the query terms available in queryinfo
     17
    1418   Revision 1.4  1999/06/28 08:56:29  rjmcnab
    1519   A bit of hacking to remove the restriction that the index to get
     
    6064#include "term_lists.h"
    6165#include "local_strings.h"
     66
     67#include "words.h"
     68#include "stemmer.h"
    6269 
    6370#ifdef __cplusplus
     
    561568
    562569
     570/* use mgq_getmaxstemlen to determine the length of the word stems to pass */
     571/* to mgq_stemword */
     572int mgq_getmaxstemlen () {
     573  return MAXSTEMLEN;
     574}
     575
     576/* note: the stemming method and the stemmer come from the last query */
     577/* "word" should be at least maxstemlen+1 long and it is a string that */
     578/* starts with the string length */
     579void mgq_stemword (unsigned char *word) {
     580  int stem_method = 0;
     581  query_data *qd = NULL;
     582
     583  if (cur_cachenum == -1) return;
     584  qd = dbcache[cur_cachenum].qd;
     585  if (qd == NULL || word == NULL) return;
     586
     587  if (qd->sd->sdh.indexed) {
     588    stem_method = BooleanEnv(GetEnv("casefold"),0) | (BooleanEnv(GetEnv("stem"),0) << 1);
     589  } else {
     590    stem_method = qd->sd->sdh.stem_method;
     591  }
     592
     593  stemmer (stem_method, qd->sd->sdh.stemmer_num, word);
     594}
     595
     596
     597
    563598int is_dbcache_full (void) {
    564599  init_dbcache ();
Note: See TracChangeset for help on using the changeset viewer.