en: G2PEnPhonemizer calls nltk.download each time it is built

Open Beginner friendly
#410 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
80/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Read scriptconv/phonemizers/en.py lines 166-168, where G2PEnPhonemizer.__init__ calls nltk.download twice, then compare with the no-download rule stated at scriptconv/phonemizers/mul.py line 77. Reproduce by constructing G2PEnPhonemizer() twice offline and watching the second build hit the network. Replace the downloads with a lookup of data already on disk, and raise an error naming the install command when a data set is missing. Done means two consecutive builds print no download error and a missing corpus produces that named error.

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

G2PEnPhonemizer.__init__ calls nltk.download('averaged_perceptron_tagger_eng') and nltk.download('cmudict') each time a backend is built (scriptconv/phonemizers/en.py lines 166 to 168). Each call reaches the network or checks the local NLTK data, and offline it prints an error.

Expected

The backend loads the NLTK data that is already on disk, and downloads nothing. The other backends follow the rule in scriptconv/phonemizers/mul.py line 77: "scriptconv never downloads models". A missing data set gives an error that names the command that installs it.

Reproduce

from scriptconv.phonemizers.en import G2PEnPhonemizer

G2PEnPhonemizer()
G2PEnPhonemizer()  # calls nltk.download again

Where

scriptconv/phonemizers/en.py lines 166 to 168.

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.