Skip to content

Commit

Permalink
Small change to avoid hardcoded change in make_kn_lm.py
Browse files Browse the repository at this point in the history
Signed-off-by: Xinyuan Li <[email protected]>
  • Loading branch information
Xinyuan Li committed Jan 25, 2024
1 parent eec5941 commit 6ba1e63
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion icefall/shared/make_kn_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ def add_raw_counts_from_file(self, filename):
with open(filename, encoding=default_encoding) as fp:
for line in fp:
line = line.strip(strip_chars)
self.add_raw_counts_from_line(line.split()[0])
if self.ngram_order == 1:
self.add_raw_counts_from_line(line.split()[0])
else:
self.add_raw_counts_from_line(line)
lines_processed += 1
if lines_processed == 0 or args.verbose > 0:
print(
Expand Down

0 comments on commit 6ba1e63

Please sign in to comment.