#parser #geo

japanese-address-parser

A Rust Library to parse japanses addresses

17 releases

0.1.0-beta.8 Feb 12, 2024
0.1.0-beta.7 Feb 4, 2024
0.1.0-beta.5 Jan 21, 2024
0.1.0-alpha.9 Dec 30, 2023
0.1.0-alpha.2 Nov 30, 2023

#545 in Parser implementations

Download history 85/week @ 2023-11-28 40/week @ 2023-12-05 8/week @ 2023-12-12 81/week @ 2023-12-19 84/week @ 2023-12-26 73/week @ 2024-01-02 40/week @ 2024-01-09 91/week @ 2024-01-16 15/week @ 2024-01-23 89/week @ 2024-01-30 30/week @ 2024-02-06 208/week @ 2024-02-13

352 downloads per month

MIT license

65KB
1.5K SLoC

japanese-address-parser

Docs Crates.io (latest) Rust Version Unit test & Code format check

A Rust Library to parse japanses addresses.

Usage

Add this to your Cargo.toml

cargo add japanese-address-parser

Async Api

use japanese_address_parser::api::{Api, ApiImpl};
use japanese_address_parser::parser::parse;

#[tokio::main]
async fn main() {
    let async_api = ApiImpl::new();
    let parse_result = parse(async_api, "東京都千代田区丸の内1-1-1").await;
    println!("{:?}", parse_result);
}

Blocking Api

use japanese_address_parser::api::{BlockingApi, BlockingApiImpl};
use japanese_address_parser::parser::parse_blocking;

fn main() {
    let blocking_api = BlockingApiImpl::new();
    let parse_result = parse_blocking(blocking_api, "東京都千代田区丸の内1-1-1");
    println!("{:?}", parse_result);
}

Wasm support

npmjs

This crate is designed to be buildable for wasm32-unknown-unknown with wasm-pack. Pre-compiled wasm module is available npmjs.com

npm install @toriyama/japanese-address-parser
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. If you have questions, please create an issue.

Acknowledgements

This software was developed inspired by @geolonia/normalize-japanese-addresses.
Also, the parsing process uses Geolonia 住所データ provided by 株式会社Geolonia.

License

This crate is distributed under the terms of the MIT license.

Dependencies

~8–23MB
~345K SLoC