Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03fbc93

Browse files
committed
Add example to head of doc comment
1 parent3ab4c84 commit03fbc93

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

‎readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Converters of troublesome characters included in Japanese texts.
88
- Half-width-kana[半角カナ;HANKAKU KANA] -> normal Katakana
99
- Wide-alphanumeric[全角英数;ZENKAKU EISU] <-> normal ASCII
1010

11-
If you need canonicalization oftext including Japanese, consider to use[unicode_normalization](https://github.com/unicode-rs/unicode-normalization) crate at first.
11+
If you need canonicalization oftexts including Japanese, consider to use[unicode_normalization](https://github.com/unicode-rs/unicode-normalization) crate at first.
1212
NFD, NFKD, NFC and NFKC can be used.
1313
This crate, however, works with you if you are in a niche such as a need of delicate control of Japanese characters for a restrictive character terminal.
1414

‎src/kana.rs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11

22
//! Converters of troublesome characters included in Japanese texts.
33
//!
4-
//! Half-width-kana[半角カナ;HANKAKU KANA] -> normal Katakana
4+
//! * Half-width-kana[半角カナ;HANKAKU KANA] -> normal Katakana
5+
//! * Wide-alphanumeric[全角英数;ZENKAKU EISU] <-> normal ASCII
56
//!
6-
//! Wide-alphanumeric[全角英数;ZENKAKU EISU] <-> normal ASCII
7-
7+
//! # Example
8+
//! ```
9+
//! extern crate kana;
10+
//! use kana::Kana;
11+
//!
12+
//! fn main() {
13+
//! let k = Kana::init();
14+
//!
15+
//! let s1 = "マツオ バショウ ア゚";
16+
//! assert_eq!("マツオ バショウ ア ゚", k.half2kana(s1));
17+
//! assert_eq!("マツオ バショウ ア゚", k.half2full(s1));
18+
//!
19+
//! let s2 = "ひ゜ひ゛んは゛";
20+
//! assert_eq!("ぴびんば", k.combine(s2));
21+
//! assert_eq!("ひ ゚ひ ゙んは ゙", kana::vsmark2combi(s2));
22+
//!
23+
//! let s3 = "#&Rust-1.6!";
24+
//! assert_eq!("#&Rust-1.6!", kana::wide2ascii(s3));
25+
//! }
26+
//! ```
827
928
#[macro_use]externcrate maplit;
1029
#[macro_use]externcrate lazy_static;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp