Skip to content

Commit

Permalink
Merge pull request #148 from TylerKirby/prosody-fix
Browse files Browse the repository at this point in the history
Added diphthong to Greek prosody scanner, added anceps support for Latin scanner
  • Loading branch information
kylepjohnson committed Feb 29, 2016
2 parents b4763ed + 34cd5ee commit 3d8856a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cltk/prosody/greek/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self):
self.doub_cons = ['ξ', 'ζ', 'ψ']
self.long_vowels = ['η', 'ω', 'ῖ', 'ᾶ', 'ῦ']
self.diphthongs = ['αι', 'αῖ', 'ευ', 'εῦ', 'αυ', 'αῦ', 'οι', 'οῖ',
'ου', 'οῦ', 'ει', 'εῖ', 'υι', 'υῖ']
'ου', 'οῦ', 'ει', 'εῖ', 'υι', 'υῖ', 'ηῦ']
self.stops = ['π', 'τ', 'κ', 'β', 'δ', 'γ']
self.liquids = ['ρ', 'λ']
self.punc = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
Expand Down
2 changes: 2 additions & 0 deletions cltk/prosody/latin/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ def _scansion(self, sentence_syllables):
scanned_sent.append('¯')
else:
scanned_sent.append('˘')
del scanned_sent[-1]
scanned_sent.append('x')
scanned_text.append(''.join(scanned_sent))
return scanned_text

Expand Down
2 changes: 1 addition & 1 deletion cltk/tests/test_prosody.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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, ['¯˘¯˘¯¯˘˘˘¯˘˘˘¯˘¯¯¯', '¯˘¯˘¯˘˘¯˘˘¯¯¯¯˘'])
self.assertEqual(meter, ['¯˘¯˘¯¯˘˘˘¯˘˘˘¯˘¯¯x', '¯˘¯˘¯˘˘¯˘˘¯¯¯¯x'])

def test_long_by_nature_latin(self):
"""Test Latin prosody scanner's `_long_by_nature` method."""
Expand Down

0 comments on commit 3d8856a

Please sign in to comment.