/*
    Copyright (C) 2012 Bartosz Broda, Jacek Bochenek, Łukasz Biłeńkij, 
    Damian Jaworski, Wojciech Mazur, Dominik Piasecki, Maciej Piasecki, 
    Radosław Ramocki
    
    This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.

    This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. 

    See the LICENSE and COPYING files for more details.
*/

#ifndef DOC_TERM_ARCHITECT_CONFIG_H
#define DOC_TERM_ARCHITECT_CONFIG_H

#include <string>
#include <vector>
#include <map>
#include <fstream>
#include <stdexcept>
#include "Corpus/Corpus/corpus_all.h"

#include <boost/algorithm/string.hpp>

namespace doc_term_architect
{
	class Config
	{
	public:
		static Config* Initalize(int argc, char* argv[]);
		static Config* GetInstance();
		static void Delete();

		/// list of documents == rows of matrix
		std::vector<std::string> m_vDocumentList;
		
		/// labels for columns
		std::vector<std::string> m_vColumnTerms;

		/// flex-> (word_id -> column_no )
		std::map<Corpus::TFlexClass, std::map<int, size_t>  > m_mTermIndex;

		int m_iThreads;

		std::string m_sCorpusInfo;
		std::string m_sMatrixName;
		std::string m_sWorkDir;
		
		std::string m_sDocumentFilename;
		std::string m_sTermsFilename;

		std::string m_sDictionary;

	private:
		static Config* m_pInstance;
		
		void LoadTerms();
		void BuildTermsIndex();
		void LoadDocuments();

		void LoadList(const std::string &filename, std::vector<std::string> &lines);
	};
}//namespace doc_term_architect
#endif //DOC_TERM_ARCHITECT_CONFIG_H

