Changeset 9611
- Timestamp:
- 2005-04-08T15:35:12+12:00 (19 years ago)
- Location:
- trunk/gsdl/src/mgpp/text
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/mgpp/text/FIvfLevelInfo.cpp
r2468 r9611 88 88 levelInfo[thisLevel.levelTag] = thisLevel; 89 89 90 arrSize--;90 --arrSize; 91 91 } 92 92 … … 108 108 if (!(*here).second.Write (f)) return false; 109 109 110 here++;110 ++here; 111 111 } 112 112 … … 123 123 while (here != end) { 124 124 s << (*here).second; 125 here++;125 ++here; 126 126 } 127 127 -
trunk/gsdl/src/mgpp/text/FText.cpp
r2468 r9611 94 94 levelInfo[thisLevel.levelTag] = thisLevel; 95 95 96 arrSize--;96 --arrSize; 97 97 } 98 98 … … 110 110 if (!(*here).second.Write (f)) return false; 111 111 112 here++;112 ++here; 113 113 } 114 114 … … 121 121 while (here != end) { 122 122 s << (*here).second; 123 here++;123 ++here; 124 124 } 125 125 … … 185 185 if (!idx.Read(f)) return false; 186 186 a.push_back (idx); 187 arrSize --;187 --arrSize; 188 188 } 189 189 … … 196 196 while (here != end) { 197 197 if (!(*here).Write(f)) return false; 198 here++;198 ++here; 199 199 } 200 200 -
trunk/gsdl/src/mgpp/text/FileBuf.h
r2514 r9611 65 65 66 66 inline bool Next () { 67 if (here != end || NextBuf()) { here++; return true; }67 if (here != end || NextBuf()) { ++here; return true; } 68 68 return false; 69 69 } -
trunk/gsdl/src/mgpp/text/FragLevelConvert.cpp
r3347 r9611 47 47 unsigned long fragNum = 0; 48 48 unsigned long i; 49 for (i=0; i<numLevelDocs; i++) {49 for (i=0; i<numLevelDocs; ++i) { 50 50 unsigned long delta = buffer.bblock_decode (B, NULL)-1; 51 51 fragNum += delta; -
trunk/gsdl/src/mgpp/text/GSDLQueryParser.cpp
r8691 r9611 156 156 return 4; // incorrect format 157 157 158 here++;158 ++here; 159 159 unsigned char c2 = 'a'; 160 160 if (here !=end) { -
trunk/gsdl/src/mgpp/text/QueryResultsSort.h
r2468 r9611 70 70 if (comp(*(parallelHeap + secondChild), 71 71 *(parallelHeap + (secondChild - 1)))) 72 secondChild--;72 --secondChild; 73 73 swap (*(parallelHeap+holeIndex), *(parallelHeap+secondChild)); 74 74 swap (*(docNumHeap+holeIndex), *(docNumHeap+secondChild)); … … 102 102 103 103 unsigned long i = 0; 104 for (i=1; i<=size; i++)104 for (i=1; i<=size; ++i) 105 105 PushHeap (docNumHeap, parallelHeap, i, comp); 106 106 } … … 115 115 116 116 unsigned long i; 117 for (i=size; i>1; i--)117 for (i=size; i>1; --i) 118 118 PopHeap (docNumHeap, parallelHeap, i, comp); 119 119 } … … 129 129 const Compare &comp) { 130 130 unsigned long i; 131 for (i=0; i<addSize; i++) {131 for (i=0; i<addSize; ++i) { 132 132 if (comp(*(parallelAdd+i), *(parallelHeap))) { 133 133 swap (*(docNumHeap), *(docNumAdd+i)); -
trunk/gsdl/src/mgpp/text/Weights.cpp
r2468 r9611 74 74 // read in the weights 75 75 unsigned long i; 76 for (i=0; i<arrSize; i++) {76 for (i=0; i<arrSize; ++i) { 77 77 ReadUL (approxWeightsFile, weightBuf[i]); 78 78 } … … 84 84 table = new float[tableSize]; 85 85 table[0] = L; 86 for (i = 1; i < tableSize; i++)86 for (i = 1; i < tableSize; ++i) 87 87 table[i] = table[i - 1] * B; 88 88 } -
trunk/gsdl/src/mgpp/text/comp_dict.cpp
r2541 r9611 89 89 } 90 90 91 for (i = 0; i < cfh->hd.num_codes; i++, words++)91 for (i = 0; i < cfh->hd.num_codes; ++i, ++words) 92 92 { 93 93 register int val, copy; … … 171 171 goto error; 172 172 173 for (which = 0; which < 2; which++)173 for (which = 0; which < 2; ++which) 174 174 switch (cdh.dict_type) 175 175 { -
trunk/gsdl/src/mgpp/text/hash.h
r2468 r9611 29 29 register unsigned long hval; \ 30 30 if (len>25) len = 25; \ 31 for (hval=0; len; len--) \31 for (hval=0; len; --len) \ 32 32 hval = (hval << 5) - hval + *p++; \ 33 33 step = hval % (tablesize - 2) + 1; \ -
trunk/gsdl/src/mgpp/text/invf.cpp
r8244 r9611 115 115 116 116 unsigned long i; 117 for (i=0; i<numLevels; i++) {117 for (i=0; i<numLevels; ++i) { 118 118 if (!ReadUL (f, levelFreqs[i])) return false; 119 119 } … … 129 129 130 130 unsigned long i; 131 for (i=0; i<numLevels; i++) {131 for (i=0; i<numLevels; ++i) { 132 132 if (!WriteUL (f, levelFreqs[i])) return false; 133 133 } … … 240 240 241 241 unsigned long i; 242 for (i=0; i<numLevels; i++) {242 for (i=0; i<numLevels; ++i) { 243 243 if (!ReadUL (f, levelFreqs[i])) return false; 244 244 } … … 254 254 255 255 unsigned long i; 256 for (i=0; i<numLevels; i++) {256 for (i=0; i<numLevels; ++i) { 257 257 if (!WriteUL (f, levelFreqs[i])) return false; 258 258 } … … 297 297 blockIdx.push_back (bi); 298 298 299 arraySize--;299 --arraySize; 300 300 } 301 301 … … 311 311 while (here != end) { 312 312 if (!(*here).Write (f)) return false; 313 here++;313 ++here; 314 314 } 315 315 … … 392 392 equivWords.push_back (wordNum); 393 393 394 arraySize--;394 --arraySize; 395 395 } 396 396 … … 408 408 while (here != end) { 409 409 if (!WriteUL (f, (*here))) return false; 410 here++;410 ++here; 411 411 } 412 412 … … 428 428 429 429 int i; 430 for (i=0; i<16; i++) params[i] = 0;430 for (i=0; i<16; ++i) params[i] = 0; 431 431 } 432 432 … … 438 438 439 439 int i; 440 for (i=0; i<16; i++) {440 for (i=0; i<16; ++i) { 441 441 if (!ReadUL (f, params[i])) return false; 442 442 } … … 452 452 453 453 int i; 454 for (i=0; i<16; i++) {454 for (i=0; i<16; ++i) { 455 455 if (!WriteUL (f, params[i])) return false; 456 456 } … … 565 565 else if (res > 0) break; // not here 566 566 567 elNum++;567 ++elNum; 568 568 } 569 569 … … 626 626 else if (res > 0) break; // not here 627 627 628 elNum++;628 ++elNum; 629 629 } 630 630 … … 685 685 else if (res > 0) break; // not here 686 686 687 elNum++;687 ++elNum; 688 688 } 689 689 … … 733 733 } // else keep looking 734 734 735 elNum++;735 ++elNum; 736 736 } 737 737 // if we get here, we are either still searching for the first … … 746 746 if (casefold || StartsWith(dictEl.el, el)) { 747 747 elNumList.push_back(elNum); 748 elNum++;748 ++elNum; 749 749 } 750 750 … … 757 757 elNumList.push_back(elNum); 758 758 } 759 elNum++;759 ++elNum; 760 760 dictEl.Read (dictFile, numLevels); 761 761 } … … 798 798 } 799 799 800 elNum++;800 ++elNum; 801 801 } 802 802 // it must be the last term … … 845 845 dictEl.Read(dictFile, numLevels); 846 846 terms.push_back(dictEl.el); 847 curElNum++;847 ++curElNum; 848 848 } 849 849 … … 899 899 dictEl.levelFreqs = NULL; 900 900 terms.push_back(dictEl); 901 curElNum++;902 } 903 904 return true; 905 } 906 907 908 909 910 911 912 913 914 901 ++curElNum; 902 } 903 904 return true; 905 } 906 907 908 909 910 911 912 913 914 -
trunk/gsdl/src/mgpp/text/ivf.pass1.cpp
r3008 r9611 207 207 blankLevel.levelTag = *levelHere; 208 208 ivfLevel.levelInfo[*levelHere] = blankLevel; 209 levelHere++;209 ++levelHere; 210 210 } 211 211 … … 219 219 // check for start of next fragment 220 220 if (!wordLevelIndex && el.tagName == tagInfo.indexLevel) { 221 numFrags++;222 numChunkFrags++;221 ++numFrags; 222 ++numChunkFrags; 223 223 inFrag = true; 224 224 } … … 231 231 ivfTagInfoOccurOrder.push_back (iIt); 232 232 } 233 i.tagCount++;233 ++i.tagCount; 234 234 235 235 // all open tags count as new tags 236 numChunkEntries++;237 i.fragCount++;238 i.chunkFragCount++;236 ++numChunkEntries; 237 ++i.fragCount; 238 ++i.chunkFragCount; 239 239 i.lastFragNum = numFrags; 240 240 … … 243 243 if (levelIt != ivfLevel.levelInfo.end()) { 244 244 // is a level tag 245 (*levelIt).second.numEntries++;246 (*levelIt).second.workInLevel = true;245 ++levelIt->second.numEntries; 246 levelIt->second.workInLevel = true; 247 247 } 248 248 } … … 289 289 290 290 if (!word.empty()) { 291 numWords++;291 ++numWords; 292 292 293 293 if (wordLevelIndex) { 294 numFrags++;295 numChunkFrags++;294 ++numFrags; 295 ++numChunkFrags; 296 296 } 297 297 … … 310 310 } 311 311 312 i.wordCount++;313 i.chunkWordCount++;312 ++i.wordCount; 313 ++i.chunkWordCount; 314 314 if (numFrags > i.lastFragNum) { 315 numChunkEntries++;316 i.fragCount++;317 i.chunkFragCount++;315 ++numChunkEntries; 316 ++i.fragCount; 317 ++i.chunkFragCount; 318 318 i.lastFragNum = numFrags; 319 319 } … … 335 335 if ((*levelHere).second.numEntries > (*levelWorkerPtr).lastLevelDocNum) { 336 336 (*levelWorkerPtr).lastLevelDocNum = (*levelHere).second.numEntries; 337 (*levelWorkerPtr).count ++;337 ++levelWorkerPtr->count; 338 338 } 339 339 340 levelHere++;341 levelWorkerPtr++;340 ++levelHere; 341 ++levelWorkerPtr; 342 342 } 343 343 } … … 362 362 } 363 363 364 wordHere++;364 ++wordHere; 365 365 } 366 366 … … 376 376 } 377 377 378 tagHere++;378 ++tagHere; 379 379 } 380 380 … … 400 400 cout << (*tagMapHere).first << " " << tagNum 401 401 << " " << (*tagMapHere).second.chunkFragCount << "\n"; 402 tagNum++;403 tagMapHere++;402 ++tagNum; 403 ++tagMapHere; 404 404 } 405 405 } … … 407 407 408 408 static void OutputChunkInfo (unsigned long mem, bool /*wordLevelIndex*/) { 409 chunksWritten++;409 ++chunksWritten; 410 410 411 411 // sanity check … … 446 446 ivfWordInfo.chunkFragCount = 0; 447 447 448 wordHere++;448 ++wordHere; 449 449 } 450 450 … … 460 460 ivfTagInfo.chunkFragCount = 0; 461 461 462 tagHere++;462 ++tagHere; 463 463 } 464 464 … … 474 474 if (wordLevelIndex) inFrag = true; // unconditional 475 475 476 numDocs++;477 numChunkDocs++;476 ++numDocs; 477 ++numChunkDocs; 478 478 479 479 // process each text element in this document … … 488 488 ProcessText (tagInfo, *here, inFrag); 489 489 490 here++;490 ++here; 491 491 } 492 492 … … 533 533 lastWord = &((*wordHere).first); 534 534 535 wordHere++;535 ++wordHere; 536 536 } 537 537 … … 548 548 lastWord = &((*tagHere).first); 549 549 550 tagHere++;550 ++tagHere; 551 551 } 552 552 } … … 613 613 while (lwHere != lwEnd) { 614 614 WriteUL (sp, (*lwHere).count); 615 lwHere++;615 ++lwHere; 616 616 } 617 617 618 618 lastWord = &thisWord; 619 wordHere++;619 ++wordHere; 620 620 } 621 621 … … 638 638 639 639 lastTag = &thisTag; 640 tagHere++;640 ++tagHere; 641 641 } 642 642 … … 669 669 while (wordHere != wordEnd) { 670 670 (*wordHere).second.lastFragNum = i; 671 i++; wordHere++;671 ++i; ++wordHere; 672 672 } 673 673 … … 678 678 while (tagHere != tagEnd) { 679 679 (*tagHere).second.lastFragNum = i; 680 i++; tagHere++;680 ++i; ++tagHere; 681 681 } 682 682 … … 698 698 register IvfWordInfo &ivfWordInfo = (*(*wordItHere)).second; 699 699 buffer.binary_encode (ivfWordInfo.lastFragNum + 1, wordDictSize + 1, NULL); 700 oN++;701 wordItHere++;700 ++oN; 701 ++wordItHere; 702 702 } 703 703 … … 709 709 register IvfTagInfo &ivfTagInfo = (*(*tagItHere)).second; 710 710 buffer.binary_encode (ivfTagInfo.lastFragNum + 1, tagDictSize + 1, NULL); 711 oN++;712 tagItHere++;711 ++oN; 712 ++tagItHere; 713 713 } 714 714 -
trunk/gsdl/src/mgpp/text/ivf.pass2.cpp
r3008 r9611 132 132 if (wordBitPtrs == NULL) return; 133 133 unsigned long i; 134 for (i=0; i<size; i++) wordBitPtrs[i].Clear();134 for (i=0; i<size; ++i) wordBitPtrs[i].Clear(); 135 135 } 136 136 … … 235 235 void ClearCache () { 236 236 unsigned int i = 0; 237 for (i=0; i<ISR_SIZE; i++) recCache[i].Clear();237 for (i=0; i<ISR_SIZE; ++i) recCache[i].Clear(); 238 238 } 239 239 … … 312 312 else 313 313 val = rbs.binary_decode (tagDictSize + 1, NULL) - 1; 314 pos++;314 ++pos; 315 315 } 316 316 return val; … … 437 437 unsigned long tagNum; 438 438 dict_el thisEl; 439 for (tagNum = 0; tagNum < _idh.tag_dict_size; tagNum++) {439 for (tagNum = 0; tagNum < _idh.tag_dict_size; ++tagNum) { 440 440 thisEl.Read (dictFile); 441 441 tagMapDict[thisEl.el].tagNum = tagNum; … … 483 483 mg_ullong lastTotalIBits; 484 484 unsigned long N = _idh.num_frags; 485 for (dictWordNum=0; dictWordNum<_idh.word_dict_size; dictWordNum++) {485 for (dictWordNum=0; dictWordNum<_idh.word_dict_size; ++dictWordNum) { 486 486 // lastTotalIBits is used to detect integer overflow 487 487 lastTotalIBits = totalIBits; … … 522 522 unsigned long dictTagNum; 523 523 N = _idh.num_frags; 524 for (dictTagNum=0; dictTagNum<_idh.tag_dict_size; dictTagNum++) {524 for (dictTagNum=0; dictTagNum<_idh.tag_dict_size; ++dictTagNum) { 525 525 // lastTotalIBits is used to detect integer overflow 526 526 lastTotalIBits = totalIBits; … … 559 559 unsigned long numChunkTags) { 560 560 static unsigned long chunksRead = 0; 561 chunksRead++;561 ++chunksRead; 562 562 cout << "Chunk Number: " << chunksRead << "\n"; 563 563 cout << "numChunkDocs " << numDocsInChunk << "\n"; … … 573 573 cout << (*tagMapHere).first << " " << tagMapNum << " " 574 574 << bitPtrs.GetTagBitPtr(tagMapNum).here << "\n"; 575 tagMapHere++;575 ++tagMapHere; 576 576 } 577 577 } … … 607 607 unsigned long numOccur; 608 608 unsigned long wordNum; 609 for (numOccur=0; numOccur<numChunkWords; numOccur++) {609 for (numOccur=0; numOccur<numChunkWords; ++numOccur) { 610 610 wordNum = occurConvert.TranslateWord (numOccur); 611 611 BitPtr &wordPtr = bitPtrs.GetWordBitPtr (wordNum); … … 616 616 } 617 617 unsigned long tagNum; 618 for (numOccur=0; numOccur<numChunkTags; numOccur++) {618 for (numOccur=0; numOccur<numChunkTags; ++numOccur) { 619 619 tagNum = occurConvert.TranslateTag (numOccur); 620 620 BitPtr &tagPtr = bitPtrs.GetTagBitPtr (tagNum); … … 629 629 unsigned long totalIBits = 0; // only dealing with memory 630 630 unsigned long chunkWordCount, chunkFragCount; 631 for (wordNum=0; wordNum<_idh.word_dict_size; wordNum++) {631 for (wordNum=0; wordNum<_idh.word_dict_size; ++wordNum) { 632 632 BitPtr &wordPtr = bitPtrs.GetWordBitPtr (wordNum); 633 633 chunkWordCount = wordPtr.start; … … 647 647 } 648 648 } 649 for (tagNum=0; tagNum<_idh.tag_dict_size; tagNum++) {649 for (tagNum=0; tagNum<_idh.tag_dict_size; ++tagNum) { 650 650 BitPtr &tagPtr = bitPtrs.GetTagBitPtr (tagNum); 651 651 chunkFragCount = tagPtr.here; … … 783 783 bool wordLevelIndex = ivfLevel.indexLevel.empty(); 784 784 if (!wordLevelIndex && el.tagName == ivfLevel.indexLevel) { 785 numFrags++;785 ++numFrags; 786 786 inFrag = true; 787 787 } … … 819 819 820 820 if (mgWord[0] > 0) { 821 if (wordLevelIndex) numFrags++;821 if (wordLevelIndex) ++numFrags; 822 822 823 823 unsigned long wordNum = perf_hash (wordHashDict, mgWord); … … 885 885 unsigned long delta; 886 886 unsigned long currFreq; 887 for (wordNum=0; wordNum<idh.word_dict_size; wordNum++) {887 for (wordNum=0; wordNum<idh.word_dict_size; ++wordNum) { 888 888 // go to the end of the last inverted file entry 889 889 InvfStateRec &wordDiskState = invfState.GetRec (wordNum); … … 918 918 unsigned long currTagStart; 919 919 unsigned long currTagEnd; 920 for (tagNum=0; tagNum<idh.tag_dict_size; tagNum++) {920 for (tagNum=0; tagNum<idh.tag_dict_size; ++tagNum) { 921 921 // go to the end of the last inverted file entry 922 922 InvfStateRec &tagDiskState = invfState.GetRec (tagNum+idh.word_dict_size); … … 974 974 else ProcessText (*here, inFrag); 975 975 976 here++;976 ++here; 977 977 } 978 978 … … 982 982 while (tdHere != tdEnd) { 983 983 CloseTextTag ((*tdHere).second, (*tdHere).first); 984 tdHere++;984 ++tdHere; 985 985 } 986 986 987 987 // we've processed one more document 988 numDocs++;989 numChunkDocs++;988 ++numDocs; 989 ++numChunkDocs; 990 990 991 991 // merge the memory based inverted file with the one on … … 1019 1019 unsigned long entryNum; 1020 1020 mg_ullong lastStart = 0; 1021 for (entryNum = 0; entryNum < numEntries; entryNum++) {1021 for (entryNum = 0; entryNum < numEntries; ++entryNum) { 1022 1022 InvfStateRec &stateRec = invfState.GetRec (entryNum); 1023 1023 … … 1045 1045 } 1046 1046 putc (c, outInvfFile); 1047 bytesOutput++;1048 oldEntryStart++;1047 ++bytesOutput; 1048 ++oldEntryStart; 1049 1049 } 1050 1050 } … … 1069 1069 unsigned long numEntries = idh.word_dict_size + idh.tag_dict_size; 1070 1070 unsigned long entryNum; 1071 for (entryNum = 0; entryNum < numEntries; entryNum++) {1071 for (entryNum = 0; entryNum < numEntries; ++entryNum) { 1072 1072 InvfStateRec &stateRec = invfState.GetRec (entryNum); 1073 1073 -
trunk/gsdl/src/mgpp/text/locallib.cpp
r2928 r9611 36 36 double bits = 0.0; 37 37 38 for (i = 0; i < n; i++)38 for (i = 0; i < n; ++i) 39 39 total += A[i]; 40 for (i = 0; i < n; i++)40 for (i = 0; i < n; ++i) 41 41 if (A[i]) 42 42 bits += A[i] * log2 (1.0 * total / A[i]); … … 70 70 { 71 71 int i; 72 for (i = n / 2 - 1; i >= 0; i--)72 for (i = n / 2 - 1; i >= 0; --i) 73 73 siftdown (A, i, n); 74 74 } … … 81 81 B = (int *) Xmalloc (n * sizeof (int)); 82 82 j = 0; 83 for (i = 0; i < n; i++)83 for (i = 0; i < n; ++i) 84 84 { 85 85 if (A[i]) … … 98 98 v1 = B[0]; 99 99 B[0] = B[n - 1]; 100 n--;100 --n; 101 101 siftdown (B, 0, n); 102 102 v2 = B[0]; … … 116 116 117 117 last = -1; 118 for (i = 0; i < n; i++)118 for (i = 0; i < n; ++i) 119 119 { 120 120 if (A[i]) … … 122 122 bits += BIO_Gamma_Length (i - last) + BIO_Gamma_Length (A[i]); 123 123 last = i; 124 N++;124 ++N; 125 125 } 126 126 } … … 146 146 int j; 147 147 while (limit * limit < p) 148 limit++;148 ++limit; 149 149 for (j = 3; j <= limit && p % j; j += 2) 150 150 ; /* NULLBODY */ … … 170 170 NTOHUL(cdh->dict_type); 171 171 NTOHUL(cdh->novel_method); 172 for (i = 0; i < TEXT_PARAMS; i++)172 for (i = 0; i < TEXT_PARAMS; ++i) 173 173 NTOHUL(cdh->params[i]); 174 174 NTOHUL(cdh->num_words[0]); … … 208 208 209 209 /* [RPAP - Jan 97: Endian Ordering] */ 210 for (i = cfh->hd.mincodelen; i < cfh->hd.maxcodelen + 1; i++)210 for (i = cfh->hd.mincodelen; i < cfh->hd.maxcodelen + 1; ++i) 211 211 NTOHUL(cfh->huff_words_size[i]); 212 212 -
trunk/gsdl/src/mgpp/text/mg.special.cpp
r2468 r9611 48 48 } 49 49 50 here++;50 ++here; 51 51 } 52 52 -
trunk/gsdl/src/mgpp/text/mgpp_invf_dict.cpp
r3015 r9611 87 87 word_dict_el wordEl; 88 88 wordEl.SetNumLevels (idh.num_levels); 89 for (wordNum=0; wordNum<idh.word_dict_size; wordNum++) {89 for (wordNum=0; wordNum<idh.word_dict_size; ++wordNum) { 90 90 // read in the next word and inverted file pointer 91 91 wordEl.Read (dictFile, idh.num_levels); … … 116 116 wordBlockEl.invf_ptr = wordInvfPtr; 117 117 unsigned long tempI; 118 for (tempI=0; tempI<idh.num_levels; tempI++)118 for (tempI=0; tempI<idh.num_levels; ++tempI) 119 119 wordBlockEl.levelFreqs[tempI] = wordEl.levelFreqs[tempI]; 120 120 … … 141 141 dict_el tagEl; 142 142 lastEl.erase (lastEl.begin(), lastEl.end()); 143 for (tagNum=0; tagNum<idh.tag_dict_size; tagNum++) {143 for (tagNum=0; tagNum<idh.tag_dict_size; ++tagNum) { 144 144 // read in the next tag and inverted file pointer 145 145 tagEl.Read (dictFile); -
trunk/gsdl/src/mgpp/text/mgpp_invf_dict_dump.cpp
r3015 r9611 74 74 word_dict_el wordEl; 75 75 wordEl.SetNumLevels (idh.num_levels); 76 for (wordNum=0; wordNum<idh.word_dict_size; wordNum++) {76 for (wordNum=0; wordNum<idh.word_dict_size; ++wordNum) { 77 77 wordEl.Read (dictFile, idh.num_levels); 78 78 cout << "\"" << wordEl.el << "\"\n";// (" << wordNum << ")\n"; … … 88 88 unsigned long tagNum; 89 89 dict_el tagEl; 90 for (tagNum=0; tagNum<idh.tag_dict_size; tagNum++) {90 for (tagNum=0; tagNum<idh.tag_dict_size; ++tagNum) { 91 91 // read in the next tag and inverted file pointer 92 92 tagEl.Read (dictFile); -
trunk/gsdl/src/mgpp/text/mgpp_invf_dump.cpp
r3015 r9611 64 64 unsigned long fragNum = 0; 65 65 unsigned long i; 66 for (i=0; i<wordEl.frag_occur; i++) {66 for (i=0; i<wordEl.frag_occur; ++i) { 67 67 unsigned long delta = buffer.bblock_decode (B, NULL); 68 68 fragNum += delta; … … 101 101 unsigned long fragNum = 0; 102 102 unsigned long i; 103 for (i=0; i<tagEl.frag_occur; i++) {103 for (i=0; i<tagEl.frag_occur; ++i) { 104 104 unsigned long delta = buffer.bblock_decode (B, NULL)-1; 105 105 fragNum += delta; … … 172 172 word_dict_el wordEl; 173 173 wordEl.SetNumLevels (idh.num_levels); 174 for (wordNum=0; wordNum<idh.word_dict_size; wordNum++) {174 for (wordNum=0; wordNum<idh.word_dict_size; ++wordNum) { 175 175 wordEl.Read (dictFile, idh.num_levels); 176 176 ReadUL (invfIdxFile, wordStart); … … 184 184 unsigned long tagStart; 185 185 dict_el tagEl; 186 for (tagNum=0; tagNum<idh.tag_dict_size; tagNum++) {186 for (tagNum=0; tagNum<idh.tag_dict_size; ++tagNum) { 187 187 tagEl.Read (dictFile); 188 188 ReadUL (invfIdxFile, tagStart); -
trunk/gsdl/src/mgpp/text/mgpp_passes.cpp
r8691 r9611 118 118 if ((in_fd = open (files[0], O_RDONLY)) == -1) 119 119 FatalError (1, "Cannot open %s", files[0]); 120 files++;121 num_files--;120 ++files; 121 --num_files; 122 122 return (in_fd); 123 123 } … … 134 134 135 135 // initialise all the passes 136 for (pass = 0; pass < MAX_PASSES; pass++) {136 for (pass = 0; pass < MAX_PASSES; ++pass) { 137 137 if (Passes & (1 << pass)) { 138 138 if (PassData[pass].init (tagInfo, file_name) == COMPERROR) … … 155 155 156 156 // give this document to each pass 157 for (pass = 0; pass < MAX_PASSES; pass++) {157 for (pass = 0; pass < MAX_PASSES; ++pass) { 158 158 if (Passes & (1 << pass)) { 159 159 if (PassData[pass].process (tagInfo, doc) == COMPERROR) … … 164 164 // another document has been processed 165 165 numBytes += docLen; 166 numDocs++;166 ++numDocs; 167 167 } 168 168 … … 171 171 172 172 // do done for each pass 173 for (pass = 0; pass < MAX_PASSES; pass++) {173 for (pass = 0; pass < MAX_PASSES; ++pass) { 174 174 if (Passes & (1 << pass)) { 175 175 if (PassData[pass].done (tagInfo, file_name) == COMPERROR) -
trunk/gsdl/src/mgpp/text/mgpp_perf_hash_build.cpp
r3015 r9611 80 80 word_dict_el wordEl; 81 81 wordEl.SetNumLevels (idh.num_levels); 82 for (i = 0; i < idh.word_dict_size; i++) {82 for (i = 0; i < idh.word_dict_size; ++i) { 83 83 // read the next word and associated information 84 84 wordEl.Read (dictFile, idh.num_levels); -
trunk/gsdl/src/mgpp/text/mgpp_stem_idx.cpp
r3015 r9611 71 71 UCArray stemEl; 72 72 wordEl.SetNumLevels (idh.num_levels); 73 for (wordNum=0; wordNum<idh.word_dict_size; wordNum++) {73 for (wordNum=0; wordNum<idh.word_dict_size; ++wordNum) { 74 74 // read in the next word 75 75 wordEl.Read (dictFile, idh.num_levels); … … 163 163 stemEl.Write (stemDictFile, &lastEl); 164 164 165 here++; stemNum++;165 ++here; ++stemNum; 166 166 } 167 167 -
trunk/gsdl/src/mgpp/text/mgpp_weights_build.cpp
r3015 r9611 85 85 unsigned long tagPtr; 86 86 dict_el thisEl; 87 for (tagNum = 0; tagNum < idh.tag_dict_size; tagNum++) {87 for (tagNum = 0; tagNum < idh.tag_dict_size; ++tagNum) { 88 88 thisEl.Read (dictFile); 89 89 ReadUL (invfIdxFile, tagPtr); … … 126 126 word_dict_el wordEl; 127 127 wordEl.SetNumLevels (idh.num_levels); 128 for (wordNum=0; wordNum<idh.word_dict_size; wordNum++) {128 for (wordNum=0; wordNum<idh.word_dict_size; ++wordNum) { 129 129 #ifndef SILENT 130 130 // give a little feedback every 4096 words … … 149 149 150 150 unsigned long count, i; 151 for (i=0; i<wordEl.frag_occur; i++) {151 for (i=0; i<wordEl.frag_occur; ++i) { 152 152 fragNum += buffer.bblock_decode (B, NULL); 153 153 if (!ifh.word_level_index) count = buffer.gamma_decode (NULL); … … 171 171 if (lastLevelDocNum > 0) { 172 172 AddWeight (w, lastLevelDocNum, termFreq, idf); 173 checkLevelFreq++;173 ++checkLevelFreq; 174 174 } 175 175 lastLevelDocNum = levelDocNum; … … 181 181 if (lastLevelDocNum > 0) { 182 182 AddWeight (w, lastLevelDocNum, termFreq, idf); 183 checkLevelFreq++;183 ++checkLevelFreq; 184 184 } 185 185 … … 209 209 // cout << *here << "\n"; 210 210 WriteF (weightsFile, sqrt (*here)); 211 here++;211 ++here; 212 212 } 213 213 } … … 229 229 if (wgt > U) U = wgt; 230 230 if (wgt > 0 && wgt < L) L = wgt; 231 here++;231 ++here; 232 232 } 233 233 … … 271 271 } 272 272 273 here++; i++;273 ++here; ++i; 274 274 } 275 275 … … 376 376 w, bits); 377 377 378 levelHere++; levelNum++;378 ++levelHere; ++levelNum; 379 379 } 380 380 -
trunk/gsdl/src/mgpp/text/stemmer.cpp
r2468 r9611 44 44 45 45 /* casefold and simplify-fold */ 46 for (i=0; i<len; i++) {46 for (i=0; i<len; ++i) { 47 47 out[i+1] = unicode_tosimplified(unicode_tolower(out[i+1])); 48 48 } … … 59 59 /* copy and case-fold the description */ 60 60 for (i=0; (stemmerdescription[i] != '\0') && 61 (i < MAX_STEM_DESCRIPTION_LEN-1); i++)61 (i < MAX_STEM_DESCRIPTION_LEN-1); ++i) 62 62 descript[i] = tolower (stemmerdescription[i]); 63 63 descript[i] = '\0'; -
trunk/gsdl/src/mgpp/text/text.cpp
r2468 r9611 81 81 compression_dict::compression_dict () { 82 82 int which; 83 for (which = 0; which < 2; which++) {83 for (which = 0; which < 2; ++which) { 84 84 cfh[which] = NULL; 85 85 values[which] = NULL; … … 102 102 void compression_dict::Clear () { 103 103 int which; 104 for (which = 0; which < 2; which++) {104 for (which = 0; which < 2; ++which) { 105 105 if (cfh[which] != NULL) { 106 106 delete cfh[which]; -
trunk/gsdl/src/mgpp/text/text.pass1.cpp
r3008 r9611 102 102 ChangeMem (POOL_SIZE); 103 103 104 for (which = 1; which >= 0; which--) {104 for (which = 1; which >= 0; --which) { 105 105 u_char *word; 106 106 hash_rec *ent; … … 122 122 word = Pool; 123 123 *Pool++ = '\0'; 124 PoolLeft--;124 --PoolLeft; 125 125 { 126 126 register u_char *wptr; … … 165 165 else PARSE_NON_WORD (Word, s_in, end); 166 166 167 dd->wordnum++;167 ++dd->wordnum; 168 168 inputbytes += *Word; 169 dd->words_read++;169 ++dd->words_read; 170 170 171 171 /* Search the hash table for Word */ … … 196 196 Pool += len; 197 197 PoolLeft -= len; 198 dd->HashUsed++;198 ++dd->HashUsed; 199 199 dd->bytes_diff += Word[0]; 200 200 break; … … 205 205 s2 = ent->word; 206 206 len = *s1 + 1; 207 for (; len; len--)207 for (; len; --len) 208 208 if (*s1++ != *s2++) break; 209 209 … … 212 212 if (hashval >= (unsigned long)hsize) hashval -= hsize; 213 213 } else { 214 ent->wcnt++;214 ++ent->wcnt; 215 215 break; 216 216 } … … 231 231 memset (ht, '\0', sizeof (hash_rec) * size); 232 232 233 for (i = 0; i < dd->HashSize; i++)233 for (i = 0; i < dd->HashSize; ++i) 234 234 if (dd->HashTable[i].word) { 235 235 register u_char *wptr; … … 272 272 if (retValue != COMPALLOK) return retValue; 273 273 274 here++;274 ++here; 275 275 } 276 276 … … 279 279 280 280 // update header information 281 csh.num_docs++;281 ++csh.num_docs; 282 282 csh.num_bytes += docLen; 283 283 … … 288 288 static int PackHashTable (dict_data * dd) { 289 289 int s, d; 290 for (s = d = 0; (unsigned int)s < dd->HashSize; s++)290 for (s = d = 0; (unsigned int)s < dd->HashSize; ++s) 291 291 if (dd->HashTable[s].word) 292 292 dd->HashTable[d++] = dd->HashTable[s]; … … 321 321 fsh.num_frags = dd->HashSize; 322 322 fsh.mem_for_frags = dd->HashSize; 323 for (j = 0; j < dd->HashSize; j++)323 for (j = 0; j < dd->HashSize; ++j) 324 324 fsh.mem_for_frags += dd->HashTable[j].word[0]; 325 325 … … 330 330 fwrite (&fsh, sizeof (fsh), 1, fp); 331 331 332 for (j = 0; j < dd->HashSize; j++) {332 for (j = 0; j < dd->HashSize; ++j) { 333 333 curr = dd->HashTable[j].word; 334 334 -
trunk/gsdl/src/mgpp/text/words.h
r8691 r9611 129 129 ++numeric <= MAXNUMERIC))) { \ 130 130 while (charlength-- > 0) { \ 131 *wptr++ = *(s_in)++; length++; \131 *wptr++ = *(s_in)++; ++length; \ 132 132 } \ 133 133 charlength = parse_utf8_char((s_in),(end),&c); \ … … 157 157 !is_unicode_letdig(c)) { \ 158 158 while (charlength-- > 0) { \ 159 *wptr++ = *(s_in)++; length++; \159 *wptr++ = *(s_in)++; ++length; \ 160 160 } \ 161 161 charlength = parse_utf8_char((s_in),(end),&c); \
Note:
See TracChangeset
for help on using the changeset viewer.