A Rust Library to parse japanese addresses.
Add this to your Cargo.toml
cargo add japanese-address-parser
# or
cargo add japanese-address-parser -F blocking
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);
}
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);
}
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"))
})
})
This library can be called from Python world. For more detail, see python module's README.
The goals that this library aims to achieve are below.
- Supports not only wasm target but also various platforms and architectures.
- Enables more advanced normalization. For example, provides more detailed analysis than town level.
- Provides latlng of the given address.
- Enables processing of town names that have ceased to exist as a result of municipal mergers.
This software is maintained by YuukiToriyama. If you have questions, please create an issue.
This software was developed inspired
by @geolonia/normalize-japanese-addresses.
Also, the parsing process uses Geolonia 住所データ provided
by 株式会社Geolonia.
This crate is distributed under the terms of the MIT license.