Permalink
Browse files

Fix Macron Issue in Latin Syllabifier (#611)

* added .cache to gitignore

* fixed macron issue and added unit tests

* add final newline
  • Loading branch information...
TylerKirby authored and kylepjohnson committed Dec 1, 2017
1 parent 6a74449 commit 3d15600cc030a4053f5d66da986f1b08eb29afed
Showing with 18 additions and 1 deletion.
  1. +4 −1 .gitignore
  2. +1 −0 cltk/stem/latin/syllabifier.py
  3. +13 −0 cltk/tests/test_stem.py
View
@@ -58,4 +58,7 @@ _templates
*.ipynb
# VSCode folder
.vscode/*
.vscode/*
# cache
.cache
@@ -27,6 +27,7 @@
'vowels': [
"a", "e", "i", "o", "u",
"á", "é", "í", "ó", "ú",
"ā", "ē", "ī", "ō", "ū",
"æ", "œ",
"ǽ", # no accented œ in unicode?
"y"
View
@@ -201,6 +201,19 @@ def test_latin_syllabifier(self):
syllables = syllabifier.syllabify(word)
target = ['si', 'de', 're']
self.assertEqual(syllables, target)
# tests for macronized words
macronized_word = 'audītū'
macronized_syllables = syllabifier.syllabify(macronized_word)
macronized_target = ['au', '', '']
self.assertEqual(macronized_syllables, macronized_target)
macronized_word2 = 'conjiciō'
macronized_syllables2 = syllabifier.syllabify(macronized_word2)
macronized_target2 = ['con', 'ji', 'ci', 'ō']
self.assertEqual(macronized_syllables2, macronized_target2)
macronized_word3 = 'ā'
macronized_syllables3 = syllabifier.syllabify(macronized_word3)
macronized_target3 = ['ā']
self.assertEqual(macronized_syllables3, macronized_target3)
def test_syllabify(self):
"""Test Indic Syllabifier method"""

0 comments on commit 3d15600

Please sign in to comment.