Skip to content

Commit b9057c4

Browse files
authored
Merge pull request #3 from dev-five-git/fix-space-issue
Fix space issue
2 parents 00ef61e + b6ff39d commit b9057c4

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

.changeset/bumpy-wombats-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"braillify": patch
3+
---
4+
5+
Fix space issue

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/braillify/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "braillify"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
edition = "2024"
55

66
[dependencies]

libs/braillify/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ mod word_shortcut;
3030

3131
pub fn encode(text: &str) -> Result<Vec<u8>, String> {
3232
let mut result: Vec<u8> = Vec::new();
33-
let words = text.split(' ').collect::<Vec<&str>>();
33+
let words = text
34+
.split(' ')
35+
.filter(|word| !word.is_empty())
36+
.collect::<Vec<&str>>();
37+
3438
let word_count = words.len();
3539
let mut is_english = false;
3640
// 한국어가 존재할 경우 english_indicator 가 true 가 됩니다.
@@ -361,6 +365,7 @@ mod test {
361365
use super::*;
362366
#[test]
363367
pub fn test_encode() {
368+
assert_eq!(encode_to_unicode("상상이상의 ").unwrap(), "⠇⠶⠇⠶⠕⠇⠶⠺");
364369
assert_eq!(encode_to_unicode("안녕\n반가워").unwrap(), "⠣⠒⠉⠻\n⠘⠒⠫⠏");
365370
assert_eq!(encode_to_unicode("BMI(지수)").unwrap(), "⠴⠠⠠⠃⠍⠊⠦⠄⠨⠕⠠⠍⠠⠴");
366371
assert_eq!(encode_to_unicode("지수(BMI)").unwrap(), "⠨⠕⠠⠍⠦⠄⠴⠠⠠⠃⠍⠊⠠⠴");

packages/python/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "python"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
edition = "2024"
55

66
[lib]

0 commit comments

Comments
 (0)