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

outline for isr phrase

parent 6ff7efc8
No related branches found
No related tags found
1 merge request!9Website
...@@ -202,6 +202,8 @@ add_executable(ISROR-tests ...@@ -202,6 +202,8 @@ add_executable(ISROR-tests
constraintSolver/ISROr.cpp constraintSolver/ISROr.cpp
constraintSolver/tests/ISROrTests.cpp constraintSolver/tests/ISROrTests.cpp
constraintSolver/ISREndDoc.cpp constraintSolver/ISREndDoc.cpp
indexer/Corpus.cpp
indexer/Chunk.cpp
util/stringProcessing.cpp util/stringProcessing.cpp
util/Stemmer.cpp ) util/Stemmer.cpp )
...@@ -224,6 +226,8 @@ add_executable(ISRWord-Multi-Test ...@@ -224,6 +226,8 @@ add_executable(ISRWord-Multi-Test
constraintSolver/ISRAnd.cpp constraintSolver/ISRAnd.cpp
constraintSolver/ISREndDoc.cpp constraintSolver/ISREndDoc.cpp
util/stringProcessing.cpp util/stringProcessing.cpp
indexer/Corpus.cpp
indexer/Chunk.cpp
util/Stemmer.cpp ) util/Stemmer.cpp )
add_executable(ISRMultiWordORTest add_executable(ISRMultiWordORTest
...@@ -233,6 +237,8 @@ add_executable(ISRMultiWordORTest ...@@ -233,6 +237,8 @@ add_executable(ISRMultiWordORTest
constraintSolver/ISRWord.cpp constraintSolver/ISRWord.cpp
constraintSolver/ISRAnd.cpp constraintSolver/ISRAnd.cpp
constraintSolver/ISREndDoc.cpp constraintSolver/ISREndDoc.cpp
indexer/Corpus.cpp
indexer/Chunk.cpp
util/stringProcessing.cpp util/stringProcessing.cpp
util/Stemmer.cpp ) util/Stemmer.cpp )
...@@ -300,6 +306,8 @@ add_executable(testQueryLang ...@@ -300,6 +306,8 @@ add_executable(testQueryLang
util/DataStructureLib/tuple.cpp util/DataStructureLib/tuple.cpp
util/stringProcessing.cpp util/stringProcessing.cpp
util/Stemmer.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 @@ ...@@ -3,3 +3,35 @@
// //
#include "ISRPhrase.h" #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 @@ ...@@ -11,27 +11,18 @@
class ISRPhrase : ISR class ISRPhrase : ISR
{ {
public: public:
ISR **Terms;
vector< ISR* >Terms;
unsigned NumberOfTerms; unsigned NumberOfTerms;
Post *Seek ( Location target ) ISRPhrase ( vector<ISR * > InputTerms );
{
// 1. Seek all ISRs to the first occurrence beginning at Location Seek ( Location target ) override;
// the target location. ISREndDoc * GetEndDocument ( ) override;
// 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 );
}
}; };
......
...@@ -102,6 +102,7 @@ Location ISRWord::First ( ) ...@@ -102,6 +102,7 @@ Location ISRWord::First ( )
Location ISRWord::Next ( ) Location ISRWord::Next ( )
{ {
if ( *currentMemMap == '\n' ) if ( *currentMemMap == '\n' )
{ {
currentChunk++; currentChunk++;
...@@ -121,6 +122,11 @@ Location ISRWord::Next ( ) ...@@ -121,6 +122,11 @@ Location ISRWord::Next ( )
delta += *currentMemMap; delta += *currentMemMap;
currentMemMap++; currentMemMap++;
} }
if(delta.empty( ))
{
return MAX_Location;
cout << "No more delta" << endl;
}
currentLocation += stoll( delta ); currentLocation += stoll( delta );
currentMemMap++; currentMemMap++;
} }
...@@ -183,7 +189,7 @@ Location ISRWord::Seek( Location target ) ...@@ -183,7 +189,7 @@ Location ISRWord::Seek( Location target )
{ {
if(target <= currentLocation) if(target <= currentLocation)
return currentLocation; return currentLocation;
if(target > lastLocation) if(target > lastLocation)
return MAX_Location; return MAX_Location;
......
...@@ -31,8 +31,8 @@ int main ( ) ...@@ -31,8 +31,8 @@ int main ( )
static const char HOST = '='; static const char HOST = '=';
*/ */
ISRWord q1 = ISRWord("chicken"); ISRWord q1 = ISRWord("moment");
ISRWord q2 = ISRWord("waffle"); ISRWord q2 = ISRWord("life");
queries.push_back(q2); queries.push_back(q2);
......
...@@ -6,9 +6,8 @@ ...@@ -6,9 +6,8 @@
#include <set> #include <set>
#include "../../indexer/DocumentEnding.h" #include "../../indexer/DocumentEnding.h"
#include "../ISRWord.h" #include "../ISRWord.h"
#include "../ISREndDoc.h"
#include "../ISROr.h" #include "../ISROr.h"
#include <vector>
using namespace std; using namespace std;
int main ( ) int main ( )
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment