Ignore:
Timestamp:
2000-07-24T14:15:17+12:00 (24 years ago)
Author:
kjm18
Message:

removed BrowseCompare(), added UCArrayVector type

Location:
trunk/gsdl/src/mgpp/text
Files:
2 edited

Legend:

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

    r1125 r1297  
    228228}
    229229
    230 /* comparison for browse index - items match if the smaller word
    231    is a prefix of the larger word, case independent
    232 */
    233 int BrowseCompare (const UCArray &a1, const UCArray &a2) {
    234   unsigned int l1 = a1.size();
    235   unsigned int l2 = a2.size();
    236   unsigned int l = (l1 < l2) ? l1 : l2; // l is the shorter of the two
    237   int diff = 0;
    238 
    239   UCArray::const_iterator a1Here = a1.begin();
    240   UCArray::const_iterator a2Here = a2.begin();
    241 
    242   while(l--) {
    243     if ((diff = casecharmap[*a1Here] - casecharmap[*a2Here]) !=0)
    244       return diff;
    245     a1Here++;
    246     a2Here++;
    247   }
    248   return 0;
    249 
    250 }
    251 
    252230unsigned long PrefixLen (const UCArray &a1, const UCArray &a2) {
    253231  unsigned long l = (a1.size() < a2.size()) ? a1.size() : a2.size();
  • trunk/gsdl/src/mgpp/text/UCArray.h

    r1125 r1297  
    9090// compares the two strings in dictionary order
    9191int DictCompare (const UCArray &a1, const UCArray &a2);
    92 // compares the two strings, case independent, a match (ie 0) is
    93 // if one string is a prefix of the other
    94 int BrowseCompare (const UCArray &a1, const UCArray &a2);
    9592
    9693struct LTUCArray {
     
    106103
    107104typedef set<UCArray, LTUCArray> UCArraySet;
    108 
     105typedef vector<UCArray> UCArrayVector;
    109106
    110107unsigned long PrefixLen (const UCArray &a1, const UCArray &a2);
Note: See TracChangeset for help on using the changeset viewer.