1 function AI_IOManager(env){
4 AI_IOManager.prototype = {
5 //http://www.atmarkit.co.jp/ait/articles/1112/16/news135_2.html
6 //http://qiita.com/mohayonao/items/fa7d33b75a2852d966fc
7 showDownloadLink: function(blobData){
9 this.env.downloadBox.innerHTML = "<a href='" + window.URL.createObjectURL(blobData) + "' target='_blank'>ダウンロード</a>";
10 } else if(window.webkitURL){
11 this.env.downloadBox.innerHTML = "<a href='" + window.webkitURL.createObjectURL(blobData) + "' target='_blank'>ダウンロード</a>";
13 window.alert("Can't create URL");
18 function AI_Input(env){
20 this.historyList = new Array();
21 this.sentenceList = new Array();
23 AI_Input.prototype = {
33 appendInput: function(input){
34 //inputはStringとArrayが使用できる
35 var sList = input.splitByArray(this.sentenceSeparator);
37 this.sentenceList = this.sentenceList.concat(sList)
39 getSentence: function(){
42 if(this.sentenceList.length <= 0){
45 var retv = this.sentenceList[0];
46 this.sentenceList.splice(0, 1);
53 this.env.wordRecognition.slideLookUpCandidateWordByHistory(retv);
55 this.appendHistory(retv);
58 appendHistory: function(str){
59 this.historyList.push(str);
60 if(this.historyList.length > this.maxHistoryLength){
61 this.historyList.splice(0, this.maxHistoryLength >> 1);