Repository navigation
Conversation
Japanese songs now get a Latin reading too. Kanji have no reading of their own, so the lines go through vibrato with mecab-ipadic and each word's reading becomes romaji: auxiliaries and conjunctive te join their verb, the copula stays its own word, the particles ha/he/wo read wa/e/o, and the kana table covers the extended katakana loanwords use. The dictionary (system.dic.zst, 7.7 MiB) is package data, not part of the binary: the PKGBUILD fetches it with a checksum and installs it under /usr/share/ryotunes/dict/ipadic/, with its license. ryotunesd loads it only for a Japanese song, frees it and trims the heap, and keeps the readings per song. Without the file Japanese gets no reading, as before.
- Romanization never costs the lyrics: a failed or panicking blocking task returns them without a reading, and only the Japanese dictionary path goes to the blocking pool. - A corrupt dictionary is remembered instead of being decompressed for every song; the per-song cache keeps the most recently played songs. - Words join by grammar only, so an interjection's trailing small tsu no longer glues the next word (えっ何 → e nani); da right after a verb is the past tense (迷い込んだ → mayoikonda). - Straight quotes alternate open/close, 々〆〇 are not punctuation, full-width letters read as ASCII, and a syllabic n before a vowel or y is written n'. - Misreadings found in real songs are corrected from context: 如何か/如何に, 前世, 愛して after other text, 手 after a pronoun, and the split compounds 一人/二人 and 苛つく.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #23: Japanese wasn't part of the lyrics romanization yet. It needs a dictionary, and #23 only left the size question open (measurements, reminder after the merge). This adds it with
vibrato+ mecab-ipadic, the option with good readings, while keeping the dictionary out of the binary and out of resident memory.What changed
crates/core/src/romanize/japanese.rs, new): lines are tokenized with vibrato and mecab-ipadic, and each word's dictionary reading is turned into Hepburn-style romaji. Words are joined by grammar the way romaji lyrics are usually written, particles get their spoken reading, and a small curated list corrects IPADIC misreadings seen in real songs.crates/core/src/romanize.rs): Japanese songs, which Feat/lyrics romanization #23 skipped, are now read with the dictionary. Only that path runs on the blocking pool, and if it fails the lyrics are returned without a reading rather than dropped.packaging/arch/PKGBUILD): the dictionary is shipped as package data instead of being embedded in the binary. makepkg fetches it with a checksum, the package installs it under/usr/share/ryotunes/dict/with its license, and nothing is downloaded at runtime.ruzstd.Why
Japanese was the one major script #23 left without a reading, and its kanji can only be read with a dictionary. Local readings keep it offline and provider-independent, like the rest of #23. Provider transliterations (Boidu's TTML, Netease's
romalrc) turned out too patchy to rely on (details).Surface area
lyrics (
ryotunes-coreromanization,get_lyricsin the daemon and the Tauri host), packaging (PKGBUILD source, installed data, license), settings copy (QML, Svelte,fr.json)Validation
./scripts/release-check.shcd ui && pnpm check && pnpm buildcargo fmt --all -- --checkryotunesdwith the dictionary, on Ryoku/Hyprland. Several Japanese songs, a cold start with an empty cache, and the toggle.makepkg --verifysourcedownloads the dictionary and passes the checksum.On Linux
ryotunesonly launches the native client, so the Svelte copy change is untested beyondpnpm check.Regression contracts
ryoku-desktopsafety: the PKGBUILD gains asourceentry and installs two more data/license paths. Package contents and names are otherwise unchanged.Evidence
Size: release
ryotunesd30,374,504 → 30,487,048 bytes (+110 KiB). The package gains the 7.67 MiB dictionary file.Memory,
ryotunesdRSS recorded every 0.1 s for 10 minutes while playing Japanese songs:No growth across songs; the trim returns the memory.
Time: ~335 ms to load and read a song the first time (release build), ~1.5 µs from the cache. That's on the blocking pool, alongside the lyrics fetch itself. With the lyrics open, a cold Japanese track showed no visible delay.
Readings next to Apple Music's own transliteration (from Boidu's TTML) for 夜に駆ける:
Dependencies:
Cargo.lockgainsvibrato 0.5.3withbincode 2.0.1,bincode_derive,crawdad,csv-core,unty,virtueandahash 0.7. None has a security advisory.bincodecarries the informational RUSTSEC-2025-0141 ("unmaintained", no patched version), whichcargo auditreports as a warning, not a failure. vibrato uses it only to read the dictionary.Licenses: vibrato is MIT OR Apache-2.0. mecab-ipadic (NAIST) allows redistribution with its copyright notice, which is installed with the package.
Screenshots:

Follow-up
corrected_reading/merge_compounds, plus a test.