wrd_phone_0.cc

来自「这是处理语音信号的程序」· CC 代码 · 共 53 行

CC
53
字号
// file: wrd_phone_0.cc// // isip include files//#include "word.h"#include "word_constants.h" // method: set_phone_list_cc//// arguments: none//  int_4** phone_list_a : (input) pointer to the list of pronunciations//  int_4* num_phones_a : (input) number of phones in the pronunciations//  int_4 num_prons_a : (input) number of pronunciations of word//// return: a logical_1 indicating status//// this method sets the pronunciation parameters//logical_1 Word::set_phone_list_cc(int_4** phone_list_a, int_4* num_phones_a,				  int_4 num_prons_a) {  // free existing memory  //  if (phone_list_d != (int_4**)NULL) {    for (int_4 i = 0; i < num_prons_d; i++) {      delete [] phone_list_d[i]       ;    }    delete [] phone_list_d;  }  if (num_phones_d != (int_4*)NULL) {    delete [] num_phones_d;  }    // assign the number of pronunciations  //  num_prons_d = num_prons_a;    // copy the pronunciations  //  phone_list_d = new int_4*[num_prons_d];  num_phones_d = new int_4[num_prons_d];  for (int_4 i = 0; i < num_prons_d; i++) {    num_phones_d[i] = num_phones_a[i];    phone_list_d[i] = new int_4[num_phones_d[i]];    memcpy(phone_list_d[i], phone_list_a[i], num_phones_d[i] * sizeof(int_4));  }  // exit gracefully  //  return ISIP_TRUE;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?