forked from mravanelli/pytorch-kaldi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mravanelli#170 from shuttle1987/master
[MRG] Clean up source code formatting
- Loading branch information
Showing
17 changed files
with
6,136 additions
and
4,868 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
#!/usr/bin/env python | ||
|
||
# Apache 2.0 | ||
from __future__ import print_function | ||
|
||
import sys | ||
|
||
vocab=set() | ||
vocab = set() | ||
with open(sys.argv[1]) as vocabfile: | ||
for line in vocabfile: | ||
vocab.add(line.strip()) | ||
|
||
with open(sys.argv[2]) as textfile: | ||
for line in textfile: | ||
print " ".join(map(lambda word: word if word in vocab else '<UNK>', line.strip().split())) | ||
print(" ".join(map(lambda word: word if word in vocab else "<UNK>", line.strip().split()))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.