ai-content-maker/.venv/Lib/site-packages/tests/test_distances.py

29 lines
749 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
"""Tests for phoneme distances"""
import unittest
from gruut_ipa import get_closest
class DistancesTestCase(unittest.TestCase):
"""Test cases for phoneme distances"""
def test_vowels(self):
"""Test distances for vowels"""
self.assertEqual(get_closest("p")[0], "t")
def test_consonants(self):
"""Test distances for consonants"""
self.assertEqual(get_closest("ɑ")[0], "ɒ")
self.assertEqual(get_closest("ʝ")[0], "ç")
def test_schwas(self):
"""Test distances for schwas"""
self.assertEqual(get_closest("ɝ")[0], "ɚ")
# -----------------------------------------------------------------------------
if __name__ == "__main__":
unittest.main()