Skip to content

hoto17296/hubot-middleware-kuromoji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hubot-middleware-kuromoji

Build Status

Tokenize all the messages that Hubot have received by kuromoji.js

Install

npm install hubot-middleware-kuromoji

Add "hubot-middleware-kuromoji" to your external-scripts.json

Usage

You can use tokenized sentence from msg.message.tokenized

module.exports = (robot) ->

  robot.hear /.*/, (msg) ->
    msg.message.tokenized.map (token) ->
      if token.pos == '感動詞'
        msg.reply token.surface_form
hubot> こんにちは
Shell: こんにちは

About

Tokenize all the messages that Hubot have received by kuromoji.js

Resources

Stars

Watchers

Forks

Packages

No packages published