Josa
Idiomatic josa selector.
Josa is a Rust library to select appropriate josas for korean language.
Overview
push_josa
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_str
does,push_josa
expectsString
, 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!;
select
method
In case you want to append a josa to formatted text such as <span>고양이</span>
,
you can use select
method.
use select;
use IGa;
let cat = "고양이";
let josa = select.unwrap;
let cat = format!;
assert_eq!;
Usage
Add josa
as a dependency in your Cargo.toml
.
[]
= "0.1.2"
Now you can use josa crate.
use *;
// Use here..
Documentation
See docs.rs
Roadmap
select
macro
As soon as hygiene 2.0 (#54727) arrives stable, we will add support for following macro:
select!;
which is terser than 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.