#ifndef PRODMARK_INTEGRATOR_H_INCLUDED
#define PRODMARK_INTEGRATOR_H_INCLUDED
#include <vector>
#include <map>
#include "recognition.h"
#include "postprocessing.h"
namespace prodmark {
class Integrator {
public:
Integrator();
~Integrator();
int Reset();
int AddResult(const std::string& type,
const std::string& subtype,
std::vector<DocumentZoneRecognitionResult>& result,
bool& may_finish);
const std::vector<DocumentZoneRecognitionResult>& GetIntegratedResult();
const std::string GetType() const;
const std::string GetSubType() const;
private:
std::map<std::string, std::vector<std::pair< std::vector<DocumentZoneRecognitionResult>, int> > > type_;
std::map<std::string, std::vector<std::vector <double> > > max_confidence_of_row;
std::map<std::string, std::vector<std::vector <double> > > max_confidence_of_place;
std::pair<std::string, int> best_result_;
std::vector<DocumentZoneRecognitionResult> cur_result;
std::map<std::string, std::vector<int> > count_of_good_result;
};
} // namespace prodmark
#endif // PRODMARK_INTEGRATOR_H_INCLUDED