Newer
Older
//
// Created by Jake Close on 3/13/18.
//
jsclose
committed
#include "ISROr.h"
ISROr::ISROr ( vector<ISR * > InputTerms ) : Terms( InputTerms )
{
for (auto currentTerm : InputTerms)
{
currentTerm->First();
Location currentLocation = currentTerm->currentLocation;
if (currentLocation < nearestStartLocation) {
nearestTerm = currentTerm;
nearestStartLocation = currentLocation;
}
if (currentLocation > nearestEndLocation) {
nearestEndLocation = currentLocation;
}
++NumberOfTerms;
currentTerm++;
}
}
Location ISROr::GetCurrentLocation(){
return nearestStartLocation;
}
Location ISROr::NextDocument()
{
//Fixme
Location x;
return x;
Location ISROr::Seek ( Location target )
{
// Seek all the ISRs to the first occurrence beginning at// the target location. Return null if there is no match.
// The document is the document containing the nearest term.
//seek past target locations,
//seek all terms in or past starting location, take the ones that nears
//the document that the nearest term is in is the document ur in
//updates private members
return 1;
}
Location ISROr::GetEndDocument()
{
//Fixme
Location x;
return x;
}