Changeset 12913


Ignore:
Timestamp:
2006-09-28T16:54:36+12:00 (18 years ago)
Author:
kjdon
Message:

we now check for existence of stem index for our stem method in FindWordNumbers - if it wasn't built, then we assume stem is 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/mgpp/text/Terms.cpp

    r12887 r12913  
    211211  equivWords.erase (equivWords.begin(), equivWords.end());
    212212
     213  // if the stem method specified is not a valid one (i.e. there was no appropriate stem index, then we set it to 0)
     214  // unless we have partial matching, in which case we are not doing stem indexes anyway.
     215  if (!(stemMethod & STEM_PARTIAL_MATCH) && indexData.stemFile[stemMethod-1] == NULL) {
     216    cerr << "Stem index for method "<<stemMethod<< " was not built, so not doing stemming\n";
     217    stemMethod = 0;
     218  }
    213219  /* [JFG - Mar 06: Accent folding patch] */
    214220  /* use flag PARTIAL_MATCH */ 
     
    230236    } else {
    231237      // partial matching,
    232       PartialMatchSearchWordBlockDictEl (indexData.dictFile, indexData.biWords, indexData.bdh.entries_per_wblk, indexData.bdh.word_dict_size, numLevels, term, wordDictEl, equivWords,
    233             (stemMethod & STEM_CaseFolding)? true : false);
    234             // TODO: Accent Folding is not handled here!!
     238      PartialMatchSearchWordBlockDictEl (indexData.dictFile, indexData.biWords, indexData.bdh.entries_per_wblk, indexData.bdh.word_dict_size, numLevels, term, wordDictEl, equivWords, (stemMethod & STEM_CaseFolding)? true : false);
     239      // TODO: Accent Folding is not handled here!!
    235240      return;
    236241    }
     
    238243             
    239244  // need to stem this word and find it in the blocked stem index
    240   unsigned char  mgWord[MAXSTEMLEN + 1];
     245  unsigned char mgWord[MAXSTEMLEN + 1];
    241246  UCArray stemTerm;
    242247  unsigned long stemmerNum = 0;
     
    247252    //TODO: throw an error here
    248253  }
     254
    249255  stemmerNum = indexData.sih[stemMethod-1].stemmer_num;
    250256 
Note: See TracChangeset for help on using the changeset viewer.