How to use the pysle.isletool.isVowel function in pysle

To help you get started, we’ve selected a few pysle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timmahrt / pysle / pysle / pronunciationtools.py View on Github external
def _getSyllableNucleus(phoneList):
    '''
    Given the phones in a syllable, retrieves the vowel index
    '''
    cvList = ['V' if isletool.isVowel(phone) else 'C' for phone in phoneList]

    vowelCount = cvList.count('V')
    if vowelCount > 1:
        raise TooManyVowelsInSyllable(phoneList, cvList)

    if vowelCount == 1:
        stressI = cvList.index('V')
    else:
        stressI = None

    return stressI
github timmahrt / pysle / pysle / pronunciationtools.py View on Github external
phone = 'r'

        phone = phone.lower()

        # Unify vowels
        if isletool.isVowel(phone):
            phone = u'V'

        # Only represent the string by its first letter
        try:
            phone = phone[0]
        except IndexError:
            raise NullPhoneError()

        # Unify vowels (reducing the vowel to one char)
        if isletool.isVowel(phone):
            phone = u'V'

        retList.append(phone)

    return retList
github timmahrt / pysle / pysle / pronunciationtools.py View on Github external
'''
    retList = []
    for phone in phoneList:

        # Remove diacritics
        for diacritic in isletool.diacriticList:
            phone = phone.replace(diacritic, u'')

        # Unify rhotics
        if 'r' in phone:
            phone = 'r'

        phone = phone.lower()

        # Unify vowels
        if isletool.isVowel(phone):
            phone = u'V'

        # Only represent the string by its first letter
        try:
            phone = phone[0]
        except IndexError:
            raise NullPhoneError()

        # Unify vowels (reducing the vowel to one char)
        if isletool.isVowel(phone):
            phone = u'V'

        retList.append(phone)

    return retList