From 0610f64ad9b18e5aa36b8e05fa8ce1f03d0a6977 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 7 Sep 2017 02:59:33 +0900 Subject: [PATCH] :+1: --- src/tools/ai/core.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/ai/core.ts b/src/tools/ai/core.ts index 25bb807bb..5dcce2626 100644 --- a/src/tools/ai/core.ts +++ b/src/tools/ai/core.ts @@ -20,7 +20,13 @@ export default class Categorizer { } private tokenizer(text: string) { - return this.mecab.wakachiSync(text); + const tokens = this.mecab.parseSync(text) + // 名詞だけに制限 + .filter(token => token[1] === '名詞') + // 取り出し + .map(token => token[0]); + + return tokens; } public async init() {