📄 bw_phone_3.cc
字号:
// file: bw_phone_2.cc// // isip include files//#include "bw_train.h"#include "bw_train_constants.h"// method: get_nphone_ind_cc//// arguments:// int_4 ph_size : (input) context size// int_4 num_mono : (input) number of monophones// int_4* ph_map : (input) indices of the context-dependent phone// int_4 context_mode : (input) the context mode// // return: the index of the phone according to the monophone sequence//// this method returns the phone index of the given n-phone formed by// the given constituent phones//int_4 get_nphone_ind_cc(int_4 ph_size_a, int_4 num_mono_a, int_4* phn_a, int_4 context_mode_a) { // declare local variables // int_4 phn_index = (int_4)0; int_4 tmp = (int_4)0; // this is just for monophone debugging // we can put the context_mode_a for judgement later // if(context_mode_a == BW_MONOPHONE){ tmp = phn_a[1]; // check if the phone is 'sil' or 'sp' // if ((tmp == BW_SILENCE_PHONE) || (tmp == BW_SP_PHONE)) { phn_index = tmp * (int_4)pow(num_mono_a, 0); } else { if (tmp < BW_SP_PHONE) { tmp = (int_4)0; } phn_index += tmp * (int_4)pow(num_mono_a, 0); } } // this code are for tri-phone and word internal // else { // check the middle phone // tmp = phn_a[ph_size_a/2]; if ((tmp == BW_SILENCE_PHONE) || (tmp == BW_SP_PHONE)) { phn_index = tmp * (int_4)pow(num_mono_a, ph_size_a/2); } // otherwise loop over the constituent phone indices to determine // the location of the nphone // else { for (int_4 i = 0; i < ph_size_a; i++) { tmp = phn_a[i]; if (tmp <= BW_SP_PHONE) { tmp = (int_4)0; } phn_index += tmp * (int_4)pow(num_mono_a, i); } } } // exit gracefully // return phn_index;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -