Fix back/forward slash in file path in mailabs formatter (#1938)

* mailabs formatter: back/forward slash in file path fix

* formatters.mailabs() path rework for Windows os

* new formatter added "mailabs_win"

* lint test fix commit

* mailabs_win: removed, mailabs: "/" replaced with os.sep for windows compatibility

* Black small style fix
This commit is contained in:
freezerain 2022-11-01 14:54:40 +03:00 committed by GitHub
parent 5307a2229b
commit fcbfca869f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -106,9 +106,9 @@ def mailabs(root_path, meta_files=None, ignored_speakers=None):
meta_files (str): list of meta files to be used in the training. If None, finds all the csv files
recursively. Defaults to None
"""
speaker_regex = re.compile("by_book/(male|female)/(?P<speaker_name>[^/]+)/")
speaker_regex = re.compile(f"by_book{os.sep}(male|female){os.sep}(?P<speaker_name>[^{os.sep}]+){os.sep}")
if not meta_files:
csv_files = glob(root_path + "/**/metadata.csv", recursive=True)
csv_files = glob(root_path + f"{os.sep}**{os.sep}metadata.csv", recursive=True)
else:
csv_files = meta_files