diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d56d41f3da2d2d38f1846206e99eb42900ba236..45b2dc1d33d87172194df769ebcc98a50d33ff06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,7 +244,7 @@ add_executable(MasterReader-tests indexer/MasterReader.cpp ) -add_executable(query-Ranker-tests +add_executable(queryRankerTest query/Ranker/tests/RankerTest.cpp query/Ranker/Ranker.h query/Ranker/Scorer.h @@ -256,7 +256,13 @@ add_executable(query-Ranker-tests constraintSolver/ISRWord.cpp constraintSolver/ISREndDoc.cpp util/stringProcessing.cpp - util/Stemmer.cpp ) + util/Stemmer.cpp + ) +add_executable(testQueryLang + query/queryLanguage/tests/testQueryParser.cpp + query/queryLanguage/QueryParser.cpp + util/ + ) find_package(OpenSSL REQUIRED) diff --git a/constraintSolver/ISR.h b/constraintSolver/ISR.h index c7961e5383f8dc9905fd0bc8e229cab6512140db..244a3ac775b29bf2b33c7b4b71e203aaaf836baa 100644 --- a/constraintSolver/ISR.h +++ b/constraintSolver/ISR.h @@ -42,6 +42,13 @@ public: } + + Location GetISRToBeginningOfDocument( ) + { + return GetEndDocument()->getCurrentDoc().docEndPosition - GetEndDocument()->getCurrentDoc().docNumWords; + + } + //Returns first instance of word after target location virtual Location Seek ( Location target ) = 0; diff --git a/constraintSolver/ISRWord.cpp b/constraintSolver/ISRWord.cpp index a5547c392c4823d42ca3efdd1e12c8664ee1a2a5..09e46368f92bf394d7b1b745c3f1fefc42026e5d 100644 --- a/constraintSolver/ISRWord.cpp +++ b/constraintSolver/ISRWord.cpp @@ -217,14 +217,7 @@ ISREndDoc * ISRWord::GetEndDocument() return DocumentEnd; } -ISR * ISRWord::GetISRToBeginningOfDocument ( ) { - Location beginningOfDoc = DocumentEnd->getCurrentDoc().docEndPosition - DocumentEnd->getCurrentDoc().docNumWords; - ISR* BeginngISR = new ISRWord(this->term); - BeginngISR->Seek(beginningOfDoc); - - - } string ISRWord::GetTerm() { diff --git a/constraintSolver/ISRWord.h b/constraintSolver/ISRWord.h index 056a8472c7e9cfa34c6f2379515ea7a7b0d71192..a98114e77cbd0032a58046281c0f3ff642ae658f 100644 --- a/constraintSolver/ISRWord.h +++ b/constraintSolver/ISRWord.h @@ -37,7 +37,6 @@ class ISRWord : public ISR unsigned GetNumberOfOccurrences ( ); string GetTerm( ); - ISR * GetISRToBeginningOfDocument ( ) ; // ISR *GetDocumentISR( ); diff --git a/constraintSolver/Post.cpp b/constraintSolver/Post.cpp deleted file mode 100644 index 33c93f3e8799f19e32d37eb3c8399f8c74d05b5f..0000000000000000000000000000000000000000 --- a/constraintSolver/Post.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// -// Created by Jake Close on 3/13/18. -// - -#include "Post.h" diff --git a/constraintSolver/Post.h b/constraintSolver/Post.h deleted file mode 100644 index 25c5482c111fafc7069cad39f68516dcca8465ef..0000000000000000000000000000000000000000 --- a/constraintSolver/Post.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// Created by Jake Close on 3/13/18. -// - -#pragma once - -typedef size_t Location; // Location 0 is the null location. -typedef size_t FileOffset; -typedef union Attributes - { - WordAttributes Word; - DocumentAttributes Document; - }; - -class Post - { - -public: - //What Start / End Location - virtual Location GetStartLocation ( ); - - virtual Location GetEndLocation ( ); - - virtual Attributes GetAttributes ( ); - //Returns Next next delta - - //TO-DO NICK/ZANE - virtual Post *Next ( ); - - Location currentLocation; - //*why? - //virtual ISR* GetIsr( ); - - }; - - diff --git a/constraintSolver/PostingList.cpp b/constraintSolver/PostingList.cpp deleted file mode 100644 index 3f6db1312d3d3b1df1048064b1784342dfb1018b..0000000000000000000000000000000000000000 --- a/constraintSolver/PostingList.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// -// Created by Jake Close on 3/13/18. -// - -#include "PostingList.h" diff --git a/constraintSolver/PostingList.h b/constraintSolver/PostingList.h deleted file mode 100644 index 349914032321aa729632c819c26adf22232681f1..0000000000000000000000000000000000000000 --- a/constraintSolver/PostingList.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// Created by Jake Close on 3/13/18. -// - -#pragma once - -#include "Post.h" - -class PostingList - { -private: - struct PostingListIndex - { - FileOffset Offset; - Location PostLocation; - }; - - PostingListIndex *index; - - virtual char *GetPostingList ( ); - -public: - virtual Post *Seek ( Location ); - - - }; - - diff --git a/constraintSolver/tests/ISROrTests.cpp b/constraintSolver/tests/ISROrTests.cpp index e08f5c7d5719ceab8f82bf7776e642bd53019d5b..21ac5514a0d2f605494850615a4576d6b10071b9 100644 --- a/constraintSolver/tests/ISROrTests.cpp +++ b/constraintSolver/tests/ISROrTests.cpp @@ -34,8 +34,6 @@ int main ( ) while(queryOr->GetCurrentLocation() != MAX_Location) { auto url = queryOr->GetEndDocument()->getCurrentDoc().url; - if(url == "file59tweet151421970293063681") - cout << "PREBUG"; cout << url << endl; urls.insert(url); queryOr->NextDocument(); diff --git a/queryRankerTest b/queryRankerTest new file mode 100755 index 0000000000000000000000000000000000000000..942f080a2eb5af2b1bbd3fa3b697a72eb926956d Binary files /dev/null and b/queryRankerTest differ