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

Aperta Adatta ai principianti
#412 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Inizia in scriptconv/phonemizers/base.py: leggi _HYPHENS (riga 59) e _DASHES (riga 62), poi _between_letters (riga 148), che vede solo un singolo segno tra due lettere, quindi il secondo trattino di una coppia gli sfugge; gli stessi nomi sono importati in scriptconv/frontend.py riga 77. Esegui prima lo snippet di repro dell'issue per vedere flewslowly, poi rieseguilo dopo la modifica — fatto significa che un trattino doppio produce un'interruzione di parola come un singolo em dash, U+058A e U+05BE smettono di unire parole, e flew-slowly resta invariato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🤖 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.

Lingua principale
Python
Stelle
4
Fork
1
Merge medio
8h 57m
PR unite (30g)
118

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TigreGotico/scriptconv

Tutte le issue di TigreGotico/scriptconv

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.