Skip to content

Commit

Permalink
整理:
Browse files Browse the repository at this point in the history
  • Loading branch information
big-stream committed Jun 25, 2020
1 parent 24f981e commit a6fbfc0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/build-kuromoji.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const kuromoji = require('kuromoji')

module.exports = debug => {
return new Promise((resolve, reject) => {
if (debug) console.time('#### ビルド時間')
kuromoji.builder({
dicPath: __dirname + '/../node_modules/kuromoji/dict'
}).build(function(err, _tokenizer) {
if (err) {
console.error('エラー: kuromojiのビルド失敗')
reject(err)
}
if (debug) {console.timeEnd('#### ビルド時間'); console.log()}
resolve(_tokenizer)
})
})
}

0 comments on commit a6fbfc0

Please sign in to comment.