infinilabs / analysis-ik

🚌 The IK Analysis plugin integrates Lucene IK analyzer into Elasticsearch and OpenSearch, support customized dictionary.
Apache License 2.0
16.48k stars 3.27k forks source link

IK分词器量词问题 #1063

Closed lngex closed 3 months ago

lngex commented 3 months ago

Description

当数字在两位数以上量词失效

Steps to reproduce

  1. 量词中定义"日"与"強"
  2. 对字符串“法國網球公開賽周日(2日)舉行的男單22強賽”使用智能分词
  3. 结果 [法國, 網球, 公開賽, 周日, 2日, 舉行, 的, 男單, 22, 強, 賽]

可以看到2日被分成了一个词,22强则被分开了

Expected behavior

结果中 22强应该为一个词

Environment

Versions: java8 `

com.github.magese
        <artifactId>ik-analyzer</artifactId>
        <version>8.5.0</version>
    </dependency>`

最新的Core也存在这个问题


lngex commented 3 months ago

补充一个,当量词前缀为两位数且十位为0是也会生效。 比如句子:法國網球公開賽周日(2日)舉行的男單02強賽 分词结果为:[法國, 網球, 公開賽, 周日, 2日, 舉行, 的, 男單, 02強, 賽] 此时结果中出现了“02強”