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

completed solve

parent 9aef7820
No related branches found
No related tags found
1 merge request!9Website
......@@ -24,20 +24,25 @@ void ISRContainer::compile( )
ISR * ISRContainer::recurviseCompile( Tuple * root )
{
vector< ISR * > terms;
vector< ISR * > words;
if( root->Type == WordTupleType )
return new ISRWord( root->object.text );
{
string currentTerm;
terms.push_back( currentTerm );
return new ISRWord( currentTerm );
}
else
{
for( auto child : root->Next )
terms.push_back( recurviseCompile( child ) );
words.push_back( recurviseCompile( child ) );
}
if( root->Type == AndTupleType )
return new ISRAnd ( terms );
return new ISRAnd ( words );
else
return new ISROr ( terms );
return new ISROr ( words );
}
......@@ -47,6 +52,8 @@ void ISRContainer::Solve( )
{
auto url = Contained->GetEndDocument()->getCurrentDoc().url;
cout << url << endl;
Location BeginningfDocument = Contained->GetISRToBeginningOfDocument( );
PassToRanker( BeginningfDocument );
Contained->NextDocument( );
......@@ -72,3 +79,19 @@ void ISRContainer::Solve( )
}
void ISRContainer::PassToRanker( Location docBeginning )
{
vector<ISRWord* > toRanker;
for ( auto term : Terms )
{
ISRWord * isrWord = new ISRWord ( term ) ;
isrWord->Seek( docBeginning );
toRanker.push_back( isrWord );
}
ranker.rank ( toRanker )
}
......@@ -56,6 +56,7 @@ public:
*
*/
void Solve( );
void PassToRanker ( Location BeginningfDocument );
private:
......
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