Skip to content

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

Description

@liudonghua123

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions