From d5be81f786b631a458c85527845dcf173efa9b82 Mon Sep 17 00:00:00 2001 From: tretrauit Date: Sat, 6 Jan 2024 21:16:56 +0700 Subject: [PATCH] fix(katana): remove the last character if it's a - --- Cargo.toml | 1 + swordfish/src/katana.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 7696445..002d885 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,4 @@ members = [ "swordfish-common", "swordfish" ] +default-members = ["swordfish"] diff --git a/swordfish/src/katana.rs b/swordfish/src/katana.rs index 2a655a4..2ed9b5b 100644 --- a/swordfish/src/katana.rs +++ b/swordfish/src/katana.rs @@ -130,6 +130,10 @@ fn fix_tesseract_string(text: &mut String) { while replace_string(text, " ", " ") { trace!("Removing multiple spaces"); } + // Remove the last character if it is a dash + if text.ends_with("-") { + text.pop(); + } // Workaround if the first character is a space trace!("Text: {}", text); while text.starts_with(" ") {