OSDN Git Service

68d62ede98df9aa86bc34ae9c64f877bdb39e127
[chnosproject/AI004.git] / aithink.js
1 function AI_Think(env){
2         this.env = env;
3         this.inputting = false;
4 }
5 AI_Think.prototype = {
6         tick: function(){
7                 //定期的に呼ばれることを期待する
8                 if(this.inputting){
9                         this.env.debug("**** Think ****\n");
10                         for(var i = 0; i < 64; i++){
11                                 //入力処理ループ
12                                 var s = this.env.input.getSentence();
13                                 if(s === undefined){
14                                         this.inputting = false;
15                                         
16                                         this.env.wordRecognition.sortCandidateWordListByWordCount();
17                                         this.env.wordRecognition.computeEachWordLevel();
18                                         this.env.wordRecognition.sortCandidateWordListByWordLevel();
19                                         this.env.wordRecognition.debugShowCandidateWordList();
20                                         this.env.memory.saveMemory();
21                                         
22                                         break;
23                                 }
24                                 this.env.message("User> " + s + "\n", true);
25                         }
26                 }
27         },
28         thinkMain: function(){
29                 
30         },
31         
32 }