Skip to content

Commit

Permalink
Biggest -> Longest
Browse files Browse the repository at this point in the history
  • Loading branch information
Icemole committed Jan 14, 2025
1 parent 48c3400 commit b14492b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mm/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"PlotAlignmentJob",
"AMScoresFromAlignmentLogJob",
"ComputeTimeStampErrorJob",
"GetBiggestAllophoneFileJob",
"GetLongestAllophoneFileJob",
]

import itertools
Expand Down Expand Up @@ -793,18 +793,18 @@ def plot(self):
plt.savefig(plot_file)


class GetBiggestAllophoneFileJob(Job):
class GetLongestAllophoneFileJob(Job):
"""
Obtains the biggest allophone file from all allophone files passed as parameter.
Obtains the longest allophone file from all allophone files passed as parameter.
All allophone files must be a common prefix of the biggest allophone file.
All allophone files must be a common prefix of the longest allophone file.
If this condition isn't met, the job will fail.
"""

def __init__(self, allophone_files: List[tk.Path]):
self.allophone_files = allophone_files

self.out_biggest_allophone_file = self.output_path("allophone_file.txt")
self.out_longest_allophone_file = self.output_path("allophone_file.txt")

self.rqmt = {"cpu": 1, "mem": 1.0, "time": 1.0}

Expand Down Expand Up @@ -834,10 +834,10 @@ def run(self):
for i, line in enumerate(lines):
assert line == lines[highest_num_allo_idx] or line is None, (
f"Expected allophone '{lines[highest_num_allo_idx]}' but found {line}.\n"
f"Allophone file {self.allophone_files[i].get_path()} isn't a subset of the biggest allophone file "
f"Allophone file {self.allophone_files[i].get_path()} isn't a subset of the longest allophone file "
f"{self.allophone_files[highest_num_allo_idx].get_path()}."
)

shutil.copyfile(
self.allophone_files[highest_num_allo_idx].get_path(), self.out_biggest_allophone_file.get_path()
self.allophone_files[highest_num_allo_idx].get_path(), self.out_longest_allophone_file.get_path()
)

0 comments on commit b14492b

Please sign in to comment.