From f79a67138f7cc27b99f31b765b44833487c14a4c Mon Sep 17 00:00:00 2001 From: tuna2134 Date: Wed, 25 Sep 2024 12:53:23 +0000 Subject: [PATCH] fix stop to use re --- Cargo.lock | 4 ++-- sbv2_api/Cargo.toml | 4 ++-- sbv2_bindings/Cargo.toml | 2 +- sbv2_core/Cargo.toml | 2 +- sbv2_core/src/jtalk.rs | 6 +----- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f237df..3358e73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1819,7 +1819,7 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "sbv2_api" -version = "0.1.0" +version = "0.2.0-alpha" dependencies = [ "anyhow", "axum", @@ -1843,7 +1843,7 @@ dependencies = [ [[package]] name = "sbv2_core" -version = "0.1.4" +version = "0.2.0-alpha" dependencies = [ "anyhow", "dotenvy", diff --git a/sbv2_api/Cargo.toml b/sbv2_api/Cargo.toml index 75da727..a49e149 100644 --- a/sbv2_api/Cargo.toml +++ b/sbv2_api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sbv2_api" -version = "0.1.0" +version = "0.2.0-alpha" edition = "2021" [dependencies] @@ -9,7 +9,7 @@ axum = "0.7.5" dotenvy.workspace = true env_logger.workspace = true log = "0.4.22" -sbv2_core = { version = "0.1.3", path = "../sbv2_core" } +sbv2_core = { version = "0.2.0-alpha", path = "../sbv2_core" } serde = { version = "1.0.210", features = ["derive"] } tokio = { version = "1.40.0", features = ["full"] } diff --git a/sbv2_bindings/Cargo.toml b/sbv2_bindings/Cargo.toml index 1d9cfc6..b55f421 100644 --- a/sbv2_bindings/Cargo.toml +++ b/sbv2_bindings/Cargo.toml @@ -12,4 +12,4 @@ crate-type = ["cdylib"] anyhow.workspace = true ndarray.workspace = true pyo3 = { version = "0.22.0", features = ["anyhow"] } -sbv2_core = { version = "0.1.4", path = "../sbv2_core" } +sbv2_core = { version = "0.2.0-alpha", path = "../sbv2_core" } diff --git a/sbv2_core/Cargo.toml b/sbv2_core/Cargo.toml index 4c1a38f..c5f1608 100644 --- a/sbv2_core/Cargo.toml +++ b/sbv2_core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sbv2_core" description = "Style-Bert-VITSの推論ライブラリ" -version = "0.1.4" +version = "0.2.0-alpha" edition = "2021" license = "MIT" readme = "../README.md" diff --git a/sbv2_core/src/jtalk.rs b/sbv2_core/src/jtalk.rs index 662980c..cb2692e 100644 --- a/sbv2_core/src/jtalk.rs +++ b/sbv2_core/src/jtalk.rs @@ -351,11 +351,7 @@ impl JTalkProcess { let mut phones: Vec = Vec::new(); for (i, label) in labels.iter().enumerate() { - let mut p3 = { - let label_text = label.to_string(); - let mattched = JTALK_G2P_G_P3_PATTERN.captures(&label_text).unwrap(); - mattched[1].to_string() - }; + let mut p3 = label.phoneme.c; if "AIUEO".contains(&p3) { // 文字をlowerする p3 = p3.to_lowercase();