#ifndef DECODER__H
#define DECODER__H

#include <filesystem>
#include "ReadingMachine.hpp"
#include "SubConfig.hpp"

class Decoder
{
  private :

  ReadingMachine & machine;
  std::map<std::string, std::array<float,4>> evaluation;

  public :

  Decoder(ReadingMachine & machine);
  void decode(BaseConfig & config, std::size_t beamSize, bool debug);
  void evaluate(const Config & config, std::filesystem::path modelPath, const std::string goldTSV);
  float getMetricScore(const std::string & metric, std::size_t scoreIndex);
  float getPrecision(const std::string & metric);
  float getF1Score(const std::string & metric);
  float getRecall(const std::string & metric);
  float getAlignedAcc(const std::string & metric);
};

#endif