/*---------------------------------------------------------------------------------------------------------------------
- File      : user_configuration.h                                                        Project ELSE, EPFL - DI/LIA -
-                                                                       Evaluation in Language and Speech Engineering -
- Author    : Seydoux Florian   Creation date : 29 June 1999                                                          -
- Eulogist  : -                 Approval date : -                  Version: 0.1                                       -
-                                                                                                                     -
- Descript. : Description, format fichier de conf., reference au document.                                            -
-                                                                                                                     -
- Requested : -                                                                                                       -
-                                                                                                                     -
- Gaps      : o) Lecture de la configuration par lecture de champs                                                    -
-                                                                                                                     -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Rev. date | Reviser               | Revise's description                                                            -
- - - - - - + - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ../../....| ........              | ...                                                                             -
---------------------------------------------------------------------------------------------------------------------*/

#ifndef USER_CONFIGURATION_H
#define USER_CONFIGURATION_H

#include <map>
#include <vector>
#include <string>
#include <fstream>
#include <cassert>
#include <stdexcept>

#include "globaldef.h"
#include "messages_manager.h"

#ifdef _USE_NAMESPACES
    namespace Else { 
#endif // _USE_NAMESPACES

class UserConfiguration : public GraceTools {
public:
enum ConfigType {Reference, System, Unknown};
typedef pair<conform_string, conform_string> Separator;  // <Separator, Transcoded>
typedef map<string, string> FileAssociation;

public:
    void static readSystemName(const string& filename, conform_string& systemName);

    UserConfiguration();
    const string& nickname() const;
    const unsigned char& id() const;
    bool readFrom(const string& filename, const ConfigType mode = Unknown, const bool quiet = false);
    const conform_string& system() const;
    const conform_string& operator()(const ShortNatural index, const bool transcoded = false) const;
    conform_string sep(const ShortNatural index, const bool transcoded = false) const;

public:
    bool             reference;
    conform_string   fileName;
    conform_string   systemName;
    conform_string   mapName;
    TypeTable        mapMode;
    Separator        separator[6];
    conform_string   unknownTag;
    conform_string   irrelevantTag;
    conform_string   neutralizedTag;
    conform_string   unalignedTag;
    FileAssociation  taggedCorpus;

private:
    static const string         TOOLS_NICKNAME;
    static const unsigned char  TOOLS_ID;
};

typedef UserConfiguration*       UserConfigurationPtr;
typedef const UserConfiguration* UserConfigurationCPtr;

#ifdef _USE_NAMESPACES
}
#endif // _USE_NAMESPACES

#endif // USER_CONFIGURATION_H

