strip clozes before stripping combining characters

find_notes_sc           time:   [1.0398 s 1.0405 s 1.0412 s]
                        change: [-6.1276% -6.0323% -5.9401%] (p = 0.00 < 0.05)
                        Performance has improved.
This commit is contained in:
llama 2025-07-01 08:53:16 +08:00
parent faa5ff8315
commit ae7d0dd2a4
No known key found for this signature in database
GPG key ID: 0B7543854B9413C3

View file

@ -121,12 +121,12 @@ fn add_process_text_function(db: &Connection) -> rusqlite::Result<()> {
|ctx| {
let mut text = Cow::from(ctx.get_raw(0).as_str()?);
let opt = ctx.get_raw(1).as_i64()? as u8;
if opt & 1 != 0 {
text = text.map_cow(without_combining);
}
if opt & 2 != 0 {
text = text.map_cow(strip_clozes);
}
if opt & 1 != 0 {
text = text.map_cow(without_combining);
}
Ok(text.get_owned())
},
)