Home > asr > hanyu2tonalInitialFinal.m

hanyu2tonalInitialFinal

PURPOSE ^

hanyu2tonalInitialFinal: Hanyu syllable to tonal initial and final

SYNOPSIS ^

function [tonalInitial, tonalFinal]=hanyu2tonalInitialFinal(hanyuSyl)

DESCRIPTION ^

 hanyu2tonalInitialFinal: Hanyu syllable to tonal initial and final
    Usage: [tonalInitial, tonalFinal]=hanyu2tonalInitialFinal(hanyuSyl)

    For example:
        [tonalInitial, tonalFinal]=hanyu2tonalInitialFinal('chuang')

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [tonalInitial, tonalFinal]=hanyu2tonalInitialFinal(hanyuSyl)
0002 % hanyu2tonalInitialFinal: Hanyu syllable to tonal initial and final
0003 %    Usage: [tonalInitial, tonalFinal]=hanyu2tonalInitialFinal(hanyuSyl)
0004 %
0005 %    For example:
0006 %        [tonalInitial, tonalFinal]=hanyu2tonalInitialFinal('chuang')
0007 
0008 %    Roger Jang, 20070926
0009 
0010 qiYin={'z', 'c', 's', 'zh', 'ch', 'sh', 'k', 'h', 'd', 't', 'b', 'p', 'j', 'q', 'x', 'f', 'g'};        % 氣音列表
0011 for i=1:length(qiYin)
0012     qiYinLen(i)=length(qiYin{i});
0013 end
0014 [junk, index]=sort(-qiYinLen);        % 長者優先比對
0015 qiYin=qiYin(index);
0016 
0017 tonalInitial=[];
0018 tonalFinal=hanyuSyl;
0019 for i=1:length(qiYin)
0020     if strfind(hanyuSyl, qiYin{i})==1
0021         tonalInitial=qiYin{i};
0022         tonalFinal=hanyuSyl(length(qiYin{i})+1:end);
0023         break;
0024     end
0025 end

Generated on Tue 01-Jun-2010 09:50:19 by m2html © 2003