Example #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)
Example #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)
Example #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'])
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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'])
Example #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)
Example #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)
Example #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)