Exemple #1
0
    def test_word2roman(self):
        rhyme = Rhyme("しずおか")
        self.assertEqual(rhyme.roman(), "shizuoka")

        rhyme = Rhyme("シズオカ")
        self.assertEqual(rhyme.roman(), "shizuoka")

        rhyme = Rhyme("静岡")
        self.assertEqual(rhyme.roman(), "shizuoka")
Exemple #2
0
    def test_vowel(self):
        rhyme = Rhyme("静岡")
        self.assertEqual(rhyme.vowel(), "iuoa")

        rhyme = Rhyme("ありがとう")
        self.assertEqual(rhyme.vowel(), "aiaou")

        rhyme = Rhyme("パイソン")
        self.assertEqual(rhyme.vowel(), "aion")
Exemple #3
0
    def test_rhyme(self):
        rhyme = Rhyme("ありがとう")
        self.assertEqual(rhyme.rhyme(), "オリゴ糖")

        rhyme = Rhyme("ありがとう", len("ありがとう"))
        self.assertEqual(rhyme.rhyme(), "大麻草")

        rhyme = Rhyme("パイソン")
        self.assertEqual(rhyme.rhyme(), "厚切りジェイソン")

        rhyme = Rhyme("パイソン", len("パイソン"))
        self.assertEqual(rhyme.rhyme(), "")
Exemple #4
0
def rhyme(word):
    return str(Rhyme(word))