-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from YuukiToriyama/release/v0.1.0-beta.2
release/v0.1.0-beta.2をmainブランチにマージ
- Loading branch information
Showing
2 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[package] | ||
name = "japanese-address-parser" | ||
version = "0.1.0-beta.1" | ||
version = "0.1.0-beta.2" | ||
edition = "2021" | ||
description = "日本の住所を都道府県/市区町村/町名/その他に分割するライブラリです" | ||
description = "A Rust Library to parse japanses addresses." | ||
authors = ["Yuuki Toriyama <[email protected]>"] | ||
repository = "https://github.com/YuukiToriyama/japanese-address-parser" | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,79 @@ | ||
# japanese-address-parser | ||
|
||
[![Docs](https://docs.rs/japanese-address-parser/badge.svg)](https://docs.rs/japanese-address-parser) | ||
[![Crates.io (latest)](https://img.shields.io/crates/v/japanese-address-parser)](https://crates.io/crates/japanese-address-parser) | ||
![Rust Version](https://img.shields.io/badge/rust%20version-%3E%3D1.75.0-orange) | ||
[![Unit test & Code format check](https://github.com/YuukiToriyama/japanese-address-parser/actions/workflows/rust.yaml/badge.svg?branch=main)](https://github.com/YuukiToriyama/japanese-address-parser/actions/workflows/rust.yaml) | ||
|
||
日本の住所を都道府県/市区町村/町名/その他に分割するライブラリです | ||
A Rust Library to parse japanses addresses. | ||
|
||
## Usage | ||
|
||
Add this to your `Cargo.toml` | ||
|
||
```bash | ||
cargo add japanese-address-parser | ||
``` | ||
|
||
### Async Api | ||
|
||
```rust | ||
use japanese_address_parser::api::client::ApiImpl; | ||
use japanese_address_parser::parser::parse; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let async_api = ApiImpl {}; | ||
let parse_result = parse(async_api, "東京都千代田区丸の内1-1-1").await; | ||
println!("{:?}", parse_result); | ||
} | ||
``` | ||
|
||
### Blocking Api | ||
|
||
```rust | ||
use japanese_address_parser::api::blocking::Client; | ||
use japanese_address_parser::parser::parse_blocking; | ||
|
||
fn main() { | ||
let blocking_api = Client {}; | ||
let parse_result = parse_blocking(blocking_api, "東京都千代田区丸の内1-1-1"); | ||
println!("{:?}", parse_result); | ||
} | ||
``` | ||
|
||
## Wasm support | ||
|
||
This crate is designed to be buildable for `wasm32-unknown-unknown` with `wasm-pack`. | ||
Pre-compiled wasm module is available npmjs.com | ||
|
||
```bash | ||
npm install @toriyama/japanese-address-parser | ||
``` | ||
|
||
```javascript | ||
import init, {Parser} from "@toriyama/japanese-address-parser" | ||
|
||
init().then(() => { | ||
const parser = new Parser() | ||
parser.parse("東京都千代田区丸の内1-1-1").then(parseResult => { | ||
console.log(JSON.stringify(parseResult, null, "\t")) | ||
}) | ||
}) | ||
``` | ||
|
||
## Support | ||
|
||
This software is maintained by [YuukiToriyama](https://github.com/yuukitoriyama). | ||
If you have questions, please create an issue. | ||
|
||
## Acknowledgements | ||
|
||
This software was developed inspired | ||
by [@geolonia/normalize-japanese-addresses](https://github.com/geolonia/normalize-japanese-addresses). | ||
Also, the parsing process uses [Geolonia 住所データ](https://github.com/geolonia/japanese-addresses) provided | ||
by [株式会社Geolonia](https://www.geolonia.com/company/). | ||
|
||
## License | ||
|
||
This crate is distributed under the terms of the MIT license. |