/**
* Juliusの「認識結果」ストリングを単語配列にする
* @see http://julius.sourceforge.jp/index.php?q=doc/module.html
*/
private function juliusParser(str : String) : Array
{
var startindex : int = str.indexOf("<RECOGOUT>");
if(startindex== -1) return null;
var lastindex : int = str.indexOf("</RECOGOUT>");
if (lastindex != -1) {
str = str.slice(startindex, lastindex + 11);
str = str.replace(/<s>/, '');
str = str.replace(/<\/s>/, '');
var xml : XML = new XML(str);
var wordLines : XMLList = xml.children().WHYPO.(@CLASSID != "");
var wordLineNum : int = wordLines.length();
var words : Array = [];
for (var i : int = 0; i < wordLineNum; i++) {
var word : String = wordLines[i].@WORD;
words.push(word);
}
return words;
}
return null;
}
More than 5 years have passed since last update.
音声認識 Julius の「認識結果」ストリングを単語配列に
Last updated at Posted at 2012-10-12
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
44