From 3b2157ee758589e2505e612beabba6a6762ab939 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 24 Jan 2017 20:43:38 +0100 Subject: [PATCH] fix bug with comma's and update to 2.0a --- README.md | 8 ++++---- align.py | 5 ++--- mkrelease.sh | 2 +- settings.praat | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3623287..c6b5f9b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ #Praatalign: an interactive Praat plug-in for performing phonetic forced alignment -###Version 2.0 +###Version 2.0a Praatalign is a plug-in for Praat that can be used to do forced phonetic alignment on speech signals and in particular free speech. Praatalign combines @@ -14,15 +14,15 @@ MAUS\[1,2\]. [Latest manual](https://github.com/dopefishh/praatalign/releases/download/v2.0/book_2.0.pdf) Latest plugin: -[.tar.xz](https://github.com/dopefishh/praatalign/releases/download/v2.0/praatalign_2.0.tar.xz) -[.zip](https://github.com/dopefishh/praatalign/releases/download/v2.0/praatalign_2.0.zip) +[.tar.xz](https://github.com/dopefishh/praatalign/releases/download/v2.0/praatalign_2.0a.tar.xz) +[.zip](https://github.com/dopefishh/praatalign/releases/download/v2.0/praatalign_2.0a.zip) [Older releases](https://github.com/dopefishh/praatalign/releases) ###How to cite ```tex -@misc{praatalign2.0, +@misc{praatalign2.0a, author={Lubbers, Mart and Torreira, Francisco}, title={Praatalign: an interactive Praat plug-in for performing phonetic forced alignment}, howpublished={\url{https://github.com/dopefishh/praatalign}}, diff --git a/align.py b/align.py index ea38d35..1f65f00 100644 --- a/align.py +++ b/align.py @@ -37,7 +37,6 @@ def _force(phonetizer, utterance, starttime, duration, wavefile, """ Force aligns the given utterance, all parameters are passed by kwarg """ - print(utterance) logging.info('Starting to align: {}'.format(code)) logging.info('Removing old files') for suffix in ['dot', 'htk', 'nis', 'rec', 'slf', 'status']: @@ -124,7 +123,7 @@ def _force(phonetizer, utterance, starttime, duration, wavefile, # Open the output file out = 'praat_temp_out' - ortwords = utterance.split(' ') + ortwords = utterance.replace(",", "").split(' ') with open(out, code) as fileio: logging.info('Output file selected') with open('{}.rec'.format(basename), 'r') as f: @@ -148,7 +147,7 @@ def _force(phonetizer, utterance, starttime, duration, wavefile, fileio.write('{:f},{:f},{},c\n'.format( word[0], start, canonical.pop(0))) fileio.write('{:f},{:f},{},o\n'.format( - word[0], start, ortwords.pop(0))) + word[0], start, ortwords.pop(0).encode('utf-8'))) word = (end, '') # Else add the current phone to the current word else: diff --git a/mkrelease.sh b/mkrelease.sh index 1b843ea..e371662 100644 --- a/mkrelease.sh +++ b/mkrelease.sh @@ -1,5 +1,5 @@ #!/bin/bash -VERSION=2.0 +VERSION=2.0a zip -9rv praatalign_$VERSION.zip *.{praat,py,md} {install,par,LICENCE}* tar -cvf praatalign_$VERSION.tar *.{praat,py,md} {install,par,LICENCE}* xz -ve praatalign_$VERSION.tar diff --git a/settings.praat b/settings.praat index bc280bd..a707294 100644 --- a/settings.praat +++ b/settings.praat @@ -83,7 +83,7 @@ endif # Spawn the option window for the user beginPause: "Basic options" - comment: "Praatalign version 2.0" + comment: "Praatalign version 2.0a" comment: "Name for the output tier(may already exist)" sentence: "new", new$