Spaces:
Sleeping
Sleeping
Update parse_tsv method
Browse files226 unmodified lines2272282292302302312322331 unmodified line235236237238239240241238239240241242243244245246247248249226 unmodified linesdef parse_tsv(file_path): transcriptions = []
num_to_subtract = float('inf') num_to_subtract = None if os.path.exists(file_path): with open(file_path, "r", encoding="utf-8") as f:1 unmodified line for row in reader: if len(row) == 4: # Ensure it has the expected 4 columns start, end, latin, arabic = row start = float(start)/1000. end = float(end)/1000. num_to_subtract = min(num_to_subtract, start) start = int(start) end = int(end) if num_to_subtract is None: num_to_subtract = start start -= num_to_subtract end -= num_to_subtract
start = float(start)/1000. end = float(end)/1000. transcriptions.append((start, end, latin, arabic)) return transcriptionsapp.py+8-5