How to use the pysle.pronunciationtools.NullPronunciationError 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 / praattools.py View on Github external
continue

        subPhoneTier = phoneTier.crop(start, stop, "strict", False)

        # entry = (start, stop, phone)
        phoneList = [entry[2] for entry in subPhoneTier.entryList
                     if entry[2] != '']

        try:
            sylTmp = pronunciationtools.findBestSyllabification(isleDict,
                                                                word,
                                                                phoneList)
        except isletool.WordNotInISLE:
            print("Word ('%s') not is isle -- skipping syllabification" % word)
            continue
        except pronunciationtools.NullPronunciationError:
            print("Word ('%s') has no provided pronunciation" % word)
            continue
        except AssertionError:
            print("Unable to syllabify '%s'" % word)
            continue

        stressI = sylTmp[0]
        stressJ = sylTmp[1]
        syllableList = sylTmp[2]

        if stressI is not None and stressJ is not None:
            syllableList[stressI][stressJ] += u"ˈ"

        i = 0
        for k, syllable in enumerate(syllableList):
github timmahrt / pysle / pysle / pronunciationtools.py View on Github external
def __init__(self, word):
        super(NullPronunciationError, self).__init__()
        self.word = word