You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
685 B
Clojure

(ns com.owoga.phonetics-test
(:require [clojure.test :refer :all]
[com.owoga.phonetics :refer :all]))
(deftest phonetics-test
(testing "word to phones"
(is (= [["HH" "AH0" "L" "OW1"]
["HH" "EH0" "L" "OW1"]]
(get-phones "hello"))))
(testing "phones to word"
(is (= ["hello(1)"]
(get-word ["HH" "EH0" "L" "OW1"])))
(is (= ["hello(1)"]
(get-word ["HH" "EH" "L" "OW"])))
(is (= ["ensure(1)" "insure"]
(get-word ["IH" "N" "SH" "UH" "R"]))))
(testing "phrase to phones"
(is (= [["B" "AA1" "G" "HH" "AA1" "G"]
["B" "AO1" "G" "HH" "AA1" "G"]]
(phrase-phones "bog hog")))))