Skip to content

Commit

Permalink
Merge pull request #14 from jpreprocess/fix-phone-position
Browse files Browse the repository at this point in the history
Fix wrong phone position
  • Loading branch information
phenylshima authored Jan 23, 2024
2 parents 0e85f53 + 63e4e9a commit 1efe8d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/jlabel-question/src/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
3 changes: 3 additions & 0 deletions crates/jlabel-question/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 1efe8d5

Please sign in to comment.