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

read matrix from particular line of scp file #16

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update kaldi_io.py
  • Loading branch information
wangkenpu authored Jun 25, 2018
commit 855261fd2c3e37d80c60925a0eaeeb29129b7159
8 changes: 4 additions & 4 deletions kaldi_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ def read_vec_int(file_or_fd):
return ans

# Added by Ke Wang
def read_ali_scp(line):
def read_ali_scp_line(line):
""" Read particular line's answer from scp file.
E.g.
>>> f = open('ali.scp', 'r')
>>> lines = f.readlines()
>>> f.close()
>>> for line in lines:
>>> key, vec = read_ali_ark(line)
>>> key, vec = read_ali_scp_line(line)
"""
key, filename = line.strip().split()
rxfile, offset = filename.rsplit(':', 1)
Expand Down Expand Up @@ -350,14 +350,14 @@ def read_mat_scp(file_or_fd):
if fd is not file_or_fd : fd.close()

# Added by Ke Wang
def read_scp_line(line):
def read_mat_scp_line(line):
""" Read particular line's matrix from scp file.
E.g.
>>> f = open('feat.scp', 'r')
>>> lines = f.readlines()
>>> f.close()
>>> for line in lines:
>>> key, mat = read_scp_line(line)
>>> key, mat = read_mat_scp_line(line)
"""
(key, filename) = line.strip().split()
rxfile, offset = filename.rsplit(':', 1)
Expand Down