// file: hmm_train_constants.h
//

// make sure definitions are made only once
//
#ifndef __ISIP_HMM_TRAIN_CONSTANTS
#define __ISIP_HMM_TRAIN_CONSTANTS

// isip include files
//  
#ifndef __ISIP_INTEGRAL_CONSTANTS
#include <integral_constants.h>
#endif

// forward declaration of classes
//
#ifndef __ISIP_TRAIN_HASH_CELL_CONSTANTS
#include <train_hash_cell_constants.h>
#endif

#ifndef __ISIP_TRAIN_HASH_TABLE_CONSTANTS
#include <train_hash_table_constants.h>
#endif

#ifndef __ISIP_TRAIN_LATTICE_CONSTANTS
#include <train_lattice_constants.h>
#endif

#ifndef __ISIP_TRAIN_LATTICE_NODE_CONSTANTS
#include <train_lattice_node_constants.h>
#endif

#ifndef __ISIP_TRAIN_LEX_TREE_CONSTANTS
#include <train_lex_tree_constants.h>
#endif

#ifndef __ISIP_TRAIN_LEX_NODE_CONSTANTS
#include <train_lex_node_constants.h>
#endif

#ifndef __ISIP_TRAIN_LINK_LIST_CONSTANTS
#include <train_link_list_constants.h>
#endif

#ifndef __ISIP_TRAIN_LINK_NODE_CONSTANTS
#include <train_link_node_constants.h>
#endif

#ifndef __ISIP_TRAIN_MEMORY_MANAGER_CONSTANTS
#include <train_memory_manager_constants.h>
#endif

#ifndef __ISIP_TRAIN_MODEL_CONSTANTS
#include <train_model_constants.h>
#endif

#ifndef __ISIP_TRAIN_PHONE_CONSTANTS
#include <train_phone_constants.h>
#endif

#ifndef __ISIP_TRAIN_STATE_CONSTANTS
#include <train_state_constants.h>
#endif

#ifndef __ISIP_TRAIN_TOKEN_CONSTANTS
#include <train_token_constants.h>
#endif

#ifndef __ISIP_TRAIN_TRACE_CONSTANTS
#include <train_trace_constants.h>
#endif

#ifndef __ISIP_TRAIN_WORD_CONSTANTS
#include <train_word_constants.h>
#endif

// define the help file
//
#define HT_HELP_FILE (char_1*)"$ISIP_PROTO/doc/hmm_train.help"

// define a really large negative number as basic score
//
#define HT_DEFAULT_SCORE TRAIN_MODEL_NOTRANS_SCORE

// phonetic context units
//
#define HT_TRIPHONE_SIZE (int_4)3

// define some special phones
//
#define HT_SP_PHONE TRAIN_LXN_SP_PHONE
#define HT_SILENCE_PHONE TRAIN_LXT_SILENCE

// define some special words
//
#define HT_SENT_START_WORD TRAIN_WRD_SENT_START_WORD
#define HT_SENT_END_WORD TRAIN_WRD_SENT_END_WORD

// strings for user-level control input in demo mode
//
#define HT_ABORT (int_4)-1

// characters used to trigger filename expansion via a system call ---
// since this is expensive, we only want to do it when it is
// absolutely necessary
//
#define HT_ENV_DELIMITERS (char_1*)"$~(){}[]?"

// block sizes for traces
//
#define HT_TRACE_BLOCK_SIZE (int_4)99999
#define HT_NODE_BLOCK_SIZE (int_4)99999
#define HT_DEFAULT_BLOCK_SIZE (int_4)9999

// define levels of the search network
//
#define HT_STATE_LEVEL TRAIN_TRACE_STATE_LEVEL
#define HT_PHONE_LEVEL TRAIN_TRACE_PHONE_LEVEL
#define HT_WORD_LEVEL TRAIN_TRACE_WORD_LEVEL
#define HT_NUM_LEVELS TRAIN_TRACE_NUM_LEVELS

// define how many backpointers are to be kept at each level
//
#define HT_STATE_BACKPTR (int_4)1
#define HT_PHONE_BACKPTR (int_4)1
#define HT_WORD_BACKPTR (int_4)1

//  define strings corresponding to users' choice
//
#define HT_MODEL_ALIGN_NAME (char_1*)"model"
#define HT_STATE_ALIGN_NAME (char_1*)"state"
#define HT_CONTEXT_EXP_CROSS_WORD_NAME (char_1*)"cross_word"
#define HT_CONTEXT_EXP_WORD_INTERNAL_NAME (char_1*)"word_internal"

// parameter file related constants (user choices)
//
#define HT_ALIGN_MODE_NAME (char_1*)"align_mode"
#define HT_INPUT_MODE_NAME (char_1*)"input_mode"
#define HT_OUTPUT_MODE_NAME (char_1*)"output_mode"
#define HT_CONTEXT_EXPANSION_NAME (char_1*)"context_expansion"
#define HT_VARIANCE_FLOOR_NAME (char_1*)"variance_floor"
#define HT_MLF_MODE_NAME (char_1*)"mlf_mode"
#define HT_TRAIN_MODE_NAME "train_mode"

//  define values corresponding to users' choice
//
#define HT_MODEL_ALIGN TRAIN_TRACE_PHONE_LEVEL
#define HT_STATE_ALIGN TRAIN_TRACE_STATE_LEVEL
#define HT_CONTEXT_EXP_CROSS_WORD (int_4)0
#define HT_CONTEXT_EXP_WORD_INTERNAL (int_4)1

// define defaults
//
#define HT_DEFAULT_ALIGN_MODE HT_MODEL_ALIGN
#define HT_DEFAULT_CONTEXT_EXP HT_CONTEXT_EXP_CROSS_WORD
#define HT_DEFAULT_INPUT_MODE HT_ASCII_MODE
#define HT_DEFAULT_VAR_FLOOR (float_8)0.002

// commandline identifiers
//
#define HT_PARAMS_OPT "-p"
#define HT_CONTEXT_OPT "-c"
#define HT_HELP_OPT "-help"

// parameter file options
//
#define HT_MONOPHONE_FILE "monophones_file"
#define HT_INPUT_FILE "input_file"
#define HT_MLF_FILE "mlf_file"
#define HT_OUTPUT_FILE "output_file"
#define HT_TRANSITIONS_FILE "transitions_file"
#define HT_STATES_FILE "states_file"
#define HT_UPDATED_STATE_FILE "updated_states_file"
#define HT_MODELS_FILE  "models_file"
#define HT_UPDATED_TRANS_FILE "updated_trans_file"
#define HT_BATCH_STATS_FILE "batch_stats_file"
#define HT_ACC_LIST_FILE "acc_list_file"
#define HT_PHONES_FILE "phones_file"
#define HT_LEXICON_FILE "lexicon_file"
#define HT_CONTEXT_MODE "context_mode"
#define HT_WORD_INTERNAL_MODE "word_internal"
#define HT_CROSS_WORD_MODE "cross_word"
#define HT_MONO_PHONE_MODE "monophone"
#define HT_INPUT_MODE "input_mode"
#define HT_MODEL_MLF "model_mlf"
#define HT_WORD_MLF "word_mlf"
#define HT_SPH_FILE "special_model_list"
#define HT_STATE_OCC_FILE "state_occupancy_file"
#define HT_STATE_OCCUPANCY "state_occupancy"

// training mode related parameters
//
#define HT_BATCH_MODE "batch"
#define HT_NORMAL_MODE "normal"
#define HT_COMBINE_MODE "combine"
#define HT_DEFAULT_TRAIN_MODE HT_NORMAL_MODE
#define HT_NORMAL (int_4)0
#define HT_BATCH (int_4)1
#define HT_COMBINE (int_4)2

// on and off options
//
#define HT_OPT_ON ISIP_TRUE
#define HT_OPT_OFF ISIP_FALSE
#define HT_OPT_ON_NAME (char_1*)"on"
#define HT_OPT_OFF_NAME (char_1*)"off"

// temporarily keep it
//
#define HT_DEMO_OPT "-demo"

#define HT_MAPMI "max_active_phones"
#define HT_NBEST "n-best"
#define HT_BEAM_WIDTH "beam_width"
#define HT_CONTEXT_SIZE "context_size"
#define HT_OUTPUT_MODE "output_mode"

#define HT_DEF_TRIPHONE 3
#define HT_WRD_INTERNAL 2
#define HT_MONOPHONE 1

// input feature modes and transcription modes
//
#define HT_ASCII_MODE 0
#define HT_ASCII "ascii"
#define HT_BINARY_MODE 1
#define HT_BINARY "binary"
#define HT_MODEL_TRANS ISIP_TRUE
#define HT_WORD_TRANS ISIP_FALSE

// file reading formats
//
#define HT_UTT_ID_FORMAT (char_1*)"\"*/%s.lab""\n"
#define HT_MAX_NUM_PHONES (int_4)100
#define HT_MAX_NUM_SPH (int_4)20

// constants string for the format of parameter files
//
#define HT_STR_NUM_MODELS "num_models"
#define HT_STR_NUM_MONOPHONES "num_monophones"
#define HT_STR_NUM_PHONES "num_phones"
#define HT_STR_NUM_TRANSITIONS "num_transitions"
#define HT_STR_OP_CI "CI"
#define HT_STR_OP_CD "CD"

// define the sp string
//
#define HT_SP_STRING "sp"

// end of file
//
#endif
