REFACTOR: Syncronized changes with the praatio library

Optional textgrid functionality requires praatio 2.1.0 or
greater.
This commit is contained in:
timmahrt
2015-07-28 14:30:20 -05:00
parent 985d68da6c
commit 393182500e
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ class OptionalFeatureError(ImportError):
return "ERROR: You must have praatio installed to use pysle.praatTools"
try:
import praatio
from praatio import tgio
except ImportError:
raise OptionalFeatureError()
@@ -97,10 +97,10 @@ def syllabifyTextgrid(isleDict, tg, wordTierName, phoneTierName,
tonicEntryList.append((syllableStart, syllableEnd, tonicLabel))
# Create a textgrid with the two syllable-level tiers
syllableTier = praatio.IntervalTier("syllable", syllableEntryList)
tonicTier = praatio.IntervalTier('tonic', tonicEntryList)
syllableTier = tgio.IntervalTier("syllable", syllableEntryList)
tonicTier = tgio.IntervalTier('tonic', tonicEntryList)
syllableTG = praatio.Textgrid()
syllableTG = tgio.Textgrid()
syllableTG.addTier(syllableTier)
syllableTG.addTier(tonicTier)
+2 -2
View File
@@ -12,14 +12,14 @@ This snippet shows you how to use this function.
from os.path import join
import praatio
from praatio import tgio
from pysle import isletool
from pysle import praattools
path = join('.', 'files')
path = "/Users/tmahrt/Dropbox/workspace/pysle/test/files"
tg = praatio.openTextGrid(join(path, "pumpkins.TextGrid"))
tg = tgio.openTextGrid(join(path, "pumpkins.TextGrid"))
# Needs the full path to the file
islevPath = '/Users/tmahrt/Dropbox/workspace/pysle/test/islev2.txt'