目录

MoonPinyin

MoonPinyin is a MoonBit library for adaptive polyphone-to-pinyin conversion.

Public repository: tyytyy68/moonpinyin-osc2026

Competition repos:

It is designed as a small but extensible text-processing core for:

  • Chinese search normalization
  • TTS and speech pipeline preprocessing
  • educational annotation and accessibility tooling
  • pinyin initials, tone-marked pinyin, and rule tracing

What it does

MoonPinyin combines two layers:

  1. Phrase-level matching
  2. Single-character fallback readings

That keeps common polyphones like , , , , , , and readable in practical text.

The current implementation is intentionally compact and readable so it can serve as a competition submission, a demo package, and a base for later extension.

Outputs

  • pinyin_with_tone(text) returns tone-number pinyin
  • pinyin(text) returns plain pinyin without tone marks
  • initials(text) returns pinyin initials
  • trace(text) returns a rule trace for debugging and presentation

Example

let s = "重来一次,重要的是银行行为要看上下文。"
println(pinyin_with_tone(s))
println(pinyin(s))
println(initials(s))
println(trace(s))

Project layout

  • moonpinyin.mbt core library
  • moonpinyin_test.mbt black-box tests
  • cmd/main/main.mbt runnable demo
  • LICENSE Apache-2.0
  • SOURCE.md source provenance note
  • docs/proposal.md one-page proposal draft

Competition notes

This repository is written to fit the MoonBit Open Source Ecosystem Competition:

  • MoonBit is the primary implementation language
  • the repo is open and testable
  • the code is structured as a reusable package rather than a one-off script
  • the README is kept concise and reviewer-friendly
  • the repository keeps a single maintainer identity and avoids mixed authorship
  • the source note explains the hand-curated rule set and intended open-data extension path

Source notes

The phrase rules and single-character defaults are hand-curated for this demo submission. They are not copied from any proprietary dataset. The structure is designed so a larger open dictionary or a trained model can be added later without changing the public API.

关于

MoonPinyin 是一个面向中文文本的智能多音字自适应转换与注音系统。它会结合词组优先匹配和单字回退读音,输出拼音、简码和规则追踪信息,适合用于搜索纠错、语音合成预处理、无障碍辅助阅读和中文文本标注等场景。

54.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号