Skip to main content

将汉语转换为“伪日本语”.

Project description

Yukkuri-Mandarin: 油库里普通话

Python Version License: MIT Type Checked

欢迎来到油库里普通话!

油库里普通话(Yukkuri-Mandarin)是一个尝试使用日语的假名(五十音)系统来模拟拼读现代汉语普通话的Python包。

“伪中国语”(偽中国語 / ぎちゅうごくご)是一种基于日语逻辑,但不使用日语中的假名,仅通过汉字来构建句子的语言游戏形式。反过来,仅使用日语假名来拼读普通话发音形成的“句子”或可称之为“伪日本语”。例如“油库里普通话”,使用平假名模拟其音节将是“よう くう りい ぷう とん ふわ”。同时,基于日语高低音模式模拟普通话声调,得到类似“ よ/̅う̅く̅\うりいぷう/̅と̅ん̅ふ̅\わ”的结果。

目前,现有的普通话->假名转换工具大部分仅能实现音节的模拟,而不能还原声调。如果直接利用其输出的结果生成油库里语音将得到类似“棒读”的机械发音。本项目在实现这些功能的基础上,借助语音合成软件的“音声记号”,在输出结果中标记高低音形成声调拟音,使发音更加接近普通话。您可以将转换结果用于AquesTalkPlayer油库里MovieMaker和其他支持音声记号的语音合成工具,以实现中文油库里语音的合成。此外,本项目还提供了拼音数据库管理功能,如果您对某个字的发音不满意,或者某些生僻字缺少发音,您可以方便地自定义发音数据。祝您玩得愉快~

让我们说中文!

目录

安装方法

:star: (推荐) 安装所有可选依赖项:

pip install yukkuri-mandarin[all]

不带可选依赖项:

pip install yukkuri-mandarin

使用可选依赖项 jieba 进行分词可以提高多音字读音准确性:

pip install yukkuri-mandarin[jieba]

如果要使用导出/导入Excel文档的功能,请安装可选依赖项 openpyxl

pip install yukkuri-mandarin[openpyxl]

如果要从本地安装/给无法联网的设备安装/从源码编译安装,请看更多安装方式

使用方法

将中文句子转换为“伪日本语”:

import yukkurimandarin as ym

result = ym.text_convert("油库里普通话。")
print(result)

将汉语拼音句子(以空格分开音节,各音节末尾添加表示声调的数字)转换为“伪日本语”:

import yukkurimandarin as ym

result = ym.pinyin_convert("you2 ku4 li3 pu3 tong1 hua4 .")
print(result)

请查看更详细的使用方法介绍

环境与依赖

  • 支持 Python 3.9 及以上。

  • 必需依赖:

  • 可选依赖:

谨在此向上述包的开发者们表达感谢!

常见问题

Q: 我需要有日语基础吗?

A: 不需要。 但是如果您掌握了假名发音将帮助您调整您不满意的发音数据。

Q: 某个音读错了/缺少某个音/我想修改某个音

A: 请使用拼音数据库管理模块。

Q: 为什么无法生成油库里语音?

A: 请首先检查转换后的假名拟音中是否包含非法字符。具体请查看使用方法介绍

Q: 我遇到了问题/我有一个建议/我需要某个功能

A: 请在issue板块提出,或者给作者发邮件:wubzbz@126.com

更新日志

0.1.0

  • 将CD工作流迁移到PyPI。

附注

  • 作者在制作题图时使用了人工智能辅助。
  • 题图中的人物“雾雨魔理沙”形象的原作者为:©上海アリス幻樂団。
  • yukkurimandarin is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yukkuri_mandarin-1.0.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yukkuri_mandarin-1.0.0-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file yukkuri_mandarin-1.0.0.tar.gz.

File metadata

  • Download URL: yukkuri_mandarin-1.0.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yukkuri_mandarin-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4a0c895184859d97952d1dd3020e75cd42cf81c224b28b749ae12ef282bac0d2
MD5 787c5fa9d82c4b005714362a7793a0dc
BLAKE2b-256 94b983000de6cc0177ac3f54bbfa20c1bcee8a96b6a6d7c908c34516f87465d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for yukkuri_mandarin-1.0.0.tar.gz:

Publisher: CD.yml on wubzbz/Yukkuri-Mandarin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yukkuri_mandarin-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for yukkuri_mandarin-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2caea88718c2f2d06f3ebabd3d3d0c76f7ad716cac2a5d3e609268c2da4aa576
MD5 940dd3c156bf48380b2d9e68c2a356e7
BLAKE2b-256 a27f54029c91173c90346d980f1f30eb5d38768c9c45f40c604a340ba3cee5ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for yukkuri_mandarin-1.0.0-py3-none-any.whl:

Publisher: CD.yml on wubzbz/Yukkuri-Mandarin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page