📄 tr_wrd_phone_5.cc
字号:
// file: tr_wrd_phone_5.cc// // isip include files//#include "train_word.h"#include "train_word_constants.h" // method: add_pron_cc//// arguments:// int_4 num_ph: (input) number of phones in this pronunciation// int_4* phones: (input) array of phones for this prnunciation//// return: a logical_1 flag indicating success//// this method adds a pronunciation to an existing word//logical_1 Train_Word::add_pron_cc(int_4 num_ph_a, int_4* phones_a) { // assign the pronunciations only if valid // if (num_ph_a <= (int_4)0) { return ISIP_FALSE; } // update number of pronunciations // num_prons_d++; // copy the pronunciations // int_4** phlist = new int_4*[num_prons_d]; int_4* numph = new int_4[num_prons_d]; for (int_4 i = 0; i < num_prons_d - 1; i++) { numph[i] = num_phones_d[i]; phlist[i] = phone_list_d[i]; } numph[num_prons_d - 1] = num_ph_a; phlist[num_prons_d - 1] = new int_4[num_ph_a]; memcpy(phlist[num_prons_d - 1], phones_a, num_ph_a * sizeof(int_4)); // copy the arrays over // delete [] num_phones_d; delete [] phone_list_d; phone_list_d = phlist; num_phones_d = numph; // exit gracefully // return ISIP_TRUE;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -