Skip to content

Commit

Permalink
Merge pull request #111 from YuukiToriyama/release/v0.1.0-beta.2
Browse files Browse the repository at this point in the history
release/v0.1.0-beta.2をmainブランチにマージ
  • Loading branch information
YuukiToriyama authored Jan 6, 2024
2 parents a45d304 + df8641c commit 48d23f0
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
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"
Expand Down
76 changes: 75 additions & 1 deletion README.md
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.

0 comments on commit 48d23f0

Please sign in to comment.