Home > asr > digitConvert4military.m

digitConvert4military

PURPOSE ^

digitConvert4military: Convert digits in a text into military pronunciation

SYNOPSIS ^

function output=digitConvert4military(text)

DESCRIPTION ^

 digitConvert4military: Convert digits in a text into military pronunciation

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function output=digitConvert4military(text)
0002 % digitConvert4military: Convert digits in a text into military pronunciation
0003 
0004 if nargin<1, selfdemo; return; end
0005 
0006 original={'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
0007 target={'洞', '么', '兩', '三', '四', '五', '六', '拐', '八', '勾'};
0008 
0009 output=text;
0010 for i=1:length(original)
0011     output=strrep(output, original{i}, target{i});
0012 end
0013 
0014 % ====== Self demo
0015 function selfdemo
0016 input='我家電話是: 5742796';
0017 output=digitConvert4military(input);
0018 fprintf('input = %s\n', input);
0019 fprintf('output = %s\n', output);

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