diff --git a/src/renderer/core/index.js b/src/renderer/core/index.js new file mode 100644 index 0000000..e69de29 diff --git a/src/renderer/views/Home/chatroom.vue b/src/renderer/views/Home/chatroom.vue index 1530260..27426e0 100644 --- a/src/renderer/views/Home/chatroom.vue +++ b/src/renderer/views/Home/chatroom.vue @@ -32,8 +32,7 @@ application 管理外部应用接口 - - status 查看目前知识所掌握情况 + status 查看目前知识所掌握情况 另外你也可以通过输入 hint 查看其他人自定义的内容提示或小小线索

魔理沙无条件的相信你..她把你交给她的所有知识视作珍宝并会很认真的将其牢牢记住..不要让她学坏哦! @@ -77,10 +76,13 @@ export default { case 'teach': this.talk_list.push({ name: MARISA, - content: '
好的,你要教我什么呢?
格式:You的消息`白絲魔理沙的回复' + content: '要教给魔里沙什么 ..? 现在只能学习语句.. 如"问`答".. 中止教学输入 exit ..' }) this.cmd_flag = 1 break + case 'status': + this._marisaStatus() + break default: this._marisaReply(_content) } }, @@ -101,8 +103,7 @@ export default { ratio++ } }) - console.log('ratio:' + ratio) - if ((ratio / keywords.length) > 0.8) { + if ((ratio / keywords.length) >= 0.5) { answer = memorise[i].answer break } @@ -119,12 +120,17 @@ export default { name: MARISA, content: '唔嗯...不懂你在说什么呢...' }) - console.log(this.$dictionary.doSegment(_content, { - simple: true - })) } }, _teachMarisa (_content) { + if (_content === 'exit') { + this.talk_list.push({ + name: YOU, + content: '白丝魔理沙,退出学习模式' + }) + this.cmd_flag = 0 + return + } // 将you`marisa格式转换为[you,marisa]数组 let str = _content.split('`') // 将you的句子分词分一个数组 @@ -144,7 +150,7 @@ export default { ratio++ } }) - if ((ratio / keywords.length) > 0.5) { + if ((ratio / keywords.length) >= 0.5) { keywords.concat(toPpl) // 去除重复的关键词或字 keywords = Array.from(new Set(keywords.filter((x, i, self) => self.indexOf(x) === i))) @@ -171,6 +177,14 @@ export default { }) this.cmd_flag = 0 }, + _marisaStatus () { + let memorise = this.$db.get('memorise').value().length + let weight = 0.00011 * parseFloat(memorise) + this.talk_list.push({ + name: MARISA, + content: `目前魔理沙的脑重量是${weight} 克。如果我现在还不能理解您的意思的话,请教给我更多的知识,我会非常非常用心学习的~` + }) + }, _scrollBottom () { this.$nextTick(() => { let _scrollHeight = this.$refs.talk_place.scrollHeight