- Timestamp:
- 2001-06-06T16:43:14+12:00 (23 years ago)
- Location:
- trunk/gsdl/src/phind/generate
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/phind/generate/phrase.h
r2487 r2498 28 28 #ifndef PHRASE_H 29 29 #define PHRASE_H 30 31 // use the standard namespace 32 #if !defined (GSDL_NAMESPACE_BROKEN) 33 #if defined(GSDL_USE_OBJECTSPACE) 34 using namespace ospace::std; 35 #else 36 using namespace std; 37 #endif 38 #endif 30 39 31 40 #if defined(GSDL_USE_STL_H) -
trunk/gsdl/src/phind/generate/suffix.cpp
r2487 r2498 52 52 # include <vector> 53 53 #endif 54 #include <stl_heap.h>55 56 54 57 55 #include "suffix.h" … … 246 244 } 247 245 248 // We need an input file, for phrases we are about to examine, and an249 // output file, for phrases still to come.250 ifstream inPhrase;251 char inPhraseName[FILENAME_MAX];252 246 ofstream outPhrase; 253 247 char outPhraseName[FILENAME_MAX]; … … 368 362 369 363 // Open the input file 364 char inPhraseName[FILENAME_MAX]; 370 365 sprintf(inPhraseName, "%s/outPhrase.%d", collection, phrasePass - 1); 371 i nPhrase.open(inPhraseName, ios::in);366 ifstream inPhrase (inPhraseName, ios::in); 372 367 if (!inPhrase) { 373 368 cerr << "File " << inPhraseName << " could not be opened\n"; … … 698 693 699 694 // Open the numbers file 700 ifstream inFile (filename, ios::in);701 if (!inFile ) {695 ifstream inFile1(filename, ios::in); 696 if (!inFile1) { 702 697 cerr << "File " << filename << " could not be opened\n"; 703 698 exit(1); … … 707 702 inputLength = 0; 708 703 symbol word; 709 while (inFile >> word) {704 while (inFile1 >> word) { 710 705 inputLength++; 711 706 } 712 inFile .close();707 inFile1.close(); 713 708 714 709 // Allocate the symbbols array … … 727 722 cout << "Reading the numbers" << endl; 728 723 } 729 inFile.open(filename, ios::in); 724 725 ifstream inFile2(filename, ios::in); 726 if (!inFile2) { 727 cerr << "File " << filename << " could not be opened\n"; 728 exit(1); 729 } 730 730 cellcount next = 0; 731 731 numberOfDocuments = 0; 732 while (inFile >> word) {732 while (inFile2 >> word) { 733 733 symbols[next++] = word; 734 734 if (word == DOCUMENTSTART) { … … 736 736 } 737 737 } 738 inFile .close();738 inFile2.close(); 739 739 740 740 // Make sure the numbers file is intact
Note:
See TracChangeset
for help on using the changeset viewer.