YuukiToriyama / japanese-address-parser

日本の住所を都道府県/市区町村/町名/その他に分割するライブラリです
https://yuukitoriyama.github.io/japanese-address-parser/public/index.html
MIT License
3 stars 0 forks source link
address-validation geo webassembly

japanese-address-parser

Docs Crates.io (latest) Rust Version Unit test & Integration test

A Rust library for parsing Japanese addresses.

Usage

Add the following to your Cargo.toml.

[dependencies]
japanese-address-parser = "0.1"

Async Version

use japanese_address_parser::parser::Parser;

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

Blocking Version

use japanese_address_parser::parser::Parser;

fn main() {
    let parser: Parser = Default::default();
    let parse_result = parser.parse_blocking("東京都千代田区丸の内1-1-1"); // `parse_blocking()` is available on `blocking` feature only
    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 on 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"))
    })
})

Python support(experimental)

PyPI - Version

This library can be called from the Python world. For more details, see python module's README.

Road to v1

The goals of this library are as follows.

Support

This software is maintained by YuukiToriyama. If you have any questions, please create a new issue.

Acknowledgements

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

License

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