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 3 years ago
parent 249919d684
commit d0f5ed1733

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

@ -38,4 +38,7 @@
;; about handling ambisyllabic words. There's no such thing. ;; about handling ambisyllabic words. There's no such thing.
(testing "pillow" (testing "pillow"
(is (= '(("P" "IH") ("L" "OW")) (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