From adb9a1d9c0e92517dd8f6d4ed1c348cf8ce6c384 Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Sat, 1 Jun 2024 13:07:42 +0800 Subject: [PATCH 1/2] fix wrong visibility modifier --- src/hmm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hmm.rs b/src/hmm.rs index 4258349..485b319 100644 --- a/src/hmm.rs +++ b/src/hmm.rs @@ -77,7 +77,7 @@ fn viterbi(sentence: &str, hmm_context: &mut HmmContext) { let str_len = sentence.len(); let states = [State::Begin, State::Middle, State::End, State::Single]; #[allow(non_snake_case)] - let R = states.len(); + let R = states.len(); let C = sentence.chars().count(); assert!(C > 1); @@ -151,7 +151,7 @@ fn viterbi(sentence: &str, hmm_context: &mut HmmContext) { } #[allow(non_snake_case)] -pub fn cut_internal<'a>(sentence: &'a str, words: &mut Vec<&'a str>, hmm_context: &mut HmmContext) { +pub(crate) fn cut_internal<'a>(sentence: &'a str, words: &mut Vec<&'a str>, hmm_context: &mut HmmContext) { let str_len = sentence.len(); viterbi(sentence, hmm_context); let mut begin = 0; From a4aee1c62795225dd8bde67015c6d9443c1f1dab Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Sat, 1 Jun 2024 13:09:44 +0800 Subject: [PATCH 2/2] fix wrong visibility modifier --- src/hmm.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hmm.rs b/src/hmm.rs index 485b319..a9dcdfc 100644 --- a/src/hmm.rs +++ b/src/hmm.rs @@ -77,7 +77,7 @@ fn viterbi(sentence: &str, hmm_context: &mut HmmContext) { let str_len = sentence.len(); let states = [State::Begin, State::Middle, State::End, State::Single]; #[allow(non_snake_case)] - let R = states.len(); + let R = states.len(); let C = sentence.chars().count(); assert!(C > 1);