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

同音词替换功能? #336

Open
Tint0ri opened this issue Dec 22, 2024 · 1 comment
Open

同音词替换功能? #336

Tint0ri opened this issue Dec 22, 2024 · 1 comment

Comments

@Tint0ri
Copy link

Tint0ri commented Dec 22, 2024

运行环境

  • 操作系统(Linux/macOS/Windows):
  • Python 版本:
  • pypinyin 版本:

问题描述

能否增加一个同音词替换功能,例如:

replace_homophones(source, replace, mode)

如果在source字符串中存在符合mode拼音模式匹配的replace字符串的子串,就用replace替换source中的子串并返回
mode模式可以包括:

  1. 拼音相同
  2. 拼音及音调相同
  3. 声母相同
  4. 支持模糊音?
  5. 支持多音字?

感觉这个功能有很多应用场景,比如根据专业词汇表校正通用语音识别后的文本

问题复现步骤

@mozillazg
Copy link
Owner

@Tint0ri 暂时没有这个计划。这个需求看起来似乎可以基于这个项目对外提供的函数进行实现,不强依赖项目本身提供该功能?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants