Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create check_labels_romance.py #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions check_labels_romance.py
Original file line number Diff line number Diff line change
@@ -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')