def test_syllabicate_prefix( self): # Check wrong syllabification (no prefix functionality) words = [ u'subacuático', u'parapsicólogo', 'postimpresionismo', 'subrepticio' ] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['su', 'ba', u'cuá', 'ti', 'co'], ['pa', 'rap', 'si', u'có', 'lo', 'go'], ['pos', 'tim', 'pre', 'sio', 'nis', 'mo'], ['su', 'brep', 'ti', 'cio']] self.assertSequenceEqual(syllabification, words)
def atonic(word, lang): """Return list of atonic syllable/s from a word.""" syllables = syllabicator.syllabicate(word, lang) atonics = get_atonic(syllables, lang) return atonics
def tonic(word, lang): """Return tonic syllable from a word.""" syllables = syllabicator.syllabicate(word, lang) return get_tonic(syllables, lang)
def test_syllabicate_four_consonants_between_two_voweles(self): words = ['instra'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['ins', 'tra']] self.assertSequenceEqual(syllabification, words)
def test_syllabicate_three_consonants_with_inseparable_group_between_two_voweles( self): words = ['intra'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['in', 'tra']] self.assertSequenceEqual(syllabification, words)
def test_syllabicate_three_consonants_between_two_vowels(self): words = ['insta', 'ashlo'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['ins', 'ta'], ['ash', 'lo']] self.assertSequenceEqual(syllabification, words)
def test_syllabicate_hiato_con_tilde(self): words = [u'leía'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['le', u'í', 'a']] self.assertSequenceEqual(syllabification, words)
def test_syllabicate_triptongo(self): words = ['miauriui'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['miau', 'riui']] self.assertSequenceEqual(syllabification, words)
def test_syllabicate_hiato(self): words = ['peana', 'continuum'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['pe', 'a', 'na'], ['con', 'ti', 'nu', 'um']] self.assertSequenceEqual(syllabification, words)
def test_syllabicate_diptongo(self): words = ['luisnau', u'cigüeña'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['luis', 'nau'], ['ci', u'güe', u'ña']] self.assertSequenceEqual(syllabification, words)
def test_syllabicate_consonant_vowel(self): words = ['pepero'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['pe', 'pe', 'ro']] self.assertSequenceEqual(syllabification, words)
def test_syllabicate_xenism(self): words = ['whiskey', 'amatxu'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['whis', 'key'], ['a', 'ma', 'txu']] self.assertSequenceEqual(syllabification, words)
def test_syllabicate_semivowel(self): words = ['pytyngoyaxtllynstymal'] words = [syllabicator.syllabicate(word, lang) for word in words] syllabification = [['py', 'tyn', 'go', 'yaxt', 'llyns', 'ty', 'mal']] self.assertSequenceEqual(syllabification, words)