Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RawScorerNodeExtractor.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2004 University of Massachusetts.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 
00013 //
00014 // RawScorerNodeExtractor.hpp
00015 //
00016 // 5 March 2004 -- tds
00017 //
00018 
00019 #ifndef INDRI_RAWSCORERNODEEXTRACTOR_HPP
00020 #define INDRI_RAWSCORERNODEEXTRACTOR_HPP
00021 
00022 #include "indri/Walker.hpp"
00023 #include "indri/QuerySpec.hpp"
00024 
00025 class RawScorerNodeExtractor : public indri::lang::Walker {
00026 private:
00027   std::vector<indri::lang::RawScorerNode*> _scorerNodes;
00028   std::vector<indri::lang::Node*> _reachableNodes;
00029   int _insideCount;
00030 
00031 public:
00032   void defaultBefore( indri::lang::Node* n ) {
00033     if( _insideCount ) {
00034       _reachableNodes.push_back(n);
00035     }
00036   }
00037 
00038   void before( indri::lang::RawScorerNode* node ) {
00039     _insideCount++;
00040     _scorerNodes.push_back(node);
00041     _reachableNodes.push_back(node);
00042   }
00043 
00044   void after( indri::lang::RawScorerNode* node ) {
00045     _insideCount--;
00046   }
00047 
00048   std::vector<indri::lang::RawScorerNode*>& getScorerNodes() {
00049     return _scorerNodes;
00050   }
00051 
00052   std::vector<indri::lang::Node*>& getReachableNodes() {
00053     return _reachableNodes;
00054   }
00055 };
00056 
00057 #endif // INDRI_RAWSCORERNODEEXTRACTOR_HPP
00058 

Generated on Wed Nov 3 12:59:03 2004 for Lemur Toolkit by doxygen1.2.18