diacritics: `strip_diacritics(text, "en")` raises a message that blames native spelling, and en has no diacritizer

オープン 初心者向け
#441 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

scriptconv/diacritics.py の 496 行目あたりで strip_diacritics を読み、506 行目の raise ValueError の前に overlay-diacritics テーブルがどのように参照されるかを追ってください。次に、en の動作が tests/test_arabic_diacritics_routing.py でカバーされている diacritize と比較してください。strip_diacritics("café", "en") で再現し、その後、overlay マークなしのケースとネイティブ綴りのケースを分けて、en が正しいメッセージを受け取る(または diacritize に合わせて変更なしで通る)ようにしてください。完了の形は、新しい en の動作をアサートするテストと、既存の diacritics テストが引き続き通ることです。

索引モデルが issue の本文から書いたものです。

説明

🤖 Auto-generated by Claude Sonnet 5.5 (claude-sonnet-5-5) via Claude Code — NOT human-reviewed. Verify before acting.

Verified: scriptconv origin/dev 8688aa5. Each output below comes from a run in a fresh Python 3.12 environment with python -I, installed from that checkout.

Observed

strip_diacritics raises ValueError for en with a message that blames the native spelling of English. English has no diacritizer in scriptconv, so there is no overlay mark to strip. The message gives the wrong reason.

ValueError: cannot strip diacritics for lang='en': its diacritics are part of the native orthography, so removal would corrupt the spelling. strip is defined only for overlay diacritics (Arabic/Hebrew vocalization, East-Slavic/Turkic stress).

diacritize("hello", "en") returns hello with no error (tests/test_arabic_diacritics_routing.py, test_two_letter_tags_other_than_ar_need_no_linguatag).

Expected

The message names the real reason: scriptconv has no overlay diacritics for en. The docstring of strip_diacritics says it "Raises ValueError where the diacritics are spelling, as in European Portuguese". English is not such a language. A language with no diacritizer needs its own message, or strip_diacritics returns the text unchanged, as diacritize does.

Reproduce

from scriptconv.diacritics import strip_diacritics

strip_diacritics("café", "en")

Where

scriptconv/diacritics.py, strip_diacritics (line 496): the raise ValueError( at line 506 runs for every tag with no overlay marks, whatever the reason.

主要言語
Python
スター
4
フォーク
1
平均マージ
8時間 20分
マージ済み PR(30日)
128

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TigreGotico/scriptconv のほかの issue

TigreGotico/scriptconv の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。