Skip to content

Pinyin.java 中 部分韵母错误 #1644

@iftaken

Description

@iftaken

Describe the bug
Hello, hanlp developers, I found some bugs in the file Pinyin.java

in commit 6b60684

lve3 's yunmu is ve , but lve4 's yunmu is ue .

Source Code:
https://github.com/hankcs/HanLP/blob/1.x/src/main/java/com/hankcs/hanlp/dictionary/py/Pinyin.java#L702
https://github.com/hankcs/HanLP/blob/1.x/src/main/java/com/hankcs/hanlp/dictionary/py/Pinyin.java#L698
https://github.com/hankcs/HanLP/blob/1.x/src/main/java/com/hankcs/hanlp/dictionary/py/Pinyin.java#L841

Code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate the problem.

from pyhanlp import *
from multiprocessing import Pool, cpu_count
Pinyin = JClass("com.hankcs.hanlp.dictionary.py.Pinyin")
# hanlp 测试
text = "驴子,略带,疟疾"       
pinyin_list = HanLP.convertToPinyinList(text)
for p in pinyin_list:
    print(p.__str__(), end=" ")
print()
for pinyin in pinyin_list:
    print("%s," % pinyin.getYunmu(), end=" ")

Describe the current behavior

lv2 zi5 none5 lve4 dai4 none5 nve4 ji2 
u, i, none, ue, ai, none, ue, i, 

Expected behavior

lv2 zi5 none5 lve4 dai4 none5 nve4 ji2 
ve, i, none, ve, ai, none, ve, i, 

System information

  • OS Platform and Distribution : Linux Ubuntu 16.04
  • Python version: 3.6.12
  • HanLP version: 1.8.1

Other info / logs

  • I've completed this form and searched the web for solutions.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions