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:
Phrase-level matching
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
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:
What it does
MoonPinyin combines two layers:
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 pinyinpinyin(text)returns plain pinyin without tone marksinitials(text)returns pinyin initialstrace(text)returns a rule trace for debugging and presentationExample
Project layout
moonpinyin.mbtcore librarymoonpinyin_test.mbtblack-box testscmd/main/main.mbtrunnable demoLICENSEApache-2.0SOURCE.mdsource provenance notedocs/proposal.mdone-page proposal draftCompetition notes
This repository is written to fit the MoonBit Open Source Ecosystem Competition:
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.