infinilabs / analysis-pinyin

🛵 This Pinyin Analysis plugin is used to do conversion between Chinese characters and Pinyin.
Apache License 2.0
2.94k stars 547 forks source link

拆成单个汉字有多种发音问题请问该如何解决? #270

Open kely2019 opened 2 years ago

kely2019 commented 2 years ago

看了之前的lssue,没找到解决方案。 如:行结果是xing,导致银行yinhang或者yh查询不到,其他多音字也存在这个问题。 get _analyze { "analyzer": "pinyin", "text":"行" } 我的模板,因为业务需求,我分词成单个汉字了 PUT user_index { "settings": { "index": { "number_of_shards": 1, "number_of_replicas": 1 }, "analysis": { "analyzer": { "pinyin_analyzer": { "tokenizer":"standard", "filter":["my_pinyin"] } }, "filter":{ "my_pinyin":{ "type":"pinyin", "keep_first_letter":true, "keep_separate_first_letter":true, "keep_full_pinyin":true, "keep_original": true, "limit_first_letter_length": 16, "lowercase": true } }

}

}, "mappings": { "dynamic": false, "properties": { "nickName": { "type": "text", "fields": { "pinyin": { "type": "text", "store": false, "analyzer": "pinyin_analyzer" } } } } } } 我相信有很多人遇到这个问题!请问有解决的方法么?谢谢!

aabondv commented 2 years ago

nlp-lang v1.7 银行这个拼音有问题,换成最新版本就好了