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
Hi,
are you planning to rewrite js-jieba as a es6 module?
For now I've got
import { Jieba } from 'js-jieba' import { JiebaDict, HMMModel, UserDict, IDF, StopWords } from 'js-jieba/dist/dict.zh-cn'
ReferenceError: module is not defined at eval (/node_modules/js-jieba/dist/dict.zh-cn.js:3:1)
The text was updated successfully, but these errors were encountered:
this is great recommendation~
Sorry, something went wrong.
the workaround solution. you can use
import { createRequire } from 'module' const { JiebaDict, HMMModel, UserDict, IDF, StopWords } = createRequire(import.meta.url)('js-jieba/dist/dict.zh-cn.js')
I need find the solution for how to make es6 module dict.
hihi~ after v1.0.8 you can use es6 module for dict
import { JiebaDict, HMMModel, UserDict, IDF, StopWords } from 'jieba-zh-tw' import createJieba from 'js-jieba' const jieba = createJieba( Buffer.from(JiebaDict), Buffer.from(HMMModel), Buffer.from(UserDict), Buffer.from(IDF), Buffer.from(StopWords) )
No branches or pull requests
Hi,
are you planning to rewrite js-jieba as a es6 module?
For now I've got
import { Jieba } from 'js-jieba'
import { JiebaDict, HMMModel, UserDict, IDF, StopWords } from 'js-jieba/dist/dict.zh-cn'
ReferenceError: module is not defined
at eval (/node_modules/js-jieba/dist/dict.zh-cn.js:3:1)
The text was updated successfully, but these errors were encountered: