Thanks to visit codestin.com
Credit goes to github.com

Skip to content

拼音分割算法 #9

@nopdan

Description

@nopdan

在一些输入法里不支持带分隔符的拼音词库,只支持用户短语,比如微软的用户自定义短语,手机 Gboard 的个人词典,
这些编码为连续的拼音串 pinyinfengesuanfa
在以这种格式为源格式时,需要将其转换为带分隔符的编码 pin'yin'fen'ge'suan'fa
现在的方式是忽略原编码,而由程序自动注音,可能导致注音不准,而且效率低下
我们需要一个拼音分割算法,由 连续的拼音串(pinyinfengesuanfa) 和 词组(拼音分割算法) 进行分割。

对于有歧义的拆分,可以通过以下信息解决:

  • 词组的长度(xian 西安,两个字故取 xi'an)
  • 词组中每个字的可能的读音(guangan 广安,[guang'an, guan'gan],广没有guan音,故取1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions