From a5b0ba4f4013fedf7b291b5801c0fcce22a35a60 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 21 Jul 2023 22:07:22 +0200 Subject: add kanji links to jisho.org --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 1572e2e..e081454 100644 --- a/src/main.rs +++ b/src/main.rs @@ -362,11 +362,9 @@ fn format_batch_aux<'a>(dict_idx: &DictIndex<'a>, count: usize, i: usize, batch: if !wchars.intersects(&ex.chars) { continue; } - println!("{}", w); if let Some(ents) = dict_idx.get(w) { for ent in ents.iter() { let s = dict_str(w, ent); - println!("{}: {}", w, s); if wchars.intersects(&batch.chars) { expl_batch.push(s); } else { @@ -378,7 +376,11 @@ fn format_batch_aux<'a>(dict_idx: &DictIndex<'a>, count: usize, i: usize, batch: for be in expl_batch { writeln!(f, r#"

{}

"#, be)?; } - writeln!(f, r#"

{}

"#, ex.chars.inter(&batch.chars).to_string())?; + writeln!(f, r#"

"#)?; + for c in ex.chars.inter(&batch.chars).chars().iter() { + writeln!(f, r#"{}"#, c, c)?; + } + writeln!(f, r#"

"#)?; for be in expl_all { writeln!(f, r#"

{}

"#, be)?; } -- cgit v1.2.3