From bbba43e7aaa9b4cbcaa8f7bc0d35b0f9084f70a2 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Mon, 24 Jul 2023 16:39:22 +0800 Subject: [PATCH] fix camdict: invalid fresh upath --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/camd/camd_res.rs | 2 ++ src/camd/mod.rs | 8 +++----- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7ef6266..33f79d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -244,7 +244,7 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "mafa" -version = "0.2.1" +version = "0.2.2" dependencies = [ "bwrap", "clap", diff --git a/Cargo.toml b/Cargo.toml index 5866d5a..59e0626 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mafa" -version = "0.2.2" +version = "0.2.3" edition = "2021" rust-version = "1.66.0" authors = ["Michael Lee "] diff --git a/src/camd/camd_res.rs b/src/camd/camd_res.rs index c20338e..60280e6 100644 --- a/src/camd/camd_res.rs +++ b/src/camd/camd_res.rs @@ -578,6 +578,8 @@ impl<'w, 's> CamdResult<'w, 's> { let bytes = s.as_bytes(); let mut lv_expl_list = Vec::<&str>::new(); + dbgg!((word, s)); + let mut begi_lv = 0usize; let mut endi_lv = 0usize; for i in 0..bytes.len() { diff --git a/src/camd/mod.rs b/src/camd/mod.rs index 526a79f..c031a98 100644 --- a/src/camd/mod.rs +++ b/src/camd/mod.rs @@ -957,7 +957,7 @@ impl CamdClient<'_> { self.mafad .cache_append("camd", &comb, &format!("{}-", &comb))?; - self.upaths.push(Upath(upath1)); + self.upaths.push(Upath(Vec::from(&upath1[0..matched_len]))); Ok(()) } @@ -1012,10 +1012,7 @@ impl CamdClient<'_> { self.mafad.init_cache("camd", &remote_data)?; } else if let CacheMechanism::Local = self.input.cachm { - self.mafad.try_init_cache( - "camd", - "[4,0,1,0,1,0,1,1,2,1,1,9,0,2,0,0,1]\n[4,0,1,0,1,0,1,1,2,1,1,9,0,3,0,0,1]\n-", - )?; + self.mafad.try_init_cache("camd", "[11,1,1,3,3]\n-")?; } else if let CacheMechanism::No = self.input.cachm { is_rebuild = true; } @@ -1063,6 +1060,7 @@ impl CamdClient<'_> { is_fin: true, })?; + dbgg!((&self.input.words, &explained)); let camd_res = CamdResult::from_str(&self.input.words, &explained)?; dbgg!(&camd_res);