Changeset 860
- Timestamp:
- 2000-01-18T16:53:24+13:00 (24 years ago)
- Location:
- trunk/gsdl/src/mgpp
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/mgpp/config.h
r857 r860 104 104 105 105 /* The number of bytes in a unsigned char *. */ 106 /* #undef SIZEOF_UNSIGNED_CHAR_P */ 106 #define SIZEOF_UNSIGNED_CHAR_P 4 107 107 108 108 /* Define if you have the ftime function. */ -
trunk/gsdl/src/mgpp/lib/Makefile.in
r855 r860 37 37 CFLAGS = @CFLAGS@ -ansi 38 38 else 39 CFLAGS = @CFLAGS@ -ansi -D QUIET39 CFLAGS = @CFLAGS@ -ansi -DSILENT 40 40 endif 41 41 CPPFLAGS = @CPPFLAGS@ -
trunk/gsdl/src/mgpp/lib/messages.cpp
r855 r860 24 24 /* 25 25 $Log$ 26 Revision 1.2 2000/01/18 03:53:19 rjmcnab 27 Fixed a couple of bugs and made building silent if needed. 28 26 29 Revision 1.1 2000/01/14 02:17:10 sjboddie 27 30 Rodgers new C++ mg … … 86 89 va_list args; 87 90 88 #ifdef QUIET91 #ifdef SILENT 89 92 return; /* stop those messages!!!! */ 90 93 #endif -
trunk/gsdl/src/mgpp/text/FText.cpp
r855 r860 144 144 bool TextIdx::Read (FILE *f, const TextLevelInfo &levelInfo, 145 145 unsigned long docNum) { 146 SeekTextIdx (f, levelInfo, docNum);146 if (!SeekTextIdx (f, levelInfo, docNum)) return false; 147 147 return Read (f); 148 148 } -
trunk/gsdl/src/mgpp/text/MGQuery.h
r855 r860 111 111 112 112 113 #define NO_TERM_RANGE_START LONG_MIN114 #define NO_TERM_RANGE_END LONG_MAX113 #define NO_TERM_RANGE_START (LONG_MIN/2) 114 #define NO_TERM_RANGE_END (LONG_MAX/2) 115 115 116 116 class TermNode { -
trunk/gsdl/src/mgpp/text/Makefile.in
r856 r860 41 41 CPPFLAGS = @CPPFLAGS@ -ansi -g -Wall -Wunused -pedantic -W -Woverloaded-virtual 42 42 else 43 CFLAGS = @CFLAGS@ -ansi -Wall -Wunused -pedantic -W -Woverloaded-virtual -g -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM44 CPPFLAGS = @CPPFLAGS@ -ansi -Wall -Wunused -pedantic -W -Woverloaded-virtual -g -D NZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM43 CFLAGS = @CFLAGS@ -ansi -Wall -Wunused -pedantic -W -Woverloaded-virtual -g -DSILENT -DSHORT_SUFFIX 44 CPPFLAGS = @CPPFLAGS@ -ansi -Wall -Wunused -pedantic -W -Woverloaded-virtual -g -DSILENT -DSHORT_SUFFIX 45 45 endif 46 46 DEFS = @DEFS@ … … 57 57 # George Buchanan - August 1999 58 58 # 59 # The below section is now irrelevant - 60 # see the ifndef on CFLAGS above; simply 61 # compiling with make NZDL=1 will auto- 62 # matically ensure that the NZDL compile 63 # mode is used 64 # 65 ########################################## 66 # 67 # Uncomment for compiling for the nzdl project 68 # 69 #CFLAGS = @CFLAGS@ -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM 59 # compiling with make NZDL=1 to ensure that 60 # the NZDL compile mode is used 61 # 70 62 ########################################## 71 63 -
trunk/gsdl/src/mgpp/text/Queryer.cpp
r855 r860 75 75 QueryInfo queryInfo; 76 76 SetCStr (queryInfo.docLevel, "Document"); 77 queryInfo.maxDocs = 10 ;77 queryInfo.maxDocs = 100000; 78 78 queryInfo.sortByRank = true; 79 79 queryInfo.exactWeights = false; … … 95 95 if (queryArray.size() >= 2 && queryArray[0] == '.') { 96 96 if (queryArray[1] == 'q') break; // quit 97 98 if (queryArray[1] == 'p') { 99 // print 100 UCArray docText; 101 unsigned long docNum = 0; 102 cin >> docNum; 103 cin.getline(query, 2048, '\n'); // eat up return 104 105 if (!GetDocText (textData, queryInfo.docLevel, docNum, docText)) { 106 FatalError (1, "Error while trying to get document %u", docNum); 107 } 108 109 cout << docText << "\n"; 110 } 97 111 98 112 } else { … … 118 132 indexData.UnloadData (); 119 133 } 134 -
trunk/gsdl/src/mgpp/text/Terms.cpp
r855 r860 318 318 unsigned long outI = 0; 319 319 320 // increase comFragDataI until resulting range is positive321 if (startRange < 0) {322 while (comFragDataI < comFragDataSize &&323 ((signed long)comFragData.fragNums[comFragDataI]+startRange < 0)) {324 comFragDataI++;325 }326 }327 328 320 while (fragDataI < fragDataSize && 329 321 comFragDataI < comFragDataSize) { 330 unsigned long fragNum =fragData.fragNums[fragDataI];331 unsigned long comFragNum =comFragData.fragNums[comFragDataI];322 signed long fragNum = (signed long)fragData.fragNums[fragDataI]; 323 signed long comFragNum = (signed long)comFragData.fragNums[comFragDataI]; 332 324 333 325 // go to the right fragment limit (for the com frag) 334 326 if (fragLimits != NULL) { 335 327 while (fragLimitI+1 < fragLimitSize && 336 comFragNum > ( *fragLimits)[fragLimitI+1].rangeStart) {328 comFragNum > (signed long)(*fragLimits)[fragLimitI+1].rangeStart) { 337 329 fragLimitI++; 338 330 } … … 340 332 341 333 if (fragNum <= comFragNum+startRange || 342 (fragLimits!=NULL && fragNum<=(*fragLimits)[fragLimitI].rangeStart)) { 334 (fragLimits!=NULL && 335 fragNum<=(signed long)(*fragLimits)[fragLimitI].rangeStart)) { 343 336 fragDataI++; 344 337 345 338 } else if (fragNum > comFragNum+endRange || 346 (fragLimits!=NULL && fragNum>(*fragLimits)[fragLimitI].rangeEnd)) { 339 (fragLimits!=NULL && 340 fragNum>(signed long)(*fragLimits)[fragLimitI].rangeEnd)) { 347 341 comFragDataI++; 348 342 … … 357 351 fragDataI++; 358 352 comFragDataI++; 359 comFragDataI++;353 outI++; 360 354 } 361 355 } -
trunk/gsdl/src/mgpp/text/mg_compression_dict.cpp
r856 r860 44 44 /* 45 45 $Log$ 46 Revision 1.2 2000/01/18 03:53:22 rjmcnab 47 Fixed a couple of bugs and made building silent if needed. 48 46 49 Revision 1.1 2000/01/14 02:26:11 sjboddie 47 50 Rodgers new C++ mg … … 216 219 break; 217 220 case '1': 221 #ifndef SILENT 218 222 Message ("Dictionary limit of %.2f Kb", k / 1024); 223 #endif 219 224 Select_on ((int) k, OccuranceOrder); 220 225 break; 221 226 case '2': 227 #ifndef SILENT 222 228 Message ("Dictionary limit of %.2f Kb", k / 1024); 229 #endif 223 230 Select_on ((int) k, DecFreqIncWL); 224 231 break; 225 232 case '3': 233 #ifndef SILENT 226 234 Message ("Dictionary limit of %.2f Kb", k / 1024); 235 #endif 227 236 Method3 ((int) k); 228 237 break; … … 238 247 } 239 248 249 #ifndef SILENT 240 250 Message ("Num words : %8u -> %8u\n", Num[1], keep[1].num_wds); 241 251 Message ("Num non-words : %8u -> %8u\n", Num[0], keep[0].num_wds); … … 247 257 keep[0].chars + keep[1].chars); 248 258 Message ("Actual mem required : %8u\n", mem_reqd); 249 259 #endif 250 260 exit (0); 251 261 } … … 725 735 assert (keep[0].num_wds + discard[0].num_wds == Num[0]); 726 736 assert (keep[1].num_wds + discard[1].num_wds == Num[1]); 737 #ifndef SILENT 727 738 Message ("Keep -> Discard : %8d", keep_to_discard); 728 739 Message ("Discard -> Keep : %8d", discard_to_keep); … … 730 741 if (recalcs == MAX_RECALCULATIONS) 731 742 Message ("WARNING: The number of recalculations == %d", MAX_RECALCULATIONS); 743 #endif 732 744 } 733 745 -
trunk/gsdl/src/mgpp/text/mg_fast_comp_dict.cpp
r856 r860 25 25 /* 26 26 $Log$ 27 Revision 1.2 2000/01/18 03:53:23 rjmcnab 28 Fixed a couple of bugs and made building silent if needed. 29 27 30 Revision 1.1 2000/01/14 02:26:13 sjboddie 28 31 Rodgers new C++ mg … … 133 136 bzero (fixup, fixup_mem); 134 137 138 #ifndef SILENT 135 139 Message ("Estimated memory for fast_dict %u", mem); 136 140 Message ("Estimated memory for fixups %u", fixup_mem); 141 #endif 137 142 138 143 load_comp_dict (filename); 139 144 145 #ifndef SILENT 140 146 Message ("Actual memory for fast_dict %u", (char *) cur - (char *) buffer); 147 #endif 141 148 142 149 if ((u_long) cur > (u_long) buffer + mem) -
trunk/gsdl/src/mgpp/text/mg_invf_dict.cpp
r856 r860 30 30 /* 31 31 $Log$ 32 Revision 1.2 2000/01/18 03:53:24 rjmcnab 33 Fixed a couple of bugs and made building silent if needed. 34 32 35 Revision 1.1 2000/01/14 02:26:16 sjboddie 33 36 Rodgers new C++ mg … … 193 196 194 197 // print out information 198 #ifndef SILENT 195 199 Message ("Max word block size = %d\n", bdh.max_wblk_size); 196 200 Message ("Max tag block size = %d\n", bdh.max_tblk_size); 197 201 Message ("Number of word blocks written = %d\n", bdh.num_wblks); 198 202 Message ("Number of tag blocks written = %d\n", bdh.num_tblks); 203 #endif 199 204 } 200 205 -
trunk/gsdl/src/mgpp/text/mg_stem_idx.cpp
r858 r860 46 46 /* 47 47 $Log$ 48 Revision 1.3 2000/01/18 03:53:24 rjmcnab 49 Fixed a couple of bugs and made building silent if needed. 50 48 51 Revision 1.2 2000/01/14 02:45:51 sjboddie 49 52 fixed compiler warning … … 188 191 189 192 // print out information 193 #ifndef SILENT 190 194 Message ("Num word stems = %d\n", sih.dict_size); 191 195 Message ("Max stem block size = %d\n", sih.max_block_size); 192 196 Message ("Number of stem blocks written = %d\n", sih.num_blocks); 197 #endif 193 198 } 194 199 -
trunk/gsdl/src/mgpp/text/mg_weights_build.cpp
r856 r860 48 48 /* 49 49 $Log$ 50 Revision 1.2 2000/01/18 03:53:24 rjmcnab 51 Fixed a couple of bugs and made building silent if needed. 52 50 53 Revision 1.1 2000/01/14 02:26:21 sjboddie 51 54 Rodgers new C++ mg … … 158 161 wordEl.SetNumLevels (idh.num_levels); 159 162 for (wordNum=0; wordNum<idh.word_dict_size; wordNum++) { 163 #ifndef SILENT 160 164 // give a little feedback every 4096 words 161 165 if ((wordNum & 0xfff) == 0) fprintf (stderr, "."); 166 #endif 162 167 163 168 wordEl.Read (dictFile, idh.num_levels); … … 263 268 double B = pow (U / L, pow (2.0, -(double) bits)); 264 269 270 #ifndef SILENT 265 271 fprintf (stderr, "L = %f\n", L); 266 272 fprintf (stderr, "U = %f\n", U); 267 273 fprintf (stderr, "B = %f\n", B); 268 274 #endif 275 269 276 WriteUC (approxWeightsFile, bits); 270 277 WriteD (approxWeightsFile, L); … … 281 288 if (wgt == 0) { 282 289 wgt = L; 283 #ifndef QUIET290 #ifndef SILENT 284 291 Message ("Warning: Document %d had a weight of 0.", i); 285 292 #endif
Note:
See TracChangeset
for help on using the changeset viewer.