registry: get_phonemizer(G2PW, model=path) drops the path with no error

Open Beginner friendly
#409 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Read scriptconv/phonemizers/registry.py lines 140-148 first: get_phonemizer inspects which of model, engine or register a backend constructor declares before forwarding arguments. Then compare with G2PWPhonemizer.__init__ at scriptconv/phonemizers/g2pw.py line 232, which only accepts alphabet. Reproduce with the snippet in the issue to confirm the path is silently dropped. Done looks like an explicit error (or a warning) when model is passed to a backend that cannot take it, plus a test covering both the rejecting and the accepting case.

Written by the indexing model from the issue text.

Description

🤖 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

get_phonemizer(G2PW, model=path) drops the path with no error and no warning. G2PWPhonemizer.__init__ (scriptconv/phonemizers/g2pw.py line 232) takes only alphabet. get_phonemizer (scriptconv/phonemizers/registry.py lines 140 to 148) forwards model only to a constructor that declares model, engine or register, and else builds the backend without it.

Expected

A model that the backend cannot take raises an error, or at least logs a warning, so a caller does not get the default model when the caller asked for another one.

Reproduce

from scriptconv.phonemizers.registry import get_phonemizer
from scriptconv.phonemizers.enums import Phonemizer

get_phonemizer(Phonemizer.G2PW, model="/path/to/model.onnx")  # no error; the path is not used

Where

scriptconv/phonemizers/registry.py lines 140 to 148, and scriptconv/phonemizers/g2pw.py line 232.

Dominant language
Python
Stars
4
Forks
1
Avg merge
8h 57m
Merged PRs (30d)
118

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TigreGotico/scriptconv

All issues in TigreGotico/scriptconv

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.