From dc16b8746be778eb9051bd23fcaf9da7af445849 Mon Sep 17 00:00:00 2001 From: Stefan Taubert <23339395+stefantaubert@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:54:10 +0100 Subject: [PATCH] rename from zh-tts to zho-tts --- .gitignore | 2 +- CITATION.cff | 2 +- MANIFEST.in | 4 +-- Pipfile | 2 +- Pipfile.lock | 4 +-- README.md | 20 +++++------ pyproject.toml | 34 +++++++++---------- src/zh_tts/__init__.py | 4 --- src/zho_tts/__init__.py | 4 +++ src/{zh_tts => zho_tts}/cn_tn.py | 0 src/{zh_tts => zho_tts}/globals.py | 2 +- src/{zh_tts => zho_tts}/helper.py | 0 src/{zh_tts => zho_tts}/io.py | 0 src/{zh_tts => zho_tts}/py.typed | 0 src/{zh_tts => zho_tts}/resources.py | 2 +- src/{zh_tts => zho_tts}/synthesizer.py | 6 ++-- src/{zh_tts => zho_tts}/transcriber.py | 6 ++-- src/{zh_tts_cli => zho_tts_cli}/__init__.py | 0 .../argparse_helper.py | 0 src/{zh_tts_cli => zho_tts_cli}/cli.py | 8 ++--- src/{zh_tts_cli => zho_tts_cli}/globals.py | 4 +-- src/{zh_tts_cli => zho_tts_cli}/helper.py | 0 .../logging_configuration.py | 8 ++--- src/{zh_tts_cli => zho_tts_cli}/main.py | 22 ++++++------ src/{zh_tts_cli => zho_tts_cli}/py.typed | 0 .../__init__.py | 0 .../conftest.py | 0 .../main_py/__init__.py | 0 .../main_py/test_synthesize_ipa.py | 8 ++--- .../main_py/test_synthesize_zh.py | 8 ++--- .../__init__.py | 0 .../conftest.py | 0 src/{zh_tts_tests => zho_tts_tests}/helper.py | 2 +- .../synthesizer_py/__init__.py | 0 .../synthesizer_py/test_synthesize.py | 8 ++--- .../transcriber_py/__init__.py | 0 .../transcriber_py/test_get_sentences.py | 2 +- .../transcriber_py/test_remove_unallowed.py | 2 +- .../transcriber_py/test_segment_words.py | 2 +- .../transcriber_py/test_transcribe_to_ipa.py | 4 +-- 40 files changed, 85 insertions(+), 85 deletions(-) delete mode 100644 src/zh_tts/__init__.py create mode 100644 src/zho_tts/__init__.py rename src/{zh_tts => zho_tts}/cn_tn.py (100%) rename src/{zh_tts => zho_tts}/globals.py (53%) rename src/{zh_tts => zho_tts}/helper.py (100%) rename src/{zh_tts => zho_tts}/io.py (100%) rename src/{zh_tts => zho_tts}/py.typed (100%) rename src/{zh_tts => zho_tts}/resources.py (98%) rename src/{zh_tts => zho_tts}/synthesizer.py (96%) rename src/{zh_tts => zho_tts}/transcriber.py (98%) rename src/{zh_tts_cli => zho_tts_cli}/__init__.py (100%) rename src/{zh_tts_cli => zho_tts_cli}/argparse_helper.py (100%) rename src/{zh_tts_cli => zho_tts_cli}/cli.py (95%) rename src/{zh_tts_cli => zho_tts_cli}/globals.py (65%) rename src/{zh_tts_cli => zho_tts_cli}/helper.py (100%) rename src/{zh_tts_cli => zho_tts_cli}/logging_configuration.py (95%) rename src/{zh_tts_cli => zho_tts_cli}/main.py (92%) rename src/{zh_tts_cli => zho_tts_cli}/py.typed (100%) rename src/{zh_tts_cli_tests => zho_tts_cli_tests}/__init__.py (100%) rename src/{zh_tts_cli_tests => zho_tts_cli_tests}/conftest.py (100%) rename src/{zh_tts_cli_tests => zho_tts_cli_tests}/main_py/__init__.py (100%) rename src/{zh_tts_cli_tests => zho_tts_cli_tests}/main_py/test_synthesize_ipa.py (75%) rename src/{zh_tts_cli_tests => zho_tts_cli_tests}/main_py/test_synthesize_zh.py (64%) rename src/{zh_tts_tests => zho_tts_tests}/__init__.py (100%) rename src/{zh_tts_tests => zho_tts_tests}/conftest.py (100%) rename src/{zh_tts_tests => zho_tts_tests}/helper.py (79%) rename src/{zh_tts_tests => zho_tts_tests}/synthesizer_py/__init__.py (100%) rename src/{zh_tts_tests => zho_tts_tests}/synthesizer_py/test_synthesize.py (92%) rename src/{zh_tts_tests => zho_tts_tests}/transcriber_py/__init__.py (100%) rename src/{zh_tts_tests => zho_tts_tests}/transcriber_py/test_get_sentences.py (88%) rename src/{zh_tts_tests => zho_tts_tests}/transcriber_py/test_remove_unallowed.py (69%) rename src/{zh_tts_tests => zho_tts_tests}/transcriber_py/test_segment_words.py (77%) rename src/{zh_tts_tests => zho_tts_tests}/transcriber_py/test_transcribe_to_ipa.py (88%) diff --git a/.gitignore b/.gitignore index 9fcb033..8d970ac 100644 --- a/.gitignore +++ b/.gitignore @@ -109,7 +109,7 @@ venv.bak/ .vscode # custom -# zh_tts/*.tests.py +# zho_tts/*.tests.py output scripts *_debug/ diff --git a/CITATION.cff b/CITATION.cff index 8a08ccf..6b53dba 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,5 +1,5 @@ cff-version: 1.2.0 -title: zh-tts +title: zho-tts abstract: Command-line interface and Python library for synthesizing Chinese texts into speech. message: >- If you use this software, please cite it using the diff --git a/MANIFEST.in b/MANIFEST.in index 9961ca5..d206d21 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ -graft src/zh_tts_tests/ -graft src/zh_tts_cli_tests/ +graft src/zho_tts_tests/ +graft src/zho_tts_cli_tests/ include \ pylintrc \ diff --git a/Pipfile b/Pipfile index 130c69a..c4c669f 100644 --- a/Pipfile +++ b/Pipfile @@ -4,7 +4,7 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] -zh-tts = {editable = true, path = "."} +zho-tts = {editable = true, path = "."} autopep8 = "*" pylint = "*" pycodestyle = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 8aaafbf..8ebbb39 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "689b1a48e57ccca87791ae33646513aed3296804838ee19e9e077eca2294b7f2" + "sha256": "a9277ee83b0cc3c708538c5b61e98158f15ec1dbd2c44e84add2f52cd2a3be4f" }, "pipfile-spec": 6, "requires": { @@ -3528,7 +3528,7 @@ "markers": "python_version >= '3.6'", "version": "==0.0.1" }, - "zh-tts": { + "zho-tts": { "editable": true, "path": "." }, diff --git a/README.md b/README.md index 62d5212..bd2f37a 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# zh-tts +# zho-tts -[![PyPI](https://img.shields.io/pypi/v/zh-tts.svg)](https://pypi.python.org/pypi/zh-tts) -![PyPI](https://img.shields.io/pypi/pyversions/zh-tts.svg) +[![PyPI](https://img.shields.io/pypi/v/zho-tts.svg)](https://pypi.python.org/pypi/zho-tts) +![PyPI](https://img.shields.io/pypi/pyversions/zho-tts.svg) [![pytorch](https://img.shields.io/badge/PyTorch_2.0+-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org/get-started/pytorch-2.0/) [![MIT](https://img.shields.io/github/license/stefantaubert/zh-tts.svg)](https://github.com/stefantaubert/zh-tts/blob/master/LICENSE) -[![PyPI](https://img.shields.io/pypi/wheel/zh-tts.svg)](https://pypi.python.org/pypi/zh-tts/#files) -![PyPI](https://img.shields.io/pypi/implementation/zh-tts.svg) +[![PyPI](https://img.shields.io/pypi/wheel/zho-tts.svg)](https://pypi.python.org/pypi/zho-tts/#files) +![PyPI](https://img.shields.io/pypi/implementation/zho-tts.svg) [![PyPI](https://img.shields.io/github/commits-since/stefantaubert/zh-tts/latest/master.svg)](https://github.com/stefantaubert/zh-tts/compare/v0.0.1...master) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10512789.svg)](https://doi.org/10.5281/zenodo.10512789) @@ -14,20 +14,20 @@ Command-line interface and Python library for synthesizing Chinese texts into sp ## Installation ```sh -pip install zh-tts --user +pip install zho-tts --user ``` ## Example synthesis ```sh -zh-tts synthesize "长江 航务 管理局 和 长江 轮船 总公司 最近 决定 安排 一百三十三 艘 客轮 迎接 长江 干线 春运。" +zho-tts synthesize "长江 航务 管理局 和 长江 轮船 总公司 最近 决定 安排 一百三十三 艘 客轮 迎接 长江 干线 春运。" ``` The output can be listened [here](https://github.com/stefantaubert/zh-tts/raw/master/examples/synthesize.wav). ```sh # Same example using IPA input -zh-tts synthesize-ipa "ʈʂː|a˧˩˧˘|ŋ|tɕ˘|j|a˥˘|ŋ˘|SIL0|x|a˧˥˘|ŋ|u˥˩|SIL0|k|w|a˧˩˧|n|l˘|i˧˩˧|tɕː|y˧˥ˑ|SIL0|x|ɤ˧˥|SIL0|ʈʂː|a˧˩˧˘|ŋ|tɕ˘|j|a˥˘|ŋ|SIL0|l|w|ə˧˥|n|ʈʂʰ˘|w|a˧˥|n|SIL0|ts˘|ʊ˧˩˧|ŋ˘|kː|ʊ˥|ŋ|s|ɹ̩˥ˑ|SIL0|ts|w˘|ei̯˥˩|tɕ|i˥˩˘|n|SIL0|tɕ|ɥ|e˧˥|t|i˥˩|ŋ|SIL3|a˥|n|pʰ|ai̯˧˥|SIL0|i˥ˑ|p|ai̯˧˩˧|s|a˥˘|n|ʂ˘|ɻ̩˧˥|s|a˥|n|SIL0|s˘|ou̯˥|SIL0|kʰˑ|ɤ˥˩|lː|wˑ|ə˧˥ˑ|n|SIL0|i˧˥ː|ŋ|tɕ˘|j˘|e˥|SIL0|ʈʂː|a˧˩˧|ŋ|tɕ˘|j|a˥˘|ŋ|SIL0|k˘|a˥˩|n|ɕ|j˘|ɛ˥˩|n˘|SIL0|ʈʂʰˑ|w˘|ə˥˘|nː|y˥˩ˑ|nː|。" +zho-tts synthesize-ipa "ʈʂː|a˧˩˧˘|ŋ|tɕ˘|j|a˥˘|ŋ˘|SIL0|x|a˧˥˘|ŋ|u˥˩|SIL0|k|w|a˧˩˧|n|l˘|i˧˩˧|tɕː|y˧˥ˑ|SIL0|x|ɤ˧˥|SIL0|ʈʂː|a˧˩˧˘|ŋ|tɕ˘|j|a˥˘|ŋ|SIL0|l|w|ə˧˥|n|ʈʂʰ˘|w|a˧˥|n|SIL0|ts˘|ʊ˧˩˧|ŋ˘|kː|ʊ˥|ŋ|s|ɹ̩˥ˑ|SIL0|ts|w˘|ei̯˥˩|tɕ|i˥˩˘|n|SIL0|tɕ|ɥ|e˧˥|t|i˥˩|ŋ|SIL3|a˥|n|pʰ|ai̯˧˥|SIL0|i˥ˑ|p|ai̯˧˩˧|s|a˥˘|n|ʂ˘|ɻ̩˧˥|s|a˥|n|SIL0|s˘|ou̯˥|SIL0|kʰˑ|ɤ˥˩|lː|wˑ|ə˧˥ˑ|n|SIL0|i˧˥ː|ŋ|tɕ˘|j˘|e˥|SIL0|ʈʂː|a˧˩˧|ŋ|tɕ˘|j|a˥˘|ŋ|SIL0|k˘|a˥˩|n|ɕ|j˘|ɛ˥˩|n˘|SIL0|ʈʂʰˑ|w˘|ə˥˘|nː|y˥˩ˑ|nː|。" ``` The output can be listened [here](https://github.com/stefantaubert/zh-tts/raw/master/examples/synthesize-ipa.wav). @@ -38,7 +38,7 @@ The output can be listened [here](https://github.com/stefantaubert/zh-tts/raw/ma from pathlib import Path from tempfile import gettempdir -from zh_tts import Synthesizer, Transcriber, normalize_audio, save_audio +from zho_tts import Synthesizer, Transcriber, normalize_audio, save_audio text = "长江 航务 管理局 和 长江 轮船 总公司 最近 决定 安排 一百三十三 艘 客轮 迎接 长江 干线 春运。" @@ -99,7 +99,7 @@ Tones and duration markers can be combined, e.g., ə˧˥ː If you want to cite this repo, you can use the BibTeX-entry generated by GitHub (see *About => Cite this repository*). ```txt -Taubert, S. (2024). zh-tts (Version 0.0.1) [Computer software]. https://doi.org/10.5281/zenodo.10512789 +Taubert, S. (2024). zho-tts (Version 0.0.1) [Computer software]. https://doi.org/10.5281/zenodo.10512789 ``` ## Acknowledgments diff --git a/pyproject.toml b/pyproject.toml index 30ae6c1..23c80a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "zh-tts" +name = "zho-tts" version = "0.0.1" description = "Command-line interface and Python library for synthesizing Chinese texts into speech." readme = "README.md" @@ -57,34 +57,34 @@ Homepage = "https://github.com/stefantaubert/zh-tts" Issues = "https://github.com/stefantaubert/zh-tts/issues" [project.scripts] -zh-tts = "zh_tts_cli.cli:run" +zho-tts = "zho_tts_cli.cli:run" [tool.mypy] python_version = "3.11" warn_return_any = true warn_unused_configs = true ignore_missing_imports = true -packages = ["zh_tts", "zh_tts_cli"] +packages = ["zho_tts", "zho_tts_cli"] [tool.setuptools.packages.find] where = ["src"] -include = ["zh_tts", "zh_tts.*", "zh_tts_cli", "zh_tts_cli.*"] +include = ["zho_tts", "zho_tts.*", "zho_tts_cli", "zho_tts_cli.*"] exclude = [ - "zh_tts_tests", - "zh_tts_tests.*", - "zh_tts_cli_tests", - "zh_tts_cli_tests.*", - "zh_tts_debug", - "zh_tts_debug.*", - "zh_tts_cli_debug", - "zh_tts_cli_debug.*", + "zho_tts_tests", + "zho_tts_tests.*", + "zho_tts_cli_tests", + "zho_tts_cli_tests.*", + "zho_tts_debug", + "zho_tts_debug.*", + "zho_tts_cli_debug", + "zho_tts_cli_debug.*", ] namespaces = true [tool.pytest.ini_options] log_cli = true log_level = "DEBUG" -testpaths = ["src/zh_tts_tests", "src/zh_tts_cli_tests"] +testpaths = ["src/zho_tts_tests", "src/zho_tts_cli_tests"] [tool.autopep8] indent-size = 2 @@ -94,7 +94,7 @@ max_line_length = 100 [tool.isort] line_length = 100 indent = 2 -known_first_party = ["zh_tts", "zh_tts_cli"] +known_first_party = ["zho_tts", "zho_tts_cli"] known_third_party = [ "scipy", "numpy", @@ -117,9 +117,9 @@ deps = pytest commands = pytest - zh-tts - zh-tts -v - zh-tts -h + zho-tts + zho-tts -v + zho-tts -h """ [build-system] diff --git a/src/zh_tts/__init__.py b/src/zh_tts/__init__.py deleted file mode 100644 index b1d6fc5..0000000 --- a/src/zh_tts/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from zh_tts.helper import get_default_device, normalize_audio -from zh_tts.io import save_audio -from zh_tts.synthesizer import AVAILABLE_SPEAKERS, Synthesizer -from zh_tts.transcriber import Transcriber diff --git a/src/zho_tts/__init__.py b/src/zho_tts/__init__.py new file mode 100644 index 0000000..f64a3eb --- /dev/null +++ b/src/zho_tts/__init__.py @@ -0,0 +1,4 @@ +from zho_tts.helper import get_default_device, normalize_audio +from zho_tts.io import save_audio +from zho_tts.synthesizer import AVAILABLE_SPEAKERS, Synthesizer +from zho_tts.transcriber import Transcriber diff --git a/src/zh_tts/cn_tn.py b/src/zho_tts/cn_tn.py similarity index 100% rename from src/zh_tts/cn_tn.py rename to src/zho_tts/cn_tn.py diff --git a/src/zh_tts/globals.py b/src/zho_tts/globals.py similarity index 53% rename from src/zh_tts/globals.py rename to src/zho_tts/globals.py index ffcbdf1..a10ab43 100644 --- a/src/zh_tts/globals.py +++ b/src/zho_tts/globals.py @@ -1,4 +1,4 @@ from pathlib import Path -DEFAULT_CONF_DIR = Path.home() / ".zh-tts" +DEFAULT_CONF_DIR = Path.home() / ".zho-tts" DEFAULT_SPEAKER = "C17" diff --git a/src/zh_tts/helper.py b/src/zho_tts/helper.py similarity index 100% rename from src/zh_tts/helper.py rename to src/zho_tts/helper.py diff --git a/src/zh_tts/io.py b/src/zho_tts/io.py similarity index 100% rename from src/zh_tts/io.py rename to src/zho_tts/io.py diff --git a/src/zh_tts/py.typed b/src/zho_tts/py.typed similarity index 100% rename from src/zh_tts/py.typed rename to src/zho_tts/py.typed diff --git a/src/zh_tts/resources.py b/src/zho_tts/resources.py similarity index 98% rename from src/zh_tts/resources.py rename to src/zho_tts/resources.py index 3513b5c..541aca4 100644 --- a/src/zh_tts/resources.py +++ b/src/zho_tts/resources.py @@ -15,7 +15,7 @@ from waveglow import CheckpointWaveglow, convert_glow_files from waveglow_cli import download_pretrained_model -from zh_tts.io import load_obj, save_obj +from zho_tts.io import load_obj, save_obj SPEAKER_DICT_ZIP = "https://zenodo.org/records/7528596/files/pronunciations-narrow-speakers.zip" SPEAKERS_DICT = "https://zenodo.org/records/7528596/files/pronunciations-narrow.dict" diff --git a/src/zh_tts/synthesizer.py b/src/zho_tts/synthesizer.py similarity index 96% rename from src/zh_tts/synthesizer.py rename to src/zho_tts/synthesizer.py index 8684656..27f4003 100644 --- a/src/zh_tts/synthesizer.py +++ b/src/zho_tts/synthesizer.py @@ -11,9 +11,9 @@ from waveglow import Synthesizer as WaveglowSynthesizer from waveglow import try_copy_to -from zh_tts.globals import DEFAULT_CONF_DIR, DEFAULT_SPEAKER -from zh_tts.helper import get_default_device, get_sample_count -from zh_tts.resources import get_taco_model, get_wg_model +from zho_tts.globals import DEFAULT_CONF_DIR, DEFAULT_SPEAKER +from zho_tts.helper import get_default_device, get_sample_count +from zho_tts.resources import get_taco_model, get_wg_model AVAILABLE_SPEAKERS = { "A9", "A33", "A35", "B21", "B34", "A8", "B8", "C8", "D8", "A11", "A12", "A13", "A14", "A19", "A2", "A22", "A23", "A32", "A34", "A36", "A4", "A5", "A6", "A7", "B11", "B12", "B15", "B2", "B22", "B31", "B32", "B33", "B4", "B6", "B7", "C12", "C13", "C14", "C17", "C18", "C19", "C2", "C20", "C21", "C22", "C23", "C31", "C32", "C4", "C6", "C7", "D11", "D12", "D13", "D21", "D31", "D32", "D4", "D6", "D7" diff --git a/src/zh_tts/transcriber.py b/src/zho_tts/transcriber.py similarity index 98% rename from src/zh_tts/transcriber.py rename to src/zho_tts/transcriber.py index 57428bd..15ef4b5 100644 --- a/src/zh_tts/transcriber.py +++ b/src/zho_tts/transcriber.py @@ -18,9 +18,9 @@ from pypinyin import Style from txt_utils import extract_vocabulary_from_text, replace_text, transcribe_text_using_dict -from zh_tts.cn_tn import TextNorm -from zh_tts.globals import DEFAULT_CONF_DIR, DEFAULT_SPEAKER -from zh_tts.resources import get_dicts +from zho_tts.cn_tn import TextNorm +from zho_tts.globals import DEFAULT_CONF_DIR, DEFAULT_SPEAKER +from zho_tts.resources import get_dicts class Transcriber(): diff --git a/src/zh_tts_cli/__init__.py b/src/zho_tts_cli/__init__.py similarity index 100% rename from src/zh_tts_cli/__init__.py rename to src/zho_tts_cli/__init__.py diff --git a/src/zh_tts_cli/argparse_helper.py b/src/zho_tts_cli/argparse_helper.py similarity index 100% rename from src/zh_tts_cli/argparse_helper.py rename to src/zho_tts_cli/argparse_helper.py diff --git a/src/zh_tts_cli/cli.py b/src/zho_tts_cli/cli.py similarity index 95% rename from src/zh_tts_cli/cli.py rename to src/zho_tts_cli/cli.py index aa87ccc..20e4477 100644 --- a/src/zh_tts_cli/cli.py +++ b/src/zho_tts_cli/cli.py @@ -12,12 +12,12 @@ from time import perf_counter from typing import Callable, Generator, List, Tuple, cast -from zh_tts_cli.globals import get_conf_dir, get_work_dir -from zh_tts_cli.logging_configuration import (configure_cli_logger, configure_file_logger, +from zho_tts_cli.globals import get_conf_dir, get_work_dir +from zho_tts_cli.logging_configuration import (configure_cli_logger, configure_file_logger, configure_root_logger, get_file_logger) -from zh_tts_cli.main import init_synthesize_ipa_parser, init_synthesize_zh_parser +from zho_tts_cli.main import init_synthesize_ipa_parser, init_synthesize_zh_parser -__APP_NAME = "zh-tts" +__APP_NAME = "zho-tts" __version__ = version(__APP_NAME) diff --git a/src/zh_tts_cli/globals.py b/src/zho_tts_cli/globals.py similarity index 65% rename from src/zh_tts_cli/globals.py rename to src/zho_tts_cli/globals.py index 528db20..58db04b 100644 --- a/src/zh_tts_cli/globals.py +++ b/src/zho_tts_cli/globals.py @@ -3,10 +3,10 @@ def get_conf_dir() -> Path: - conf_dir = Path.home() / ".zh-tts" + conf_dir = Path.home() / ".zho-tts" return conf_dir def get_work_dir() -> Path: - work_dir = Path(gettempdir()) / "zh-tts" + work_dir = Path(gettempdir()) / "zho-tts" return work_dir diff --git a/src/zh_tts_cli/helper.py b/src/zho_tts_cli/helper.py similarity index 100% rename from src/zh_tts_cli/helper.py rename to src/zho_tts_cli/helper.py diff --git a/src/zh_tts_cli/logging_configuration.py b/src/zho_tts_cli/logging_configuration.py similarity index 95% rename from src/zh_tts_cli/logging_configuration.py rename to src/zho_tts_cli/logging_configuration.py index 6b7ea8f..366b6f4 100644 --- a/src/zh_tts_cli/logging_configuration.py +++ b/src/zho_tts_cli/logging_configuration.py @@ -58,26 +58,26 @@ def set_logfile_formatter(handler: Handler) -> None: def get_cli_logger() -> Logger: - logger = getLogger("zh_tts_cli") + logger = getLogger("zho_tts_cli") return logger def get_file_logger() -> Logger: - flogger = getLogger("file.zh_tts_cli") + flogger = getLogger("file.zho_tts_cli") if flogger.propagate: flogger.propagate = False return flogger def configure_cli_logger(debug: bool = False) -> None: - cli_logger = getLogger("zh_tts_cli") + cli_logger = getLogger("zho_tts_cli") cli_logger.handlers.clear() assert len(cli_logger.handlers) == 0 console_handler = add_console_out(cli_logger) # console_handler.setLevel(logging.DEBUG if debug else logging.INFO) cli_logger.setLevel(logging.DEBUG if debug else logging.INFO) - core_logger = getLogger("zh_tts") + core_logger = getLogger("zho_tts") core_logger.parent = cli_logger file_logger = get_file_logger() diff --git a/src/zh_tts_cli/main.py b/src/zho_tts_cli/main.py similarity index 92% rename from src/zh_tts_cli/main.py rename to src/zho_tts_cli/main.py index 703a2db..a415c6e 100644 --- a/src/zh_tts_cli/main.py +++ b/src/zho_tts_cli/main.py @@ -9,15 +9,15 @@ from pronunciation_dictionary import PronunciationDict, SerializationOptions, save_dict from tacotron_cli import * -from zh_tts import * -from zh_tts.synthesizer import AVAILABLE_SPEAKERS -from zh_tts_cli.argparse_helper import (get_torch_devices, parse_device, - parse_float_between_zero_and_one, - parse_non_empty_or_whitespace, parse_non_negative_float, - parse_non_negative_integer, parse_path, - parse_positive_integer) -from zh_tts_cli.globals import get_conf_dir, get_work_dir -from zh_tts_cli.logging_configuration import get_file_logger +from zho_tts import * +from zho_tts.synthesizer import AVAILABLE_SPEAKERS +from zho_tts_cli.argparse_helper import (get_torch_devices, parse_device, + parse_float_between_zero_and_one, + parse_non_empty_or_whitespace, parse_non_negative_float, + parse_non_negative_integer, parse_path, + parse_positive_integer) +from zho_tts_cli.globals import get_conf_dir, get_work_dir +from zho_tts_cli.logging_configuration import get_file_logger def init_synthesize_zh_parser(parser: ArgumentParser) -> Callable[[Namespace], None]: @@ -85,7 +85,7 @@ def add_device_argument(parser: ArgumentParser) -> None: def synthesize_zh(text: str, speaker: str, max_decoder_steps: int, sigma: float, denoiser_strength: float, seed: int, device: torch.device, silence_sentences: float, silence_paragraphs: float, loglevel: int, skip_normalization: bool, skip_word_segmentation: bool, skip_sentence_segmentation: bool, output: Path): if loglevel == 0: - cli_logger = logging.getLogger("zh_tts_cli") + cli_logger = logging.getLogger("zho_tts_cli") cli_logger.setLevel(logging.WARNING) text_ipa = convert_zh_to_ipa(text, speaker, loglevel, skip_normalization, @@ -96,7 +96,7 @@ def synthesize_zh(text: str, speaker: str, max_decoder_steps: int, sigma: float, def synthesize_ipa(text_ipa: str, speaker: str, max_decoder_steps: int, sigma: float, denoiser_strength: float, seed: int, device: torch.device, silence_sentences: float, silence_paragraphs: float, loglevel: int, output: Path): if loglevel == 0: - cli_logger = logging.getLogger("zh_tts_cli") + cli_logger = logging.getLogger("zho_tts_cli") cli_logger.setLevel(logging.WARNING) if loglevel >= 1: diff --git a/src/zh_tts_cli/py.typed b/src/zho_tts_cli/py.typed similarity index 100% rename from src/zh_tts_cli/py.typed rename to src/zho_tts_cli/py.typed diff --git a/src/zh_tts_cli_tests/__init__.py b/src/zho_tts_cli_tests/__init__.py similarity index 100% rename from src/zh_tts_cli_tests/__init__.py rename to src/zho_tts_cli_tests/__init__.py diff --git a/src/zh_tts_cli_tests/conftest.py b/src/zho_tts_cli_tests/conftest.py similarity index 100% rename from src/zh_tts_cli_tests/conftest.py rename to src/zho_tts_cli_tests/conftest.py diff --git a/src/zh_tts_cli_tests/main_py/__init__.py b/src/zho_tts_cli_tests/main_py/__init__.py similarity index 100% rename from src/zh_tts_cli_tests/main_py/__init__.py rename to src/zho_tts_cli_tests/main_py/__init__.py diff --git a/src/zh_tts_cli_tests/main_py/test_synthesize_ipa.py b/src/zho_tts_cli_tests/main_py/test_synthesize_ipa.py similarity index 75% rename from src/zh_tts_cli_tests/main_py/test_synthesize_ipa.py rename to src/zho_tts_cli_tests/main_py/test_synthesize_ipa.py index 06e054e..116955b 100644 --- a/src/zh_tts_cli_tests/main_py/test_synthesize_ipa.py +++ b/src/zho_tts_cli_tests/main_py/test_synthesize_ipa.py @@ -1,7 +1,7 @@ -from zh_tts.helper import get_default_device -from zh_tts_cli.cli import reset_work_dir -from zh_tts_cli.globals import get_work_dir -from zh_tts_cli.main import synthesize_ipa +from zho_tts.helper import get_default_device +from zho_tts_cli.cli import reset_work_dir +from zho_tts_cli.globals import get_work_dir +from zho_tts_cli.main import synthesize_ipa def test_component(): diff --git a/src/zh_tts_cli_tests/main_py/test_synthesize_zh.py b/src/zho_tts_cli_tests/main_py/test_synthesize_zh.py similarity index 64% rename from src/zh_tts_cli_tests/main_py/test_synthesize_zh.py rename to src/zho_tts_cli_tests/main_py/test_synthesize_zh.py index bd2e9b1..6df87e8 100644 --- a/src/zh_tts_cli_tests/main_py/test_synthesize_zh.py +++ b/src/zho_tts_cli_tests/main_py/test_synthesize_zh.py @@ -1,7 +1,7 @@ -from zh_tts.helper import get_default_device -from zh_tts_cli.cli import reset_work_dir -from zh_tts_cli.globals import get_work_dir -from zh_tts_cli.main import synthesize_zh +from zho_tts.helper import get_default_device +from zho_tts_cli.cli import reset_work_dir +from zho_tts_cli.globals import get_work_dir +from zho_tts_cli.main import synthesize_zh def test_component(): diff --git a/src/zh_tts_tests/__init__.py b/src/zho_tts_tests/__init__.py similarity index 100% rename from src/zh_tts_tests/__init__.py rename to src/zho_tts_tests/__init__.py diff --git a/src/zh_tts_tests/conftest.py b/src/zho_tts_tests/conftest.py similarity index 100% rename from src/zh_tts_tests/conftest.py rename to src/zho_tts_tests/conftest.py diff --git a/src/zh_tts_tests/helper.py b/src/zho_tts_tests/helper.py similarity index 79% rename from src/zh_tts_tests/helper.py rename to src/zho_tts_tests/helper.py index f518570..adff148 100644 --- a/src/zh_tts_tests/helper.py +++ b/src/zho_tts_tests/helper.py @@ -2,7 +2,7 @@ def get_tests_conf_dir() -> Path: - result = Path("/tmp/zh-tts.tests") + result = Path("/tmp/zho-tts.tests") result.mkdir(parents=True, exist_ok=True) return result # return DEFAULT_CONF_DIR diff --git a/src/zh_tts_tests/synthesizer_py/__init__.py b/src/zho_tts_tests/synthesizer_py/__init__.py similarity index 100% rename from src/zh_tts_tests/synthesizer_py/__init__.py rename to src/zho_tts_tests/synthesizer_py/__init__.py diff --git a/src/zh_tts_tests/synthesizer_py/test_synthesize.py b/src/zho_tts_tests/synthesizer_py/test_synthesize.py similarity index 92% rename from src/zh_tts_tests/synthesizer_py/test_synthesize.py rename to src/zho_tts_tests/synthesizer_py/test_synthesize.py index 8136607..c24bac6 100644 --- a/src/zh_tts_tests/synthesizer_py/test_synthesize.py +++ b/src/zho_tts_tests/synthesizer_py/test_synthesize.py @@ -3,10 +3,10 @@ import numpy as np from pytest import raises -from zh_tts.helper import normalize_audio -from zh_tts.io import save_audio -from zh_tts.synthesizer import Synthesizer -from zh_tts_tests.helper import get_tests_conf_dir +from zho_tts.helper import normalize_audio +from zho_tts.io import save_audio +from zho_tts.synthesizer import Synthesizer +from zho_tts_tests.helper import get_tests_conf_dir def test_component(): diff --git a/src/zh_tts_tests/transcriber_py/__init__.py b/src/zho_tts_tests/transcriber_py/__init__.py similarity index 100% rename from src/zh_tts_tests/transcriber_py/__init__.py rename to src/zho_tts_tests/transcriber_py/__init__.py diff --git a/src/zh_tts_tests/transcriber_py/test_get_sentences.py b/src/zho_tts_tests/transcriber_py/test_get_sentences.py similarity index 88% rename from src/zh_tts_tests/transcriber_py/test_get_sentences.py rename to src/zho_tts_tests/transcriber_py/test_get_sentences.py index c1a7838..55ec8ee 100644 --- a/src/zh_tts_tests/transcriber_py/test_get_sentences.py +++ b/src/zho_tts_tests/transcriber_py/test_get_sentences.py @@ -1,4 +1,4 @@ -from zh_tts.transcriber import get_sentences +from zho_tts.transcriber import get_sentences def test_component(): diff --git a/src/zh_tts_tests/transcriber_py/test_remove_unallowed.py b/src/zho_tts_tests/transcriber_py/test_remove_unallowed.py similarity index 69% rename from src/zh_tts_tests/transcriber_py/test_remove_unallowed.py rename to src/zho_tts_tests/transcriber_py/test_remove_unallowed.py index 28de882..95f142f 100644 --- a/src/zh_tts_tests/transcriber_py/test_remove_unallowed.py +++ b/src/zho_tts_tests/transcriber_py/test_remove_unallowed.py @@ -1,4 +1,4 @@ -from zh_tts.transcriber import remove_unallowed +from zho_tts.transcriber import remove_unallowed def test_component(): diff --git a/src/zh_tts_tests/transcriber_py/test_segment_words.py b/src/zho_tts_tests/transcriber_py/test_segment_words.py similarity index 77% rename from src/zh_tts_tests/transcriber_py/test_segment_words.py rename to src/zho_tts_tests/transcriber_py/test_segment_words.py index e280a4e..3cc63aa 100644 --- a/src/zh_tts_tests/transcriber_py/test_segment_words.py +++ b/src/zho_tts_tests/transcriber_py/test_segment_words.py @@ -1,4 +1,4 @@ -from zh_tts.transcriber import segment_words +from zho_tts.transcriber import segment_words def test_component(): diff --git a/src/zh_tts_tests/transcriber_py/test_transcribe_to_ipa.py b/src/zho_tts_tests/transcriber_py/test_transcribe_to_ipa.py similarity index 88% rename from src/zh_tts_tests/transcriber_py/test_transcribe_to_ipa.py rename to src/zho_tts_tests/transcriber_py/test_transcribe_to_ipa.py index a5855ad..89d8c87 100644 --- a/src/zh_tts_tests/transcriber_py/test_transcribe_to_ipa.py +++ b/src/zho_tts_tests/transcriber_py/test_transcribe_to_ipa.py @@ -1,5 +1,5 @@ -from zh_tts.transcriber import Transcriber -from zh_tts_tests.helper import get_tests_conf_dir +from zho_tts.transcriber import Transcriber +from zho_tts_tests.helper import get_tests_conf_dir def test_component():