fix(katana): remove the last character if it's a -

This commit is contained in:
tretrauit 2024-01-06 21:16:56 +07:00
parent 4b14ee7c90
commit d5be81f786
2 changed files with 5 additions and 0 deletions

View File

@ -4,3 +4,4 @@ members = [
"swordfish-common",
"swordfish"
]
default-members = ["swordfish"]

View File

@ -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(" ") {