Changeset 2498 for trunk


Ignore:
Timestamp:
2001-06-06T16:43:14+12:00 (23 years ago)
Author:
sjboddie
Message:

A couple of small changes to phind's generate code to get it working
under windows 95

Location:
trunk/gsdl/src/phind/generate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/phind/generate/phrase.h

    r2487 r2498  
    2828#ifndef PHRASE_H
    2929#define PHRASE_H
     30
     31// use the standard namespace
     32#if !defined (GSDL_NAMESPACE_BROKEN)
     33#if defined(GSDL_USE_OBJECTSPACE)
     34using namespace ospace::std;
     35#else
     36using namespace std;
     37#endif
     38#endif
    3039
    3140#if defined(GSDL_USE_STL_H)
  • trunk/gsdl/src/phind/generate/suffix.cpp

    r2487 r2498  
    5252#  include <vector>
    5353#endif
    54 #include <stl_heap.h>
    55 
    5654
    5755#include "suffix.h"
     
    246244  }
    247245
    248   // We need an input file, for phrases we are about to examine, and an
    249   // output file, for phrases still to come.
    250   ifstream inPhrase;
    251   char     inPhraseName[FILENAME_MAX];
    252246  ofstream outPhrase;
    253247  char     outPhraseName[FILENAME_MAX];
     
    368362
    369363    // Open the input file
     364    char inPhraseName[FILENAME_MAX];
    370365    sprintf(inPhraseName, "%s/outPhrase.%d", collection, phrasePass - 1);
    371     inPhrase.open(inPhraseName, ios::in);
     366    ifstream inPhrase (inPhraseName, ios::in);
    372367    if (!inPhrase) {
    373368      cerr << "File " << inPhraseName << " could not be opened\n";
     
    698693
    699694  // Open the numbers file
    700   ifstream inFile(filename, ios::in);
    701   if (!inFile) {
     695  ifstream inFile1(filename, ios::in);
     696  if (!inFile1) {
    702697    cerr << "File " << filename << " could not be opened\n";
    703698    exit(1);
     
    707702  inputLength = 0;
    708703  symbol word;
    709   while (inFile >> word) {
     704  while (inFile1 >> word) {
    710705    inputLength++;
    711706  }
    712   inFile.close();
     707  inFile1.close();
    713708
    714709  // Allocate the symbbols array
     
    727722    cout << "Reading the numbers" << endl;
    728723  }
    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  }
    730730  cellcount next = 0;
    731731  numberOfDocuments = 0;
    732   while (inFile >> word) {
     732  while (inFile2 >> word) {
    733733    symbols[next++] = word;
    734734    if (word == DOCUMENTSTART) {
     
    736736    }
    737737  }
    738   inFile.close();
     738  inFile2.close();
    739739 
    740740  // Make sure the numbers file is intact
Note: See TracChangeset for help on using the changeset viewer.