📄 tr_lxn_node_0.cc
字号:
// file: tr_lxn_node_0.cc//// isip include files//#include "train_lex_node.h"#include "train_lex_node_constants.h"// method: make_node_cc//// arguments:// int_4 phone : (input) the monophone index//// return: a Train_Lex_node* pointing to the lexical tree node with this// phone//// this method searches all the child nodes of the current node for// the specified phone and returns the match. if no such node exists,// a new child is added to the list and returned//Train_Lex_node* Train_Lex_node::make_node_cc(int_4 phone_a) { // dummy variables // logical_1 flag = ISIP_FALSE; Train_Lex_node* node = (Train_Lex_node*)NULL; // make sure the link list of children exists // if (child_d == (Train_Link_list*)NULL) { child_d = new Train_Link_list(); } // loop over all the child lex nodes // for (Train_Link_node* nd = child_d->get_head_cc(); nd != (Train_Link_node*)NULL; nd = nd->get_next_cc()) { // get the lexical node in this node // node = (Train_Lex_node*)(nd->get_item_cc()); // stop if the phone here matches the input phone // if (node->get_phone_cc() == phone_a) { flag = ISIP_TRUE; break; } } // if there is no match create a new node and put it in the list // if (flag == ISIP_FALSE) { // memory manager // Train_Memory_manager* manager = Train_Link_list::get_manager_cc(); // create a new node // node = manager->new_lex_cc(); node->phone_d = phone_a; child_d->insert_cc(node); } // return child node and exit gracefully // return node;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -