Commit 44433f16b467e18dd57b970857e08a5830cad4e1
1 parent
f774442a85
Exists in
master
Updating converter command.
Showing 1 changed file with 7 additions and 3 deletions Side-by-side Diff
volia/masseffect.py
... | ... | @@ -84,10 +84,14 @@ |
84 | 84 | with open(outfile, "w") as of: |
85 | 85 | for key in data: |
86 | 86 | splited = key.replace("\n", "").split(",") |
87 | - of.write(key.replace("\n", "") + " " + ",".join([splited[0], splited[1], splited[3]]) + "\n") | |
87 | + masseffect_id = key.replace("\n", "") | |
88 | + kaldi_id = ",".join([splited[0], splited[1], splited[3]]) | |
89 | + if outtype == "masseffect2kaldi": | |
90 | + of.write(f"{masseffect_id} {kaldi_id}\n") | |
91 | + elif outtype == "kaldi2masseffect": | |
92 | + of.write(f"{kaldi_id} {masseffect_id}\n") | |
88 | 93 | |
89 | 94 | |
90 | - | |
91 | 95 | if __name__ == '__main__': |
92 | 96 | # Main parser |
93 | 97 | parser = argparse.ArgumentParser(description="...") |
... | ... | @@ -124,7 +128,7 @@ |
124 | 128 | type=str, |
125 | 129 | required=True, |
126 | 130 | help="File with ids from which create converter.") |
127 | - parser_converter.add_argument("--outtype", type=str, choices=["complet", "kaldi"]) | |
131 | + parser_converter.add_argument("--outtype", type=str, choices=["kaldi2masseffect", "masseffect2kaldi"]) | |
128 | 132 | parser_converter.add_argument("--outfile", type=str, required=True, help="") |
129 | 133 | parser_converter.set_defaults(which="converter") |
130 | 134 |