feat: add native file input cli
MoonAlign is a MoonBit toolkit for bilingual sentence alignment and offline translation evaluation.
It combines two practical pieces of text-engineering work:
The first version keeps the workflow simple:
That makes the tool easy to use with already segmented English data, pre-tokenized Chinese data, or cleaned bilingual corpora.
Run the built-in demo:
moon run --target native cmd/main --demo
Align two text blocks:
moon run cmd/main --src-text "Hello world" --tgt-text "Hello MoonBit"
Add evaluation text:
moon run cmd/main --ref-text "Hello world" --hyp-text "Hello MoonBit"
Read from files:
moon run --target native cmd/main --src data/demo/source.txt --tgt data/demo/target.txt moon run --target native cmd/main --ref data/demo/reference.txt --hyp data/demo/hypothesis.txt
Demo files are also included under data/demo/ for a more realistic walkthrough.
data/demo/
The repository keeps a single visible contributor and includes a concise competition note in docs/competition-notes.md.
docs/competition-notes.md
moonalign.mbt
cmd/main/main.mbt
moonalign_test.mbt
moonalign_wbtest.mbt
This repository is intended to satisfy the competition checklist:
The current implementation favors clarity over heavy dependencies:
This leaves room for future extensions such as:
The implementation is new code written for this repository.
The algorithmic design is inspired by:
No external source code was copied into the repository.
Apache-2.0
一个用 MoonBit 实现的双语句子对齐与离线翻译评测工具,提供长度驱动的 Gale-Church 风格对齐,以及 BLEU、ROUGE、METEOR 风格的文本质量评估,适合语料工程、翻译评测和教学场景。
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802047560号
MoonAlign
MoonAlign is a MoonBit toolkit for bilingual sentence alignment and offline translation evaluation.
It combines two practical pieces of text-engineering work:
What it does
Input format
The first version keeps the workflow simple:
That makes the tool easy to use with already segmented English data, pre-tokenized Chinese data, or cleaned bilingual corpora.
Quick start
Run the built-in demo:
Align two text blocks:
Add evaluation text:
Read from files:
Demo files are also included under
data/demo/for a more realistic walkthrough.Repository Links
Review Notes
The repository keeps a single visible contributor and includes a concise competition note in
docs/competition-notes.md.Project structure
moonalign.mbt: core alignment and evaluation logiccmd/main/main.mbt: thin CLI wiringmoonalign_test.mbt: black-box tests for public behaviormoonalign_wbtest.mbt: white-box tests for internal helpersCompetition notes
This repository is intended to satisfy the competition checklist:
Design notes
The current implementation favors clarity over heavy dependencies:
This leaves room for future extensions such as:
Source note
The implementation is new code written for this repository.
The algorithmic design is inspired by:
No external source code was copied into the repository.
License
Apache-2.0