Changeset 2487
- Timestamp:
- 2001-06-01T14:51:29+12:00 (23 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/lib/text_t.cpp
r1860 r2487 28 28 /* 29 29 $Log$ 30 Revision 1.21 2001/06/01 02:51:28 sjboddie 31 Changes to get phind working under windows 32 30 33 Revision 1.20 2001/01/25 18:26:44 cs025 31 34 Included CORBA branch for first time … … 262 265 } 263 266 264 267 unsigned long text_t::getulong () const 268 { 269 unsigned long i = 0; 270 271 const_iterator here = text.begin(); 272 const_iterator end = text.end(); 273 274 while ((here != end) && (*here >= '0') && (*here <= '9')) 275 { 276 i = 10*i + (*here - '0'); 277 here++; 278 } 279 280 return i; 281 } 265 282 266 283 void text_t::appendcarr (char *s, size_type len) -
trunk/gsdl/lib/text_t.h
r2423 r2487 147 147 int getint () const; 148 148 149 // same as getint but returns an unsigned long 150 unsigned long getulong () const; 151 149 152 // support for arrays of chars 150 153 void appendcarr (char *s, size_type len); -
trunk/gsdl/macros/document.dm
r2021 r2487 76 76 <APPLET CODEBASE="_httpprefix_/src/phind/client" CODE="Phind.class" WIDTH=500 HEIGHT=400> 77 77 <PARAM NAME=library VALUE="_gwcgi_"> 78 <PARAM NAME=phindcgi VALUE="phindcgi"> 79 78 <PARAM NAME=phindcgi VALUE="_gwcgi_?a=phind"> 80 79 <PARAM NAME=collection VALUE="_cgiargc_"> 81 80 <PARAM NAME=classifier VALUE="_phindnumber_"> -
trunk/gsdl/packages/mg/src/text/WIN32.MAK
r2338 r2487 205 205 copy %%i "$(GSDLHOME)\bin\windows" 206 206 207 # words$o, removed to avoid conflict with mgpp libtextin.a 207 208 LIB_OBJS = \ 208 209 query_term_list$o \ … … 212 213 read_line$o mg_errors$o backend$o invf_get$o \ 213 214 term_lists$o bool_tree$o bool_parser$o bool_optimiser$o \ 214 bool_query$o words$o215 bool_query$o 215 216 216 217 libtextin.lib: $(LIB_OBJS) -
trunk/gsdl/perllib/classify/phind.pm
r2481 r2487 84 84 85 85 86 %wanted_index_files = ('td'=>1, 87 't'=>1, 88 'ti'=>1, 89 'tl'=>1, 90 'tsd'=>1, 91 'idb'=>1, 92 'ib1'=>1, 93 'ib2'=>1, 94 'ib3'=>1, 95 'i'=>1, 96 'il'=>1, 97 'w'=>1, 98 'wa'=>1); 99 100 101 86 102 # Phrase delimiter symbols - these should be abstracted out someplace 87 103 … … 110 126 print $out "Checking Phind phrase browser requirements...\n"; 111 127 112 # Make sure we're not in windows113 if ($ENV{'GSDLOS'} =~ /windows/i) {114 print STDERR "Sorry - Phind currently only works under Unix";115 exit(1);116 }117 118 128 # Ensure the Phind generate scripts are in place 119 129 my $file1 = &util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "suffix"); 130 $file1 .= ".exe" if $ENV{'GSDLOS'} =~ /^windows$/; 120 131 my $src = &util::filename_cat($ENV{'GSDLHOME'}, "src", "phind", "generate"); 121 132 … … 130 141 # Ensure the Phind CGI script is in place 131 142 $file1 = &util::filename_cat($ENV{'GSDLHOME'}, "cgi-bin", "phindcgi"); 143 $file1 .= ".exe" if $ENV{'GSDLOS'} =~ /^windows$/; 132 144 $src = &util::filename_cat($ENV{'GSDLHOME'}, "src", "phind", "host"); 133 145 … … 184 196 } 185 197 $self->{'builddir'} = $builddir; 198 199 $self->{'total'} = 0; 186 200 187 201 return bless $self, $class; … … 251 265 252 266 # record this file 253 my $total++;254 print "file $ total: $file\n" if ($self->{'$verbosity'});267 $self->{'total'} ++; 268 print "file $self->{'total'}: $file\n" if ($self->{'$verbosity'}); 255 269 256 270 … … 335 349 my $self = shift (@_); 336 350 351 close $self->{'dochandle'}; 337 352 close $self->{'txthandle'}; 338 353 my $verbosity = $self->{'verbosity'}; 339 354 my $out = $self->{'outhandle'}; 340 355 my $phinddir = $self->{'phinddir'}; 341 my $exe = &util::get_os_exe (); 356 357 my $osextra = ""; 358 if ($ENV{'GSDLOS'} !~ /^windows$/i) { 359 $osextra = " -d /"; 360 } 342 361 343 362 if ($verbosity) { … … 362 381 print $out "\nSorting and renumbering phrases for input to mgpp\n" if $verbosity; 363 382 &renumber_phrases($self); 364 365 # Create the mg phrase database366 383 367 384 print $out "\nCreating phrase databases\n"; 368 385 my $mg_input = &util::filename_cat($phinddir, "pdata.txt"); 369 my $mg_stem = "pdata";370 371 &execute("mgpp_passes $exe -d $phinddir-f $mg_stem -T1 $mg_input", $verbosity, $out);372 &execute("mgpp_compression_dict $exe -d $phinddir-f $mg_stem", $verbosity, $out);373 &execute("mgpp_passes $exe -d $phinddir-f $mg_stem -T2 $mg_input", $verbosity, $out);386 my $mg_stem = &util::filename_cat($phinddir, "pdata"); 387 388 &execute("mgpp_passes $osextra -f $mg_stem -T1 $mg_input", $verbosity, $out); 389 &execute("mgpp_compression_dict $osextra -f $mg_stem", $verbosity, $out); 390 &execute("mgpp_passes $osextra -f $mg_stem -T2 $mg_input", $verbosity, $out); 374 391 375 392 # create the mg index of words 376 393 print $out "\nCreating word-level search indexes\n"; 377 394 $mg_input = &util::filename_cat($phinddir, "pword.txt"); 378 $mg_stem = "pword";379 380 &execute("mgpp_passes $exe -d $phinddir-f $mg_stem -T1 -I1 $mg_input", $verbosity, $out);381 &execute("mgpp_compression_dict $exe -d $phinddir-f $mg_stem", $verbosity, $out);382 &execute("mgpp_perf_hash_build $exe -d $phinddir-f $mg_stem", $verbosity, $out);383 &execute("mgpp_passes $exe -d $phinddir-f $mg_stem -T2 -I2 $mg_input", $verbosity, $out);384 &execute("mgpp_weights_build $exe -d $phinddir-f $mg_stem", $verbosity, $out);385 &execute("mgpp_invf_dict $exe -d $phinddir-f $mg_stem", $verbosity, $out);386 387 &execute("mgpp_stem_idx $exe -d $phinddir-f $mg_stem -s 1", $verbosity, $out);388 &execute("mgpp_stem_idx $exe -d $phinddir-f $mg_stem -s 2", $verbosity, $out);389 &execute("mgpp_stem_idx $exe -d $phinddir-f $mg_stem -s 3", $verbosity, $out);395 $mg_stem = &util::filename_cat($phinddir, "pword"); 396 397 &execute("mgpp_passes $osextra -f $mg_stem -T1 -I1 $mg_input", $verbosity, $out); 398 &execute("mgpp_compression_dict $osextra -f $mg_stem", $verbosity, $out); 399 &execute("mgpp_perf_hash_build $osextra -f $mg_stem", $verbosity, $out); 400 &execute("mgpp_passes $osextra -f $mg_stem -T2 -I2 $mg_input", $verbosity, $out); 401 &execute("mgpp_weights_build $osextra -f $mg_stem", $verbosity, $out); 402 &execute("mgpp_invf_dict $osextra -f $mg_stem", $verbosity, $out); 403 404 &execute("mgpp_stem_idx $osextra -f $mg_stem -s 1", $verbosity, $out); 405 &execute("mgpp_stem_idx $osextra -f $mg_stem -s 2", $verbosity, $out); 406 &execute("mgpp_stem_idx $osextra -f $mg_stem -s 3", $verbosity, $out); 390 407 391 408 # create the mg document information database 392 409 print $out "\nCreating document information databases\n"; 393 410 $mg_input = &util::filename_cat($phinddir, "docs.txt"); 394 $mg_stem = "docs"; 395 396 &execute("mgpp_passes$exe -d $phinddir -f $mg_stem -T1 $mg_input", $verbosity, $out); 397 &execute("mgpp_compression_dict$exe -d $phinddir -f $mg_stem", $verbosity, $out); 398 &execute("mgpp_passes$exe -d $phinddir -f $mg_stem -T2 $mg_input", $verbosity, $out); 399 411 $mg_stem = &util::filename_cat($phinddir, "docs"); 412 413 &execute("mgpp_passes $osextra -f $mg_stem -T1 $mg_input", $verbosity, $out); 414 &execute("mgpp_compression_dict $osextra -f $mg_stem", $verbosity, $out); 415 &execute("mgpp_passes $osextra -f $mg_stem -T2 $mg_input", $verbosity, $out); 400 416 401 417 # Tidy up stray files 402 418 if (!$self->{'untidy'}) { 403 419 print $out "\nCleaning up\n" if ($verbosity > 2); 404 &util::rm("$phinddir/clauses", "$phinddir/clauses.numbers", 405 "$phinddir/clauses.vocab", "$phinddir/clauses.stats", 406 "$phinddir/phrases", "$phinddir/phrases.3", "$phinddir/docs.txt", 407 "$phinddir/pdata.txt", "$phinddir/pword.txt"); 408 my $outfile = 1; 409 while (-e "$phinddir/outPhrase.$outfile") { 410 &util::rm("$phinddir/outPhrase.$outfile"); 411 $outfile++; 412 } 413 } 414 420 opendir (DIR, $phinddir) || die; 421 my @files = readdir DIR; 422 closedir DIR; 423 424 foreach $file (@files) { 425 next if $file =~ /^\.\.?$/; 426 my ($suffix) = $file =~ /\.([^\.]+)$/; 427 if (!defined $suffix || !defined $wanted_index_files{$suffix}) { 428 # delete it! 429 print $out "deleting $file\n"; # if $verbosity > 2; 430 &util::rm (&util::filename_cat ($phinddir, $file)); 431 } 432 } 433 } 415 434 416 435 # Return the information about the classifier that we'll later want to … … 591 610 my ($command, $verbosity, $outhandle) = @_; 592 611 print $outhandle "Executing: $command\n" if ($verbosity > 2); 612 $! = 0; 593 613 my $status = system($command); 594 614 if ($status != 0) { 595 print STDERR "phind - Error executing $command: $!\n";615 print STDERR "phind - Error executing '$command': $!\n"; 596 616 exit($status); 597 617 } … … 1264 1284 $thesaurusdata{$phindid} = "$symbols:$linkcounter:$relations"; 1265 1285 } 1286 close TH; 1266 1287 1267 1288 # 6. … … 1346 1367 $symbol[$i++] = $_; 1347 1368 } 1348 1369 close V; 1349 1370 1350 1371 # 2. -
trunk/gsdl/src/phind/client/Phind.java
r2054 r2487 403 403 404 404 // Build the query 405 String query = phindcgi_address + " x=1&c=" + collection + "&d=" + classifier;405 String query = phindcgi_address + "pxml=1&c=" + collection + "&pc=" + classifier; 406 406 407 407 if (keyKnown) { 408 query = query + "& n=" + word;408 query = query + "&ppnum=" + word; 409 409 } else { 410 query = query + "&p =" + word;410 query = query + "&pptext=" + word; 411 411 } 412 412 … … 448 448 } 449 449 450 query = query + "& e=" + first_e + "&f=" + last_e451 + "& h=" + first_d + "&i=" + last_d452 + "& k=" + first_l + "&l=" + last_l;450 query = query + "&pfe=" + first_e + "&ple=" + last_e 451 + "&pfd=" + first_d + "&pld=" + last_d 452 + "&pfl=" + first_l + "&pll=" + last_l; 453 453 454 454 // Send the query to the phindcgi program … … 497 497 // there is not protocol and host 498 498 URL document = getDocumentBase(); 499 address = "http://" + document.getHost() + address;499 address = "http://" + document.getHost() + ":" + document.getPort() + address; 500 500 } else { 501 // this URL is relative to the dir wectory the document is in501 // this URL is relative to the directory the document is in 502 502 URL document = getDocumentBase(); 503 503 String directory = document.getFile(); 504 504 int end = directory.lastIndexOf('/'); 505 505 directory = directory.substring(0,end + 1); 506 address = "http://" + document.getHost() + directory + address;506 address = "http://" + document.getHost() + ":" + document.getPort() + directory + address; 507 507 508 508 } -
trunk/gsdl/src/phind/generate/phrase.cpp
r1873 r2487 26 26 *********************************************************************/ 27 27 28 #include <iostream.h>29 28 #include <assert.h> 30 #include <vector.h>31 29 #include <stdio.h> 30 31 #if defined(GSDL_USE_STL_H) 32 # include <vector.h> 33 #else 34 # include <vector> 35 #endif 36 37 #if defined(GSDL_USE_IOS_H) 38 # include <iostream.h> 39 #else 40 # include <iostream> 41 #endif 32 42 33 43 #include "suffix.h" -
trunk/gsdl/src/phind/generate/phrase.h
r1873 r2487 25 25 * 26 26 *********************************************************************/ 27 28 #ifndef PHRASE_H 29 #define PHRASE_H 30 31 #if defined(GSDL_USE_STL_H) 32 # include <vector.h> 33 #else 34 # include <vector> 35 #endif 36 37 #include "suffix.h" 27 38 28 39 class Phrase { … … 61 72 Phrase(symbol *words, cellcount size, int direction); 62 73 74 // An empty phrase can be created without arguments, but is 75 // good for nothing and may not be used with any public fuctions. 76 // We therefore only use it internally. 77 Phrase(); 78 63 79 // Represent the phrase as a string 64 80 char *toString(); … … 87 103 88 104 private: 89 90 // An empty phrase can be created without arguments, but is91 // good for nothing and may not be used with any public fuctions.92 // We therefore only use it internally.93 Phrase();94 105 95 106 // Does the phrase have a unique suffix/prefix extension? … … 120 131 int expandWhileUniqueSuffixExtension(); 121 132 int expandWhileUniquePrefixExtension(); 122 123 124 133 }; 125 134 … … 128 137 bool isLonger(Phrase p1, Phrase p2); 129 138 130 131 132 139 #endif -
trunk/gsdl/src/phind/generate/suffix.cpp
r1882 r2487 28 28 29 29 #include <assert.h> 30 #include <fstream.h>31 #include <iostream.h>32 30 #include <math.h> 33 31 #include <stdio.h> … … 35 33 #include <string.h> 36 34 37 #include <algo.h> 38 #include <heap.h> 39 #include <vector.h> 35 #if defined(GSDL_USE_IOS_H) 36 # include <fstream.h> 37 # include <iostream.h> 38 #else 39 # include <fstream> 40 # include <iostream> 41 #endif 42 43 #if defined(GSDL_USE_STL_H) 44 # if defined(GSDL_USE_ALGO_H) 45 # include <algo.h> 46 # else 47 # include <algorithm.h> 48 # endif 49 # include <vector.h> 50 #else 51 # include <algorithm> 52 # include <vector> 53 #endif 54 #include <stl_heap.h> 55 40 56 41 57 #include "suffix.h" 42 58 #include "phrase.h" 43 44 45 59 46 60 // Global variables declared in suffix.h … … 138 152 139 153 // Create the suffix & prefix arrays 140 suffixArray = new (symbol *)[inputLength];141 prefixArray = new (symbol *)[inputLength];142 suffixCheck = new (check)[inputLength];143 prefixCheck = new (check)[inputLength];154 suffixArray = new symbol *[inputLength]; 155 prefixArray = new symbol *[inputLength]; 156 suffixCheck = new check[inputLength]; 157 prefixCheck = new check[inputLength]; 144 158 if (prefixCheck == NULL) { 145 159 cerr << "Suffix error: not enough memory to hold " << inputLength … … 169 183 // each phrase occurs in each document. The number of documents in 170 184 // which a phrase occurs is stored in df. 171 frequency documentFrequency[numberOfDocuments];185 frequency *documentFrequency = new frequency[numberOfDocuments]; 172 186 frequency df; 173 187 174 188 // documentArray will be searched in order to discover which document 175 189 // each phrase occurs in. 176 documentArray = new (symbol *)[numberOfDocuments];190 documentArray = new symbol *[numberOfDocuments]; 177 191 178 192 // Discover all the DOCUMENTSTART symbols and store as a phrase … … 250 264 // Iterate over the different symbols by working through the suffix array 251 265 vector<Phrase> result; 252 cellindex i = 0;266 cellindex ij = 0; 253 267 char *tmpString; 254 268 255 while (i < inputLength) {269 while (ij < inputLength) { 256 270 257 271 // make a new phrase of length 1 258 p = Phrase(suffixArray[i ], 1, SUFFIX);259 p.findFirstAndLastSuffix(i , inputLength-1);260 261 // cout << "cell " << i << " - " << p.toString() << endl;272 p = Phrase(suffixArray[ij], 1, SUFFIX); 273 p.findFirstAndLastSuffix(ij, inputLength-1); 274 275 // cout << "cell " << ij << " - " << p.toString() << endl; 262 276 263 277 // We ignore this symbol if it occurs only once, if it is a delimiter, … … 271 285 // it explodes the size of the indexes. So: would it be useful? 272 286 if (!((p.suffixFrequency <= 1) || 273 // (*suffixArray[i ] != 23054) ||274 (*suffixArray[i ] <= LASTDELIMITER) ||275 ((phraseMode == STOPWORDS) && (*suffixArray[i ] <= lastStopSymbol)))) {287 // (*suffixArray[ij] != 23054) || 288 (*suffixArray[ij] <= LASTDELIMITER) || 289 ((phraseMode == STOPWORDS) && (*suffixArray[ij] <= lastStopSymbol)))) { 276 290 277 291 // Get minimal expansions of the phrase … … 281 295 282 296 // Remember that we have expanded this phrase 283 rememberThisPhrase(i , 1);297 rememberThisPhrase(ij, 1); 284 298 285 299 // write the phrase text 286 300 tmpString = p.toString(); 287 phraseData << i << "-1:" << tmpString << ":" << p.suffixFrequency << ":"301 phraseData << ij << "-1:" << tmpString << ":" << p.suffixFrequency << ":" 288 302 << result.size() << ":"; 289 303 delete [] tmpString; 290 304 291 305 // write the results 292 for (cellcount i = 0; i < result.size(); i++) {293 if ( i) {306 for (cellcount k = 0; k < result.size(); k++) { 307 if (k) { 294 308 phraseData << ","; 295 309 } 296 phraseData << result[ i].firstSuffixIndex << "-" << result[i].length;297 outPhrase << result[ i].firstSuffixIndex << " " << result[i].length << endl;310 phraseData << result[k].firstSuffixIndex << "-" << result[k].length; 311 outPhrase << result[k].firstSuffixIndex << " " << result[k].length << endl; 298 312 outPhraseCounter++; 299 313 } … … 305 319 306 320 // write the documents 307 for (cellcount i = 0, first = 1; i < numberOfDocuments; i++) {308 if (documentFrequency[ i]) {321 for (cellcount m = 0, first = 1; m < numberOfDocuments; m++) { 322 if (documentFrequency[m]) { 309 323 if (first) { 310 324 first = 0; … … 315 329 // N documents from 0 to N-1, but later they'll be 1-N. Thus we 316 330 // add 1 to the document id when we output it. 317 phraseData << "d" << ( i+1);331 phraseData << "d" << (m+1); 318 332 // Next, output the frequency with which the document occurs, but 319 333 // only if it is > 1. 320 if (documentFrequency[ i] > 1) {321 phraseData << "," << documentFrequency[ i];334 if (documentFrequency[m] > 1) { 335 phraseData << "," << documentFrequency[m]; 322 336 } 323 337 } … … 338 352 } 339 353 } 340 i = p.lastSuffixIndex + 1;354 ij = p.lastSuffixIndex + 1; 341 355 } 342 356 outPhrase.close(); … … 472 486 deletePhraseMemory(); 473 487 488 delete [] documentFrequency; 474 489 delete [] symbols; 475 490 delete [] suffixArray; … … 548 563 suffixCheck[i] = c.length; 549 564 } 550 for (cellcount i = c.firstPrefixIndex; i <= c.lastPrefixIndex; i++) {551 prefixCheck[i ] = c.length;565 for (cellcount ik = c.firstPrefixIndex; ik <= c.lastPrefixIndex; ik++) { 566 prefixCheck[ik] = c.length; 552 567 } 553 568 } … … 578 593 suffixCheck[i] = c.length; 579 594 } 580 for (cellcount i = c.firstPrefixIndex; i <= c.lastPrefixIndex; i++) {581 prefixCheck[i ] = c.length;595 for (cellcount ijk = c.firstPrefixIndex; ijk <= c.lastPrefixIndex; ijk++) { 596 prefixCheck[ijk] = c.length; 582 597 } 583 598 … … 701 716 cout << "Allocating symbol arrays for " << inputLength << " symbols" << endl; 702 717 } 703 symbols = new (symbol)[inputLength];718 symbols = new symbol[inputLength]; 704 719 if (symbols == NULL) { 705 720 cerr << "Suffix error: not enough memory to hold " << inputLength … … 757 772 758 773 // search for the document in which each occurence of the phrase is found 759 for (cellcount i = p.firstSuffixIndex; i <= p.lastSuffixIndex; i++) {774 for (cellcount j = p.firstSuffixIndex; j <= p.lastSuffixIndex; j++) { 760 775 761 // cout << "looking for phrase at suffixArray[" << i<< "]\n";776 // cout << "looking for phrase at suffixArray[" << j << "]\n"; 762 777 763 target = suffixArray[ i];778 target = suffixArray[j]; 764 779 begin = 0; 765 780 end = numberOfDocuments - 1; … … 864 879 void initialisePhraseMemory() { 865 880 866 phraseMemory = new (unsigned char)[inputLength];881 phraseMemory = new unsigned char[inputLength]; 867 882 868 883 // to begin with, everything is empty -
trunk/gsdl/src/phind/generate/suffix.h
r1631 r2487 26 26 *********************************************************************/ 27 27 28 #ifndef SUFFIX_H 29 #define SUFFIX_H 28 30 29 31 // Types … … 91 93 #define LASTDELIMITER 4 92 94 93 94 95 #endif -
trunk/gsdl/src/phind/host/phindcgi.cpp
r2062 r2487 37 37 */ 38 38 39 40 #include <iostream.h> 41 #include <fstream.h> 39 #if defined(GSDL_USE_IOS_H) 40 # include <fstream.h> 41 # include <iostream.h> 42 #else 43 # include <fstream> 44 # include <iostream> 45 #endif 46 42 47 #include <stdlib.h> 43 48 #include <stdio.h> 44 49 #include <assert.h> 45 50 46 #include <vector.h> 47 #include <algo.h> 51 #if defined(GSDL_USE_STL_H) 52 # if defined(GSDL_USE_ALGO_H) 53 # include <algo.h> 54 # else 55 # include <algorithm.h> 56 # endif 57 # include <vector.h> 58 #else 59 # include <algorithm> 60 # include <vector> 61 #endif 48 62 49 63 // Include MGPP functionality. … … 55 69 56 70 // Include GSDL's text_t object, which makes parsing cgi arguments easier. 57 #include <text_t.h> 71 #include "text_t.h" 72 #include "fileutil.h" 58 73 // Note that GSDL stores strings as text_t objects (vectors of 16-bit short int), 59 74 // while MGPP stores strings as UCArray objects (vectors of 8-bit unsigned char). … … 156 171 } 157 172 158 char basepath[FILENAME_MAX] = ""; 159 strcat(basepath, gsdlhome); 160 strcat(basepath, "/collect/"); 161 strcat(basepath, collection); 162 strcat(basepath, "/index/phind"); 163 strcat(basepath, classifier); 173 text_t basepathstr = filename_cat(gsdlhome, "collect", collection, 174 "index", text_t("phind") + classifier); 175 176 char *basepath = basepathstr.getcstr(); 164 177 165 178 // If we don't know the phrase number, look itup … … 183 196 // Create a TextData object to read the phrase data (pdata) 184 197 TextData textdata; 185 char filename[FILENAME_MAX] = "pdata"; 186 if (!textdata.LoadData (basepath, filename)) { 187 FatalError (1, "Couldn't load text information for \"%s\"", filename); 188 } 198 199 text_t fullpath = filename_cat(basepath, "pdata"); 200 char *fullpathc = fullpath.getcstr(); 201 #if defined __WIN32__ 202 char *base = ""; 203 #else 204 char *base = "/"; 205 #endif 206 207 if (!textdata.LoadData (base, fullpathc)) { 208 FatalError (1, "Couldn't load text information for \"%s\"", fullpathc); 209 } 210 211 delete fullpathc; 212 189 213 get_phrase_all_data(textdata, phrase, word, tf, ef, lf, df, el, 190 214 linkdest, linktype, docNums, docfreq); … … 404 428 405 429 textdata.UnloadData (); 430 431 delete basepath; 432 406 433 return 0; 407 434 } … … 494 521 unsigned long first, unsigned long last) { 495 522 523 // _chdir(basepath); 524 496 525 // Create a TextData object to read the document data 497 526 TextData docdata; 498 char filename[FILENAME_MAX] = "docs"; 499 if (!docdata.LoadData (basepath, filename)) { 500 FatalError (1, "Couldn't load text information for \"%s\"", filename); 501 } 527 528 text_t fullpath = filename_cat(basepath, "docs"); 529 char *fullpathc = fullpath.getcstr(); 530 #if defined __WIN32__ 531 char *base = ""; 532 #else 533 char *base = "/"; 534 #endif 535 536 if (!docdata.LoadData (base, fullpathc)) { 537 FatalError (1, "Couldn't load text information for \"%s\"", fullpathc); 538 } 539 540 delete fullpathc; 502 541 503 542 UCArray title, hash; … … 795 834 } 796 835 // store the gsdlhome string 797 gsdlhome = new (char)[len-i];836 gsdlhome = new char[len-i]; 798 837 strncpy(gsdlhome, &(buffer[i]), len-i); 799 838 } … … 916 955 // if no classifier number is supplied, default to 1. 917 956 if (classifier == NULL) { 918 classifier = new (char)[2];957 classifier = new char[2]; 919 958 strcpy(classifier, "1"); 920 959 } … … 971 1010 // Open the index file for searching 972 1011 IndexData indexData; 973 char indexfilename[FILENAME_MAX] = "pword"; 974 if (!indexData.LoadData (basepath, indexfilename)) { 975 FatalError (1, "Couldn't load index information for \"%s\"", indexfilename); 976 } 1012 1013 text_t fullpath = filename_cat(basepath, "pword"); 1014 char *fullpathc = fullpath.getcstr(); 1015 #if defined __WIN32__ 1016 char *base = ""; 1017 #else 1018 char *base = "/"; 1019 #endif 1020 1021 if (!indexData.LoadData (base, fullpathc)) { 1022 FatalError (1, "Couldn't load index information for \"%s\"", fullpathc); 1023 } 1024 1025 delete fullpathc; 977 1026 978 1027 // set up the query object -
trunk/gsdl/src/recpt/librarymain.cpp
r2389 r2487 56 56 #include "collectoraction.h" 57 57 #include "browseaction.h" 58 #include "phindaction.h" 58 59 59 60 #include "browserclass.h" … … 150 151 recpt.add_action(&abrowseaction); 151 152 153 phindaction aphindaction; 154 recpt.add_action(&aphindaction); 155 152 156 // list of browsers 153 157 vlistbrowserclass avlistbrowserclass; -
trunk/gsdl/src/w32server/cgiwrapper.cpp
r2343 r2487 66 66 #include "extlinkaction.h" 67 67 #include "collectoraction.h" 68 #include "phindaction.h" 68 69 69 70 // browsers … … 74 75 #include "pagedbrowserclass.h" 75 76 #include "htmlbrowserclass.h" 77 #include "phindbrowserclass.h" 76 78 77 79 // the number of times the library has been accessed … … 495 497 recpt.add_action (aauthenaction); 496 498 499 phindaction *aphindaction = new phindaction(); 500 recpt.add_action (aphindaction); 501 497 502 498 503 // list of browsers … … 515 520 htmlbrowserclass *ahtmlbrowserclass = new htmlbrowserclass(); 516 521 recpt.add_browser (ahtmlbrowserclass); 522 523 phindbrowserclass *aphindbrowserclass = new phindbrowserclass();; 524 recpt.add_browser (aphindbrowserclass); 517 525 518 526 // set defaults
Note:
See TracChangeset
for help on using the changeset viewer.