Skip to content

Add pluggable phonemizer (JA/EN/RU/Raw) and easier entry renaming - #118

Open
MysticILD wants to merge 2 commits into
sdercolin:devfrom
MysticILD:phonemizer-and-better-input
Open

MysticILD wants to merge 2 commits into
sdercolin:devfrom
MysticILD:phonemizer-and-better-input

Conversation

@MysticILD

Copy link
Copy Markdown

Adds a phonemizer to the rename-entry dialog. Supports Raw, Japanese (kana/romaji), English (CMUdict + ONNX fallback + rule-based) and Russian (dict + ONNX + rule-based) via a PhonemizerPlugin registry. The dialog can phonemize input and spread the result across multiple entries (Tab/Shift-Tab). Dictionaries/models under src/jvmMain/resources/g2p/ and onnxruntime are bundled; string keys added for the UI.

@sdercolin

Copy link
Copy Markdown
Owner

Hello, thanks for the PR.
I feel that it might be too much change for this feature. Adding a new customizable layer is a lot. Is it possible to do it via the plugin system?

@MysticILD

MysticILD commented Aug 28, 2026 •

Copy link
Copy Markdown
Author

Hello, thanks for reviewing! Yes, the JA/EN/RU PhonemizerPlugins can be implemented as Type.Macro plugins (resourceFiles = dict.txt/phones.txt, phonemize(text) -> renameMultipleEntries). That would move the dict/rule-based logic out of src/jvmMain/resources/g2p/ into 4 bundled macro plugins (However, OnnxG2pPredictor will be needed to kept in core since GraalJS lacks an ONNX runtime). I also propose keeping the Tab/Shift-Tab navigation in EditEntryNameDialog as it's generally useful for batch renaming entries. If that sounds good I'll rewrite the PR to that approach.

@MysticILD

Copy link
Copy Markdown
Author

Hello, I've updated the PR based on your feedback:

  • Moved phonemizers into the plugin system as Plugin.Type.Phonemizer (under resources/common/plugins/phonemizer/ with standard plugin.json), dropping the extra custom phonemizer folder and loader layer entirely.
  • Kept G2P support generic in core. The .onnx models, dicts, and phone tables now live in their respective plugin folders, and JS can call g2p.predict(modelFile, graphemes, phonemes, word) through an injected bridge so any phonemizer plugin can use ONNX models.
  • Kept the rename dialog workflow (inline toggle, preview chips, multi-entry spreading), and made Tab / Shift-Tab remappable in Preferences > Keymap (KeyAction.EditEntryNameDialogNext/Previous).

Let me know what you think!

@sdercolin

sdercolin commented Sep 10, 2026 •

Copy link
Copy Markdown
Owner

@MysticILD can we use the macro plugin system? I don't think phonemizer is a core feature that a labelling app needs to have. Besides, we support customizable plugins, so we don't really need to commit the plugins into this repo, you can publish your plugins anywhere. I'm saying this because I don't really want to add embedded binaries or resources from other projects with an extra license.

@MysticILD

Copy link
Copy Markdown
Author

Hello, sorry for the late reply!
Yeah, that makes sense. I still think having the ability to quickly cycle through and edit entry names with Tab and Shift+Tab is a nice QoL feature to have in core, though. If that's okay with you, I can strip down this PR so it just adds the next/previous entry shortcuts for the rename dialog.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants