From a94ca122c93af26b1c3484fbd7772e7152dc9040 Mon Sep 17 00:00:00 2001 From: femshima <49227365+femshima@users.noreply.github.com> Date: Mon, 22 Jan 2024 08:01:58 +0900 Subject: [PATCH 1/2] fix wrong phone position --- crates/jlabel-question/src/position.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/jlabel-question/src/position.rs b/crates/jlabel-question/src/position.rs index 67f3677..e34c51f 100644 --- a/crates/jlabel-question/src/position.rs +++ b/crates/jlabel-question/src/position.rs @@ -134,8 +134,8 @@ impl Position for PhonePosition { fn get<'a>(&self, label: &'a Label) -> Option<&'a Self::Target> { match self { - Self::P1 => label.phoneme.p1.as_ref(), - Self::P2 => label.phoneme.p2.as_ref(), + Self::P1 => label.phoneme.p2.as_ref(), + Self::P2 => label.phoneme.p1.as_ref(), Self::P3 => label.phoneme.c.as_ref(), Self::P4 => label.phoneme.n1.as_ref(), Self::P5 => label.phoneme.n2.as_ref(), From 63e4e9aebdcc515c34d95e0b53c8c8d841ae5e3d Mon Sep 17 00:00:00 2001 From: femshima <49227365+femshima@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:45:08 +0900 Subject: [PATCH 2/2] add phoneme test --- crates/jlabel-question/src/tests.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/jlabel-question/src/tests.rs b/crates/jlabel-question/src/tests.rs index 222c659..168033e 100644 --- a/crates/jlabel-question/src/tests.rs +++ b/crates/jlabel-question/src/tests.rs @@ -123,6 +123,9 @@ fn query() { }, }; + assert!(question(&["b^*"]).unwrap().test(&label)); + assert!(question(&["*^o-*"]).unwrap().test(&label)); + assert!(!question(&["*=i/A:*"]).unwrap().test(&label)); assert!(!question(&["*/A:-??+*", "*/A:-9+*"]).unwrap().test(&label));