Skip to content
Snippets Groups Projects
Commit c50cde74 authored by jsclose's avatar jsclose
Browse files

outline for isr phrase

parent 6ff7efc8
Branches
No related tags found
1 merge request!9Website
......@@ -202,6 +202,8 @@ add_executable(ISROR-tests
constraintSolver/ISROr.cpp
constraintSolver/tests/ISROrTests.cpp
constraintSolver/ISREndDoc.cpp
indexer/Corpus.cpp
indexer/Chunk.cpp
util/stringProcessing.cpp
util/Stemmer.cpp )
......@@ -224,6 +226,8 @@ add_executable(ISRWord-Multi-Test
constraintSolver/ISRAnd.cpp
constraintSolver/ISREndDoc.cpp
util/stringProcessing.cpp
indexer/Corpus.cpp
indexer/Chunk.cpp
util/Stemmer.cpp )
add_executable(ISRMultiWordORTest
......@@ -233,6 +237,8 @@ add_executable(ISRMultiWordORTest
constraintSolver/ISRWord.cpp
constraintSolver/ISRAnd.cpp
constraintSolver/ISREndDoc.cpp
indexer/Corpus.cpp
indexer/Chunk.cpp
util/stringProcessing.cpp
util/Stemmer.cpp )
......@@ -300,6 +306,8 @@ add_executable(testQueryLang
util/DataStructureLib/tuple.cpp
util/stringProcessing.cpp
util/Stemmer.cpp
indexer/Corpus.cpp
indexer/Chunk.cpp
)
......
No preview for this file type
File deleted
No preview for this file type
No preview for this file type
......@@ -3,3 +3,35 @@
//
#include "ISRPhrase.h"
void ISRPhrase::ISRPhrase( vector < ISR * > InputTerms )
{
}
Location ISRPhrase::Seek( Location target )
{
// 1. Seek all ISRs to the first occurrence beginning at
// the target location.
// 2. Pick the furthest term and attempt to seek all
// the other terms to the first location beginning
// where they should appear relative to the furthest
// term.
// 3. If any term is past the desired location, return
// to step 2.
// 4. If any ISR reaches the end, there is no match.
}
ISREndDoc * ISRPhrase::GetEndDocument ( )
{
}
\ No newline at end of file
......@@ -11,27 +11,18 @@
class ISRPhrase : ISR
{
public:
ISR **Terms;
vector< ISR* >Terms;
unsigned NumberOfTerms;
Post *Seek ( Location target )
{
// 1. Seek all ISRs to the first occurrence beginning at
// the target location.
// 2. Pick the furthest term and attempt to seek all
// the other terms to the first location beginning
// where they should appear relative to the furthest
// term.
// 3. If any term is past the desired location, return
// to step 2.
// 4. If any ISR reaches the end, there is no match.
}
Post *Next ( )
{
// Finds overlapping phrase matches. return Seek( nearestStartLocation + 1 );
}
ISRPhrase ( vector<ISR * > InputTerms );
Location Seek ( Location target ) override;
ISREndDoc * GetEndDocument ( ) override;
};
......
......@@ -102,6 +102,7 @@ Location ISRWord::First ( )
Location ISRWord::Next ( )
{
if ( *currentMemMap == '\n' )
{
currentChunk++;
......@@ -121,6 +122,11 @@ Location ISRWord::Next ( )
delta += *currentMemMap;
currentMemMap++;
}
if(delta.empty( ))
{
return MAX_Location;
cout << "No more delta" << endl;
}
currentLocation += stoll( delta );
currentMemMap++;
}
......@@ -183,7 +189,7 @@ Location ISRWord::Seek( Location target )
{
if(target <= currentLocation)
return currentLocation;
return currentLocation;
if(target > lastLocation)
return MAX_Location;
......
......@@ -31,8 +31,8 @@ int main ( )
static const char HOST = '=';
*/
ISRWord q1 = ISRWord("chicken");
ISRWord q2 = ISRWord("waffle");
ISRWord q1 = ISRWord("moment");
ISRWord q2 = ISRWord("life");
queries.push_back(q2);
......
......@@ -6,9 +6,8 @@
#include <set>
#include "../../indexer/DocumentEnding.h"
#include "../ISRWord.h"
#include "../ISREndDoc.h"
#include "../ISROr.h"
#include <vector>
using namespace std;
int main ( )
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment