We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
根据 README 中示例代码:
nodejieba.loadDict( "./node_modules/nodejieba/dict/jieba.dict.utf8", "./node_modules/nodejieba/dict/hmm_model.utf8", "./node_modules/nodejieba/dict/user.dict.utf8");
模块 A 开发时自身没有问题,但是当第三方模块依赖 A 时就会出现路径问题:
DictTrie.hpp:124 FATAL file ./node_modules/nodejieba/dict/jieba.dict.utf8 open failed.
模块 A 需要写上完整路径才行:
nodejieba.loadDict( __dirname + "/../node_modules/nodejieba/dict/jieba.dict.utf8", __dirname + "/../node_modules/nodejieba/dict/hmm_model.utf8", __dirname + "/../node_modules/nodejieba/dict/user.dict.utf8");
我觉得用户是否可以不关注词典的加载?至少是不需要关注词典的绝对路径。 说实话,路径中出现 node_modules/* 什么的好别扭。
是否可以考虑默认自动加载?
或者是否可以考虑提供几个方法加载不同词典,而不是要模块 A 指定另一个模块中的文件地址。例如:
nodejiba.loadDict(nodejieba.DEFAULT_DICT); // 或者: nodejieba.loadDefaultDict();
The text was updated successfully, but these errors were encountered:
#22 可能也是相关的问题。
Sorry, something went wrong.
这个提议非常赞,在 e6e15d3 里面实现了这个需求。 使用最新的 v0.2.12 版本就可以使用了。
No branches or pull requests
根据 README 中示例代码:
模块 A 开发时自身没有问题,但是当第三方模块依赖 A 时就会出现路径问题:
模块 A 需要写上完整路径才行:
我觉得用户是否可以不关注词典的加载?至少是不需要关注词典的绝对路径。
说实话,路径中出现 node_modules/* 什么的好别扭。
是否可以考虑默认自动加载?
或者是否可以考虑提供几个方法加载不同词典,而不是要模块 A 指定另一个模块中的文件地址。例如:
The text was updated successfully, but these errors were encountered: