lattices.extend(args.lattice_list.readlines())
lattices = [path.strip() for path in lattices]
// Ignore empty lines in the lattice list.
lattices = filter(None, lattices)
// Pick every Ith lattice, if --num-jobs is specified and > 1.
if args.num_jobs < 1:
print("Invalid number of jobs specified:", args.num_jobs)
sys.exit(1)
if (args.job < 0) or (args.job > args.num_jobs - 1):
print("Invalid job specified:", args.job)
sys.exit(1)
lattices = lattices[args.job::args.num_jobs]
file_type = TextFileType("r")
for index, path in enumerate(lattices):
logging.info("Reading word lattice: %s", path)
lattice_file = file_type(path)
lattice = SLFLattice(lattice_file)
if not lattice.utterance_id is None:
utterance_id = lattice.utterance_id
After Change
lattices.extend(args.lattice_list.readlines())
lattices = [path.strip() for path in lattices]
// Ignore empty lines in the lattice list.
lattices = list(filter(None, lattices))
// Pick every Ith lattice, if --num-jobs is specified and > 1.
if args.num_jobs < 1:
print("Invalid number of jobs specified:", args.num_jobs)
sys.exit(1)
if (args.job < 0) or (args.job > args.num_jobs - 1):
print("Invalid job specified:", args.job)
sys.exit(1)
lattices = lattices[args.job::args.num_jobs]
file_type = TextFileType("r")
for index, path in enumerate(lattices):
logging.info("Reading word lattice: %s", path)
lattice_file = file_type(path)
lattice = SLFLattice(lattice_file)
if not lattice.utterance_id is None:
utterance_id = lattice.utterance_id