Skip to content

Commit 2bfa92a

Browse files
committed
fix(irish): publish root_vowel_count, drop dead is_short_vowel helper
Two CodeRabbit findings that were still valid on the merge candidate: - 02_stress: seg_root_vowel_count was computed but never written to context, so context.root_vowel_count (which the pass header advertises and downstream code reads) was always nil. - 11_unstressed_reduction: a dead local is_short_vowel() referenced an undefined `ustring`; it would have raised if called. run() already inlines the equivalent check. Ported from the benchmarked source repo, so the two copies stay byte-identical. Verified: benchmark unchanged (C 96.92 / M 93.76 / U 94.84), golden 81 pass, transcription e2e 13/13 pass.
1 parent 571d9a5 commit 2bfa92a

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

wiktionary_pron/lua_modules/ga-passes/02_stress.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,10 @@ return {
449449
end
450450

451451
context.is_monosyllabic = seg_is_monosyllabic
452+
-- Publish the root-syllable count alongside is_monosyllabic. The header
453+
-- documents this pass as computing root_vowel_count, and downstream passes
454+
-- read context.root_vowel_count; without this it was always nil.
455+
context.root_vowel_count = seg_root_vowel_count
452456
return tokens
453457
end,
454458
}

wiktionary_pron/lua_modules/ga-passes/11_unstressed_reduction.lua

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,10 @@ local AFTER_C_G_GUARD_EXCEPTIONS = {
4343
local SHORT_VOWELS = { ["a"] = true, ["e"] = true, ["i"] = true, ["o"] = true, ["u"] = true,
4444
["ɛ"] = true, ["ɪ"] = true, ["ɔ"] = true, ["ʊ"] = true }
4545

46-
-- Check if phon is a short vowel (no length mark)
47-
local function is_short_vowel(phon)
48-
if not phon or phon == "" then return false end
49-
-- Phon containing ː is long — never reduce
50-
if phon:match(ustring and "[".. (ustring and ustring.len and "ː" or "ː") .."]") then
51-
return false
52-
end
53-
return SHORT_VOWELS[phon]
54-
end
46+
-- NB: a local is_short_vowel() helper used to live here. It was dead code that
47+
-- referenced an undefined `ustring` (never required in this file), so calling it
48+
-- would have raised. run() inlines the equivalent test as
49+
-- `not phon:find("ː", 1, true) and SHORT_VOWELS[phon]`. Removed 2026-07-31.
5550

5651
return {
5752
name = "unstressed_reduction",

0 commit comments

Comments
 (0)