01 / Reproducible tutorial
Compare English and Traditional Chinese Markdown without matching the words
Find a missing figure and unpaired Results section using two synthetic documents and a local index map.
Translated headings rarely use the same words. A literal text diff turns every heading into a change, even when the chapter structure is intact. This exercise pairs chapter positions instead, then compares a small set of non-prose objects.
Run the two-document example
With Python 3.10 or newer, run from the repository root. No package installation is required.
python bilingual_map.py examples/source.md examples/zh-Hant.md --output examples/outputThe English fixture has Methods and Results. Its Methods section contains an image target, a link, a Python fence and a standalone equation block. The Traditional Chinese fixture has 方法, the same link, code language and equation count, but intentionally omits the figure and Results. The image target is a symbolic test reference, not a rendered-image download.
1 section pairs; 1 source / 0 target unpaired. No semantic scoring.Inspect the paired chapter
comparison.md pairs source index 1, Methods, with target index 1, 方法. Its review field is images. Source index 2, Results, appears separately as unpaired. The JSON report includes each chapter's starting line and exact object lists, so a reviewer can locate the difference.
Make a deliberate map
Pass --map examples/mapping.json to use the explicit pair [[1,1]]. For a reordered complete translation, a mapping such as [[1,2],[2,1]] pairs the intended chapters. Each index may appear only once. Read the headings before accepting an order-based comparison: a missing middle chapter can shift every later pair.
If your workflow starts with PDFs, KolmoPDF is the related cloud conversion step; it uploads the PDF. This utility only compares the resulting local Markdown. Equal structure says nothing about whether a sentence was translated correctly.