~andrewzah/korean_numbers

59d0b5d4fa2014c7f03e6bc3215e630e0806d314 — Andrew Zah 1 year, 7 months ago 5b53f68
fix spacing logic to apply for all blocks
4 files changed, 7 insertions(+), 5 deletions(-)

M Cargo.lock
M Cargo.toml
M src/parse.rs
M tests/test.rs
M Cargo.lock => Cargo.lock +1 -1
@@ 18,7 18,7 @@ dependencies = [

[[package]]
name = "korean_numbers"
version = "0.6.4"
version = "0.6.5"
dependencies = [
 "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",

M Cargo.toml => Cargo.toml +1 -1
@@ 1,6 1,6 @@
[package]
name = "korean_numbers"
version = "0.6.5"
version = "0.6.6"
authors = ["Andrew Zah <zah@andrewzah.com>"]
edition = "2018"
license = "Apache-2.0"

M src/parse.rs => src/parse.rs +4 -3
@@ 49,9 49,10 @@ pub fn parse_hangeul_sino(numbers: Vec<char>) -> String {
                        }
                    }

                    if num != 1 && mut_idx != len - 1 && output != "" {
                        output.push(' ');
                    } 
                }

                if num != 1 && mut_idx != len - 1 && output != "" {
                    output.push(' ');
                }
                output.push_str(block.to_str());


M tests/test.rs => tests/test.rs +1 -0
@@ 159,6 159,7 @@ fn it_handles_mixed_digits_zeroes_sino() {
        (8300_0000     ,  "팔천삼백만"),
        (8375_2000     ,  "팔천삼백칠십오만 이천"),
        (8001_9459     ,  "팔천일만 구천사백오십구"),
        (5_0337_9569   ,  "오억 삼백삼십칠만 구천오백육십구"),
        (10_0110_2120  ,  "십억 백십만 이천백이십"),
        (11_3960_3741 ,   "십일억 삼천구백육십만 삼천칠백사십일"),
        (14_2108_6610  ,  "십사억 이천백팔만 육천육백십"),