From eb74d224a99e2de86cd8cd94bc45091623cfd0ef Mon Sep 17 00:00:00 2001 From: Lars Date: Mon, 4 May 2020 12:53:14 +0900 Subject: [PATCH] Allow no option for TokenizerBuilder In the current version, an option object without dicPath can be passed into the TokenizerBuilder. If so, it will use a default dicPath. However, not passing option is not possible, even though this field is the only prop on option. --- src/TokenizerBuilder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TokenizerBuilder.js b/src/TokenizerBuilder.js index 9ef5c6a2..a36a1769 100644 --- a/src/TokenizerBuilder.js +++ b/src/TokenizerBuilder.js @@ -27,7 +27,7 @@ var DictionaryLoader = require("./loader/NodeDictionaryLoader"); * @constructor */ function TokenizerBuilder(option) { - if (option.dicPath == null) { + if (!option || option.dicPath == null) { this.dic_path = "dict/"; } else { this.dic_path = option.dicPath;