示例#1
0
 def test_single_sign(self):
     """
     Tests process with two_three as active.
     """
     atf = ATFConverter(two_three=True)
     signs = ["a", "a1", "a2", "a3", "be2", "be3", "bad2", "bad3"]
     target = ["a", "a₁", "a₂", "a₃", "be₂", "be₃", "bad₂", "bad₃"]
     output = atf.process(signs)
     self.assertEqual(output, target)
示例#2
0
 def test_convert_consonant(self):
     """
     Tests convert_consonant.
     """
     atf = ATFConverter()
     signs = ['as,', 'S,ATU', 'tet,', 'T,et', 'sza', 'ASZ']
     target = ['aṣ', 'ṢATU', 'teṭ', 'Ṭet', 'ša', 'AŠ']
     output = [atf._convert_consonant(s) for s in signs]
     self.assertEqual(output, target)
示例#3
0
 def test_get_number_from_sign(self):
     """
     Tests get_number_from_sign.
     """
     atf = ATFConverter()
     signs = ["a", "a1", "be2", "bad3", "buru14"]
     target = [0, 1, 2, 3, 14]
     output = [atf._get_number_from_sign(s)[1] for s in signs]
     self.assertEqual(output, target)
示例#4
0
 def test_accents(self):
     """
     Tests process with two_three as inactive.
     """
     atf = ATFConverter(two_three=False)
     signs = ["a", "a2", "a3", "be2", "bad3", "buru14"]
     target = ["a", "á", "à", "bé", "bàd", "buru₁₄"]
     output = atf.process(signs)
     self.assertEqual(output, target)
示例#5
0
 def test_unknown_token(self):
     """
     Tests process with unrecognizable tokens.
     """
     atf = ATFConverter(two_three=True)
     signs = ["a2", "☉", "be3"]
     target = ["a₂", "☉", "be₃"]
     output = atf.process(signs)
     self.assertEqual(output, target)
示例#6
0
文件: test_stem.py 项目: cltk/cltk
 def test_unknown_token(self):
     """
     Tests process with unrecognizable tokens.
     """
     atf = ATFConverter(two_three=True)
     signs = ["a2", "☉", "be3"]
     target = ["a₂", "☉", "be₃"]
     output = atf.process(signs)
     self.assertEqual(output, target)
示例#7
0
文件: test_stem.py 项目: cltk/cltk
 def test_accents(self):
     """
     Tests process with two_three as inactive.
     """
     atf = ATFConverter(two_three=False)
     signs = ["a", "a2", "a3", "be2", "bad3", "buru14"]
     target = ["a", "á", "à", "bé", "bàd", "buru₁₄"]
     output = atf.process(signs)
     self.assertEqual(output, target)
示例#8
0
文件: test_stem.py 项目: cltk/cltk
 def test_single_sign(self):
     """
     Tests process with two_three as active.
     """
     atf = ATFConverter(two_three=True)
     signs = ["a", "a1", "a2", "a3", "be2", "be3", "bad2", "bad3"]
     target = ["a", "a₁", "a₂", "a₃", "be₂", "be₃", "bad₂", "bad₃"]
     output = atf.process(signs)
     self.assertEqual(output, target)
示例#9
0
文件: test_stem.py 项目: cltk/cltk
 def test_get_number_from_sign(self):
     """
     Tests get_number_from_sign.
     """
     atf = ATFConverter()
     signs = ["a", "a1", "be2", "bad3", "buru14"]
     target = [0, 1, 2, 3, 14]
     output = [atf._get_number_from_sign(s)[1] for s in signs]
     self.assertEqual(output, target)
示例#10
0
文件: test_stem.py 项目: cltk/cltk
 def test_convert_consonant(self):
     """
     Tests convert_consonant.
     """
     atf = ATFConverter()
     signs = ['as,', 'S,ATU', 'tet,', 'T,et', 'sza', 'ASZ']
     target = ['aṣ', 'ṢATU', 'teṭ', 'Ṭet', 'ša', 'AŠ']
     output = [atf._convert_consonant(s) for s in signs]
     self.assertEqual(output, target)