Josa
Idiomatic josa selector.
Josa is a Rust library to select appropriate josas for korean language.
Overview
Method
Josa is an extension trait implemented for String type.
Its API works just like push_str method on String.
use JosaExt;
use ;
let mut user = "유진".to_owned;
let mut mackerel = "고등어".to_owned;
user.push_josa;
mackerel.push_josa;
let sentence = format!;
assert_eq!;
:warning: Like
push_strdoes,push_josaexpectsString, notstr, as its argument.
+, += Operator
You can use +, += operator to append josa.
use ;
let user = "유진".to_owned;
let mackerel = "고등어".to_owned;
let sentence = format!;
assert_eq!;
Usage
Add josa as a dependency in your Cargo.toml.
[]
= "0.1.0"
then import JosaExt trait in your code:
use JosaExt;
Now you can use methods on String.
use JosaExt;
// 🔥 here..
Documentation
See docs.rs
Roadmap
select method
Sometimes you don't want to mutate your String. For that case, we will provide pure function select which returns appropriate josa for given noun.
select macro
As soon as hygiene 2.0 (#54727) arrives stable, we will add support for following macro:
select!;
which is more clear compared to current syntax:
Hangul enum variants
As soon as non-ASCII identifiers (#55467) arrives stable, we will change the names of josas to Hangul:
format!;
License
Distributed under the MIT license.