From d28e8145e6366e96a17df129015bb86c2b50d8d0 Mon Sep 17 00:00:00 2001 From: subpum <91445907+suburbanpuma@users.noreply.github.com> Date: Sat, 5 Mar 2022 16:12:50 -0300 Subject: [PATCH] Create check_labels_romance.py Additional file for checking DynaVox Romance HED labels. --- check_labels_romance.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 check_labels_romance.py diff --git a/check_labels_romance.py b/check_labels_romance.py new file mode 100644 index 0000000..a5c8e54 --- /dev/null +++ b/check_labels_romance.py @@ -0,0 +1,19 @@ +import glob +import os +phones = ['pau', 'br', 'exh', 'axh', 'cgh', 'vf', 'a', 'e', 'i', 'o', 'u', 'aa', 'ao', 'au', 'oa', 'ax', 'eh', 'uu', 'uo', 'ui', 'eu', 'oe', 'er', 'ih', 'uh', 'an', 'en', 'in', 'on', 'un', 'rn', 'p', 'b', 'bv', 'ts', 't', 'd', 'dd', 'dj', 'dg', 'jh', 'tg', 'c', 'k', 'g', 'gh', 's', 'z', 'zz', 'tz', 'dz', 'ch', 'sh', 'zh', 'f', 'v', 'h', 'x', 'th', 'dh', 'n', 'nj', 'ny', 'gn', 'm', 'ng', 'w', 'j', 'y', 'll', 'gl', 'lh', 'r', 'rr', 'rh', 'rx', 'rw', 'l', 'kx', 'q'] + +for file in glob.glob('*.lab'): + with open(file) as f: + i = f.readline() + line_count = 1 + while i: + p = i.strip().split() + i = f.readline() + if p[-1] not in phones: + print(f'In {file}: {p[-1]} is not in the list. At line {line_count}') + + if int(p[0]) == int(p[1]): + print(f'In {file}: {p[-1]} has the same start and end. At line {line_count}') + line_count += 1 + +os.system('pause')