diff --git a/src/com/owoga/phonetics/syllabify.clj b/src/com/owoga/phonetics/syllabify.clj index e110b40..8ad3145 100644 --- a/src/com/owoga/phonetics/syllabify.clj +++ b/src/com/owoga/phonetics/syllabify.clj @@ -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"]) diff --git a/test/com/owoga/phonetics/syllabify_test.clj b/test/com/owoga/phonetics/syllabify_test.clj index f7c4f28..3101279 100644 --- a/test/com/owoga/phonetics/syllabify_test.clj +++ b/test/com/owoga/phonetics/syllabify_test.clj @@ -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"])))))