Skip to content

Fix Wade-Giles romanization of pinyin "tie" (t'oeh -> t'ieh) - #385

Open
selimfedakar wants to merge 1 commit into
mozillazg:developfrom
selimfedakar:fix/wadegiles-tie-ieh
Open

selimfedakar wants to merge 1 commit into
mozillazg:developfrom
selimfedakar:fix/wadegiles-tie-ieh

Conversation

@selimfedakar

Copy link
Copy Markdown

Problem

The Wade-Giles romanization of the pinyin syllable tie is wrong.

>>> from pypinyin import lazy_pinyin, Style
>>> lazy_pinyin('铁', style=Style.WADEGILES)
["t'oeh"]   # before (wrong)
["t'ieh"]   # after (correct)

t'oeh is not a valid Wade-Giles syllable — oeh is not a Wade-Giles final.
The same affects every character read tie: 铁, 贴, 帖, 餮, etc.

Root cause

pypinyin/style/wadegiles.py contains a whole-syllable conversion table
(_convert_table) that is matched before the initial/final decomposition
fallback, so a single wrong entry silently overrides the correct result.

The entry for tie was a typo:

['tie', "t'oeh"],   # wrong

tie was the lone -ie outlier in the table. Every other pinyin -ie
syllable maps to a Wade-Giles -ieh final:

pinyin Wade-Giles
ie ieh
jie chieh
qie ch'ieh
xie hsieh
bie pieh
pie p'ieh
mie mieh
die tieh
nie nieh
lie lieh
tie t'ieh

die (its unaspirated partner) already maps to tieh, so the aspirated
tie must be t'ieh. The -ieh final is consistent across the whole family.

Fix

Correct the single table entry:

['tie', "t'ieh"],

This is a bug in the romanization table in this repository (the mapping
logic), not a per-character pinyin-data error — the input pinyin tie is
correct; only the Wade-Giles target was mistyped.

Test added

Added two regression cases to the existing parametrized test_wadegiles
in tests/test_pinyin.py:

['铁', ["t'ieh"]],
['贴', ["t'ieh"]],

With the typo reverted these two cases fail (["t'oeh"] != ["t'ieh"]);
with the fix they pass.

Suite

pytest tests/test_pinyin.py — 252 passed, 2 skipped. The full
wadegiles selection (60 cases) is green.


修正威妥瑪拼音 tie 的轉寫:t'oeh → t'ieh。

Typo in the whole-syllable pinyin->Wade-Giles table: tie mapped to t'oeh.
Correct Wade-Giles is t'ieh (final ie -> ieh, consistent with die -> tieh
and every other -ie syllable in the table); affects 铁/贴/帖 etc.
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e24b407b-5027-446d-982e-3596a3d092d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant