0001 function [wpa, uniqModels]=wpaRead(wpaFile)
0002
0003
0004
0005
0006
0007
0008
0009
0010 [word, pa]=textread(wpaFile, '%s\t%s');
0011 wordNum=length(word);
0012 [wpa(1:wordNum).word] = deal(word{:});
0013 [wpa(1:wordNum).pa] = deal(pa{:});
0014
0015 if nargout>1
0016 modelInWpa={};
0017 for i=1:length(wpa)
0018 items=split(wpa(i).pa, '#');
0019 for j=1:length(items)
0020 monophones=split(items{j}, '_');
0021 for k=1:length(monophones)-1
0022 biphone=[monophones{k}, '+', monophones{k+1}];
0023 modelInWpa{end+1}=biphone;
0024 end
0025 biphone=[monophones{end}, '+sil'];
0026 modelInWpa{end+1}=biphone;
0027 end
0028 end
0029 uniqModels=unique(modelInWpa);
0030 end
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048