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

ik无法按照main.dic字典分词,比如创立,已经在词典了,但ik_smart的时候分不出来 #1060

Open
jiankunking opened this issue May 9, 2024 · 1 comment

Comments

@jiankunking
Copy link

Description

ik无法按照main.dic字典分词,比如创立,已经在词典了,但ik_smart的时候分不出来

Steps to reproduce

POST _analyze
{
  "analyzer": "ik_smart",
  "text": "什么时候创立了公司?"
}

分词结果

{
  "tokens" : [
    {
      "token" : "什么时候",
      "start_offset" : 0,
      "end_offset" : 4,
      "type" : "CN_WORD",
      "position" : 0
    },
    {
      "token" : "创",
      "start_offset" : 4,
      "end_offset" : 5,
      "type" : "CN_CHAR",
      "position" : 1
    },
    {
      "token" : "立了",
      "start_offset" : 5,
      "end_offset" : 7,
      "type" : "CN_WORD",
      "position" : 2
    },
    {
      "token" : "公司",
      "start_offset" : 7,
      "end_offset" : 9,
      "type" : "CN_WORD",
      "position" : 3
    }
  ]
}

了 是停止词,不知道为啥会分出 "立了"

Expected behavior

{
  "tokens" : [
    {
      "token" : "什么时候",
      "start_offset" : 0,
      "end_offset" : 4,
      "type" : "CN_WORD",
      "position" : 0
    },
    {
      "token" : "创立",
      "start_offset" : 4,
      "end_offset" : 6,
      "type" : "CN_CHAR",
      "position" : 1
    },
    {
      "token" : "公司",
      "start_offset" : 7,
      "end_offset" : 9,
      "type" : "CN_WORD",
      "position" : 3
    }
  ]
}

Environment

  • Versions: 7.13.4
@kin122
Copy link

kin122 commented Jul 29, 2024

改成ik_max_word模式吧

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

2 participants