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

fixed missing local/join_suffix.py in TEDLIUM v3 (s5_r3) #2741

Merged
merged 1 commit into from
Sep 26, 2018
Merged
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
fixed missing local/join_suffix.py in TEDLIUM v3 (s5_r3)
  • Loading branch information
huangruizhe committed Sep 26, 2018
commit b327231106375a8407277b1563e4a2b881261868
26 changes: 26 additions & 0 deletions egs/tedlium/s5_r3/local/join_suffix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
#
# Copyright 2014 Nickolay V. Shmyrev
# 2016 Johns Hopkins University (author: Daniel Povey)
# Apache 2.0


import sys
from codecs import open

# This script joins together pairs of split-up words like "you 're" -> "you're".
# The TEDLIUM transcripts are normalized in a way that's not traditional for
# speech recognition.

for line in sys.stdin:
items = line.split()
new_items = []
i = 1
while i < len(items):
if i < len(items) - 1 and items[i+1][0] == '\'':
new_items.append(items[i] + items[i+1])
i = i + 1
else:
new_items.append(items[i])
i = i + 1
print(items[0] + ' ' + ' '.join(new_items))