Skip to content
New issue

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

同义词替换无法保留原始内容结构,空格、换行丢失 #32

Open
liudonghua123 opened this issue Dec 3, 2018 · 1 comment

Comments

@liudonghua123
Copy link

我想要对一篇文章实现一个简单的同义词替换,但是我使用以下方式,一些空格和换行会丢失

    const text = fs.readFileSync('file.txt', 'utf8');
    const result = segment.doSegment(text, {
      convertSynonym: true,
      simple: true
    })
    console.info(`finish with result: ${result.join('')}`)
@liudonghua123
Copy link
Author

我看了您的一些代码,做了一点点修改,添加了一个raw参数,可以保留空格、换行等信息

#33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant