示例#1
0
 def test_syllabify_latin(self):
     """Test syllabifier for Latin scanner code."""
     scansion = ScansionLatin()
     syllables = [['quō', 'usque', 'tandem', 'abūtēre', ',', 'catilīna', ',', 'patientiā', 'nostrā.'], ['quam', 'diū', 'etiam', 'furor', 'iste', 'tuus', 'nōs', 'ēlūdet.']]
     elided_target = [[[], ['quōu', 'sque'], ['ta'], ['ndema', 'bū', 'tē', 're'], ['ca', 'ti', 'lī', 'na'], ['pa', 'ti', 'e', 'nti', 'ā'], ['no', 'strā']], [['quam'], ['di'], ['ūe', 'ti', 'am'], ['fu', 'ror'], ['i', 'ste'], ['tu', 'us'], ['nōs'], ['ē', 'lū', 'det']]]
     elided = scansion.syllabify(syllables)
     self.assertEqual(elided, elided_target)
示例#2
0
 def test_syllabify_latin(self):
     """Test syllabifier for Latin scanner code."""
     scansion = ScansionLatin()
     syllables = [['quō', 'usque', 'tandem', 'abūtēre', ',', 'catilīna', ',', 'patientiā', 'nostrā.'], ['quam', 'diū', 'etiam', 'furor', 'iste', 'tuus', 'nōs', 'ēlūdet.']]
     elided_target = [[[], ['quōu', 'sque'], ['ta'], ['ndema', 'bū', 'tē', 're'], ['ca', 'ti', 'lī', 'na'], ['pa', 'ti', 'e', 'nti', 'ā'], ['no', 'strā']], [['quam'], ['di'], ['ūe', 'ti', 'am'], ['fu', 'ror'], ['i', 'ste'], ['tu', 'us'], ['nōs'], ['ē', 'lū', 'det']]]
     elided = scansion.syllabify(syllables)
     self.assertEqual(elided, elided_target)
示例#3
0
 def test_scanner_latin(self):
     """Test Latin prosody scanner."""
     scan = ScansionLatin()
     meter = scan.scan_text(
         'quō usque tandem abūtēre, Catilīna, patientiā nostrā. quam diū etiam furor iste tuus nōs ēlūdet.'
     )
     self.assertEqual(meter, ['¯˘¯˘¯¯˘˘˘¯˘˘˘¯˘¯¯x', '¯˘¯˘¯˘˘¯˘˘¯¯¯¯x'])
示例#4
0
 def test_long_by_position_latin(self):
     """Test Latin prosody scanner's `_long_by_position` method."""
     scansion = ScansionLatin()
     long_by_pos = scansion._long_by_position('am', [
         'quam', 'di', 'ūe', 'ti', 'am', 'fu', 'ror', 'i', 'ste', 'tu',
         'us', 'nōs', 'ē', 'lū', 'det'
     ])
     self.assertTrue(long_by_pos)
示例#5
0
 def test_elidable_end_latin(self):
     """Test elidable word endings for Latin."""
     scansion = ScansionLatin()
     elidable_end = scansion._elidable_end(['fi', 'li', 'ae'])
     self.assertTrue(elidable_end)
示例#6
0
 def test_elidable_begin_latin(self):
     """Test elidable word beginnings for Latin."""
     scansion = ScansionLatin()
     elidable_begin = scansion._elidable_begin(['hae', 're', 'na'])
     self.assertTrue(elidable_begin)
示例#7
0
 def test_long_by_position_latin(self):
     """Test Latin prosody scanner's `_long_by_position` method."""
     scansion = ScansionLatin()
     long_by_pos = scansion._long_by_position('am', ['quam', 'di', 'ūe', 'ti', 'am', 'fu', 'ror', 'i', 'ste', 'tu', 'us', 'nōs', 'ē', 'lū', 'det'])
     self.assertTrue(long_by_pos)
示例#8
0
 def test_long_by_nature_latin(self):
     """Test Latin prosody scanner's `_long_by_nature` method."""
     scansion = ScansionLatin()
     long_by_nat = scansion._long_by_nature('aet')
     self.assertTrue(long_by_nat)
示例#9
0
 def test_scanner_latin(self):
     """Test Latin prosody scanner."""
     scan = ScansionLatin()
     meter = scan.scan_text('quō usque tandem abūtēre, Catilīna, patientiā nostrā. quam diū etiam furor iste tuus nōs ēlūdet.')
     self.assertEqual(meter, ['¯˘¯˘¯¯˘˘˘¯˘˘˘¯˘¯¯x', '¯˘¯˘¯˘˘¯˘˘¯¯¯¯x'])
示例#10
0
 def test_elidable_end_latin(self):
     """Test elidable word endings for Latin."""
     scansion = ScansionLatin()
     elidable_end = scansion._elidable_end(['fi', 'li', 'ae'])
     self.assertTrue(elidable_end)
示例#11
0
 def test_elidable_begin_latin(self):
     """Test elidable word beginnings for Latin."""
     scansion = ScansionLatin()
     elidable_begin = scansion._elidable_begin(['hae', 're', 'na'])
     self.assertTrue(elidable_begin)
示例#12
0
 def test_long_by_nature_latin(self):
     """Test Latin prosody scanner's `_long_by_nature` method."""
     scansion = ScansionLatin()
     long_by_nat = scansion._long_by_nature('aet')
     self.assertTrue(long_by_nat)