frontend: a doubled dash, the Armenian hyphen and the Hebrew maqaf join two words into one

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

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

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

評価

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

調査の方向性

scriptconv/phonemizers/base.py から始めます。_HYPHENS(59 行目)と _DASHES(62 行目)、次に _between_letters(148 行目)を読みます。これは 2 つの文字の間にある単一の記号しか見ないため、ペアの 2 つ目のダッシュはすり抜けます。同じ名前は scriptconv/frontend.py の 77 行目でインポートされています。まず issue の再現スニペットを実行して flewslowly を確認し、変更後に再実行してください — 完了とは、二重のダッシュが単一の em ダッシュのような単語区切りを生み、U+058A と U+05BE が単語をつながなくなり、flew-slowly が変化しないことです。

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

説明

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

Verified against source: the lines and outputs below were read and run on scriptconv origin/dev 03b4c08.

Observed

With the grapheme backend and keep_punctuation=False, a doubled dash, the Armenian hyphen (U+058A) and the Hebrew maqaf (U+05BE) between two words are removed and the two words join. A single em dash gives a word break, and an ASCII hyphen stays.

Lang Text phonemize_flat, joined
en flew--slowly flewslowly
en flew——slowly flewslowly
en flew—slowly flew slowly
en flew-slowly flew-slowly
hy բարի֊լույս (U+058A) բարիլույս
he בית־ספר (U+05BE) ביתספר

The frontend contract has no sentence about dashes, so no rule decides these cases.

Expected

A doubled dash reads as one dash: a word break, as flew—slowly gives. U+058A is the Armenian hyphen and U+05BE the Hebrew maqaf, so each gives what the ASCII hyphen gives in the same place, or a word break. Two words never join into one.

Reproduce

from scriptconv.frontend import FrontendConfig, Stages, TextFrontend
from scriptconv.phonemizers.enums import Phonemizer

fe = TextFrontend(FrontendConfig("en", Phonemizer.GRAPHEMES, keep_punctuation=False,
                                 stages=Stages(diacritize=False, normalize=False)))
print("".join(fe.phonemize_flat("flew--slowly")))

Where

scriptconv/phonemizers/base.py: _HYPHENS (line 59) holds -, U+2010, U+2011, U+FE63 and U+FF0D, and _DASHES (line 62) holds the dashes. U+058A and U+05BE are in neither set. _between_letters (line 148) looks at one mark between two letters, so the second dash of a pair is not between letters. The frontend imports these names at scriptconv/frontend.py line 77.

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

環境構築

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

はじめの一歩

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

TigreGotico/scriptconv のほかの issue

TigreGotico/scriptconv の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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