yanyiwu / gojieba

"结巴"中文分词的Golang版本
MIT License
2.43k stars 303 forks source link

存在词典为1行时,词典无效的情况。 #40

Closed privationel closed 2 weeks ago

privationel commented 6 years ago

代码:

package main

import (
    "fmt"
    "strings"

    "github.com/yanyiwu/gojieba"
)

func main() {
    var s string
    var words []string
    // use_hmm := true
    x := gojieba.NewJieba([]string{"./user.dict.utf8"}...)
    defer x.Free()
    s = "王者荣耀"
    words = x.Tag(s)
    fmt.Println("精确模式:", strings.Join(words, "/"))

}

词典1

王者荣耀 1 n

结果1

精确模式: 王者/x/荣耀/x

词典2

王者荣耀 1 n
云计算 1 n

结果2

精确模式: 王者荣耀/n
privationel commented 6 years ago

存在词性不匹配的问题 词典:

王者荣耀 1 n
云计算 1 n
周杰伦牛逼 1 n

结果:

王者荣耀/n/云计算/x/周杰伦牛逼/n

为何云计算分得结果为x

efflerstegerd commented 1 year ago

礼貌的问一下 这个问题最后是怎么解决的。。。

efflerstegerd commented 1 year ago

这个玩意 好像跟 freq有关系。。。。

github-actions[bot] commented 1 month ago

This issue has not been updated for over 1 year and will be marked as stale. If the issue still exists, please comment or update the issue, otherwise it will be closed after 7 days.

github-actions[bot] commented 2 weeks ago

This issue has been automatically closed due to inactivity. If the issue still exists, please reopen it.