Skip to content

Commit 70db128

Browse files
committed
Fix logged OOV report paths
1 parent 1f93f2c commit 70db128

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

montreal_forced_aligner/validation/corpus_validator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ def analyze_oovs(self, output_directory: Path = None) -> None:
140140
if output_directory is None:
141141
output_directory = self.output_directory
142142
os.makedirs(output_directory, exist_ok=True)
143-
oov_path = os.path.join(output_directory, "oovs_found.txt")
143+
oov_paths = [
144+
os.path.join(output_directory, f"oovs_found_{base_name}.txt")
145+
for base_name in self.dictionary_base_names.values()
146+
]
144147
utterance_oov_path = os.path.join(output_directory, "utterance_oovs.txt")
145148

146149
total_instances = 0
@@ -172,7 +175,7 @@ def analyze_oovs(self, output_directory: Path = None) -> None:
172175
logger.warning(f"{len(self.oovs_found)} OOV word types")
173176
logger.warning(f"{total_instances}total OOV tokens")
174177
logger.warning(
175-
f"For a full list of the word types, please see: {oov_path}. "
178+
f"For a full list of the word types, please see: {', '.join(oov_paths)}. "
176179
f"For a by-utterance breakdown of missing words, see: {utterance_oov_path}"
177180
)
178181
else:

tests/test_commandline_find_oovs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def test_validate_corpus(
3939
assert oovs_path.exists()
4040
assert oov_counts_path.exists()
4141
assert utterance_oovs_path.exists()
42+
assert str(oovs_path) in result.stdout
4243

4344
oovs_found = set(oovs_path.read_text(encoding="utf8").splitlines())
4445
utterance_oov_lines = utterance_oovs_path.read_text(encoding="utf8").splitlines()

0 commit comments

Comments
 (0)