Fix bug incorrectly syllabifying steel

If there are no vowels left when slurping an onset, then
every remaining phone belongs to the syllable, regardless of any other rule.
main
Eric Ihli 4 years ago
parent 249919d684
commit d0f5ed1733

@ -76,6 +76,10 @@
(recur (subvec phones 1)
(into [(nth phones 0)] syllable))
(not-any? vowel? phones)
(recur (subvec phones 1)
(into [(nth phones 0)] syllable))
:else [syllable phones])))
(comment
@ -128,6 +132,9 @@
(recur phones'' (into [syllable] segments)))))))
(comment
(syllabify ["S" "T" "IY" "L"])
(slurp-rime (reverse ["S" "T" "IY" "L"]))
(slurp-onset-given-rime ["T" "S"] ["IY" "L"])
(phonetics/remove-stress ["AH" "L" "AE" "S" "K" "AH"])
(slurp-onset-given-rime ["L" "AE" "S" "K" "AH"] ["AH"])
(syllabify ["AH0" "L" "AE1" "S" "K" "AH0"])

@ -38,4 +38,7 @@
;; about handling ambisyllabic words. There's no such thing.
(testing "pillow"
(is (= '(("P" "IH") ("L" "OW"))
(syllabify ["P" "IH" "L" "OW"])))))
(syllabify ["P" "IH" "L" "OW"]))))
(testing "steel"
(is (= [["S" "T" "IY1" "L"]]
(syllabify ["S" "T" "IY1" "L"])))))

Loading…
Cancel
Save