Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bumpy-wombats-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braillify": patch
---

Fix space issue
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libs/braillify/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "braillify"
version = "1.0.0"
version = "1.0.1"
edition = "2024"

[dependencies]
Expand Down
7 changes: 6 additions & 1 deletion libs/braillify/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ mod word_shortcut;

pub fn encode(text: &str) -> Result<Vec<u8>, String> {
let mut result: Vec<u8> = Vec::new();
let words = text.split(' ').collect::<Vec<&str>>();
let words = text
.split(' ')
.filter(|word| !word.is_empty())
.collect::<Vec<&str>>();

let word_count = words.len();
let mut is_english = false;
// 한국어가 존재할 경우 english_indicator 가 true 가 됩니다.
Expand Down Expand Up @@ -361,6 +365,7 @@ mod test {
use super::*;
#[test]
pub fn test_encode() {
assert_eq!(encode_to_unicode("상상이상의 ").unwrap(), "⠇⠶⠇⠶⠕⠇⠶⠺");
assert_eq!(encode_to_unicode("안녕\n반가워").unwrap(), "⠣⠒⠉⠻\n⠘⠒⠫⠏");
assert_eq!(encode_to_unicode("BMI(지수)").unwrap(), "⠴⠠⠠⠃⠍⠊⠦⠄⠨⠕⠠⠍⠠⠴");
assert_eq!(encode_to_unicode("지수(BMI)").unwrap(), "⠨⠕⠠⠍⠦⠄⠴⠠⠠⠃⠍⠊⠠⠴");
Expand Down
2 changes: 1 addition & 1 deletion packages/python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "python"
version = "1.0.0"
version = "1.0.1"
edition = "2024"

[lib]
Expand Down