From d76ae2e38131f6546fed245c66c2b4c112de4a6d Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 14 Nov 2024 23:19:43 +0900 Subject: [PATCH 01/41] =?UTF-8?q?delete:=20#473:=20`core::entity`=E3=83=A2?= =?UTF-8?q?=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/entity.rs | 5 ----- core/src/lib.rs | 2 -- 2 files changed, 7 deletions(-) delete mode 100644 core/src/entity.rs diff --git a/core/src/entity.rs b/core/src/entity.rs deleted file mode 100644 index cdcbf8bb..00000000 --- a/core/src/entity.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub use crate::domain::geolonia::entity::Address; -pub use crate::domain::geolonia::entity::City; -pub use crate::domain::geolonia::entity::Prefecture; -pub use crate::domain::geolonia::entity::Town; -pub use crate::parser::ParseResult; diff --git a/core/src/lib.rs b/core/src/lib.rs index 73b3643a..5589a3bc 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -17,8 +17,6 @@ mod adapter; #[deprecated(since = "0.1.23", note = "This module will be deleted in v0.2")] pub mod api; pub(crate) mod domain; -#[deprecated(since = "0.1.6", note = "This module will be deleted in v0.2")] -pub mod entity; #[cfg(feature = "experimental")] #[cfg_attr(docsrs, doc(cfg(feature = "experimental")))] pub mod experimental; From 6280cca1cfab10e214940fead4d487fb98454143 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 14 Nov 2024 23:24:55 +0900 Subject: [PATCH 02/41] =?UTF-8?q?delete:=20#473:=20`core::parser::adapter`?= =?UTF-8?q?=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Cargo.toml | 1 - core/src/parser.rs | 3 - core/src/parser/adapter.rs | 1 - .../adapter/orthographical_variant_adapter.rs | 114 ------------------ 4 files changed, 119 deletions(-) delete mode 100644 core/src/parser/adapter.rs delete mode 100644 core/src/parser/adapter/orthographical_variant_adapter.rs diff --git a/core/Cargo.toml b/core/Cargo.toml index 0cf422a0..fb632967 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -23,7 +23,6 @@ eliminate-whitespaces = [] experimental = [] [dependencies] -itertools = "0.13.0" # 互換性のために残してあるが、`core::parser::adapter`を削除する際に忘れずに削除する log.workspace = true rapidfuzz = "0.5.0" regex = { version = "1.10.6", default-features = false, features = ["std", "unicode-perl"] } diff --git a/core/src/parser.rs b/core/src/parser.rs index 7173de49..7d586305 100644 --- a/core/src/parser.rs +++ b/core/src/parser.rs @@ -11,9 +11,6 @@ use crate::interactor::geolonia::{GeoloniaInteractor, GeoloniaInteractorImpl}; use crate::tokenizer::{End, Tokenizer}; use serde::Serialize; -#[deprecated(since = "0.1.24", note = "This module will be deleted in v0.2")] -pub mod adapter; - impl From> for Address { fn from(value: Tokenizer) -> Self { let mut address = Address::new("", "", "", ""); diff --git a/core/src/parser/adapter.rs b/core/src/parser/adapter.rs deleted file mode 100644 index f606829f..00000000 --- a/core/src/parser/adapter.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod orthographical_variant_adapter; diff --git a/core/src/parser/adapter/orthographical_variant_adapter.rs b/core/src/parser/adapter/orthographical_variant_adapter.rs deleted file mode 100644 index 9d081f3b..00000000 --- a/core/src/parser/adapter/orthographical_variant_adapter.rs +++ /dev/null @@ -1,114 +0,0 @@ -use itertools::Itertools; - -pub type Variant = &'static [&'static str]; - -pub trait OrthographicalVariants { - const の: Variant; - const ツ: Variant; - const ケ: Variant; - const 薮: Variant; - const 崎: Variant; - const 檜: Variant; - const 龍: Variant; - const 竈: Variant; - const 嶋: Variant; - const 舘: Variant; - const 脊: Variant; - const 渕: Variant; - const 己: Variant; - const 槇: Variant; - const 治: Variant; - const 佛: Variant; - const 澤: Variant; - const 塚: Variant; - const 恵: Variant; - const 穂: Variant; - const 梼: Variant; - const 蛍: Variant; - const 與: Variant; - const 瀧: Variant; - const 籠: Variant; - const 濱: Variant; - const 祗: Variant; - const 曾: Variant; -} - -impl OrthographicalVariants for Variant { - const の: Variant = &["の", "ノ", "之"]; - const ツ: Variant = &["ツ", "ッ"]; - const ケ: Variant = &["ケ", "ヶ", "が", "ガ"]; - const 薮: Variant = &["薮", "藪", "籔"]; - const 崎: Variant = &["崎", "﨑"]; - const 檜: Variant = &["桧", "檜"]; - const 龍: Variant = &["龍", "竜"]; - const 竈: Variant = &["竈", "竃", "釜"]; - const 嶋: Variant = &["嶋", "島"]; - const 舘: Variant = &["舘", "館"]; - const 脊: Variant = &["脊", "背"]; - const 渕: Variant = &["渕", "淵"]; - const 己: Variant = &["己", "巳"]; - const 槇: Variant = &["槇", "槙"]; - const 治: Variant = &["治", "冶"]; - const 佛: Variant = &["佛", "仏"]; - const 澤: Variant = &["澤", "沢"]; - const 塚: Variant = &["塚", "塚"]; - const 恵: Variant = &["恵", "惠"]; - const 穂: Variant = &["穂", "穗"]; - const 梼: Variant = &["梼", "檮"]; - const 蛍: Variant = &["蛍", "螢"]; - const 與: Variant = &["與", "与"]; - const 瀧: Variant = &["瀧", "滝"]; - const 籠: Variant = &["籠", "篭"]; - const 濱: Variant = &["濱", "浜"]; - const 祗: Variant = &["祗", "祇"]; - const 曾: Variant = &["曾", "曽"]; -} - -pub struct OrthographicalVariantAdapter { - pub variant_list: Vec, -} - -impl OrthographicalVariantAdapter { - pub fn apply(self, input: &str, region_name: &str) -> Option<(String, String)> { - // 必要なパターンのみを選別する - let variant_list: Vec<&Variant> = self - .variant_list - .iter() - .filter(|v| v.iter().any(|c| input.contains(c))) - .collect(); - if variant_list.is_empty() { - return None; - } - - // マッチ候補を容れておくためのVector - let mut candidates: Vec = vec![region_name.to_string()]; - // パターンを一つづつ検証していく - for variant in variant_list { - let mut semi_candidates: Vec = vec![]; - // variantから順列を作成 - // ["ケ", "ヶ", "が"] -> (ケ, ヶ), (ケ, が), (ヶ, ケ), (ヶ, が), (が, ケ), (が, ヶ) - for permutation in variant.iter().permutations(2) { - for candidate in candidates.iter().filter(|c| c.contains(permutation[0])) { - // マッチ候補の中でパターンに引っかかるものがあれば文字を置き換えてマッチを試す - let edited_region_name = candidate.replace(permutation[0], permutation[1]); - if input.starts_with(&edited_region_name) { - // マッチすれば早期リターン - return Some(( - region_name.to_string(), - input - .chars() - .skip(edited_region_name.chars().count()) - .collect(), - )); - } else { - // マッチしなければsemi_candidatesに置き換え後の文字列をpush - semi_candidates.push(edited_region_name); - }; - } - } - candidates = semi_candidates; - candidates.push(region_name.to_string()); - } - None - } -} From dbf57e9f284959e01efbb9454ae8a2e0e2a0969c Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 14 Nov 2024 23:29:42 +0900 Subject: [PATCH 03/41] =?UTF-8?q?delete:=20#473:=20`core::parser::parse`?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/parser.rs | 70 ---------------------------------------------- 1 file changed, 70 deletions(-) diff --git a/core/src/parser.rs b/core/src/parser.rs index 7d586305..5018128b 100644 --- a/core/src/parser.rs +++ b/core/src/parser.rs @@ -1,7 +1,6 @@ #![allow(deprecated)] use std::sync::Arc; -use crate::api::AsyncApi; #[cfg(feature = "blocking")] use crate::api::BlockingApi; use crate::domain::common::token::Token; @@ -185,75 +184,6 @@ impl Parser { } } -/// A function to parse the given address asynchronously. -/// -/// publicにしていますが、直接の使用は推奨されません。[Parser]の利用を検討してください。 -#[deprecated(since = "0.1.23", note = "This module will be deleted in v0.2")] -pub async fn parse(api: Arc, input: &str) -> ParseResult { - let tokenizer = Tokenizer::new(input); - // 都道府県を特定 - let (prefecture, tokenizer) = match tokenizer.read_prefecture() { - Ok(found) => found, - Err(tokenizer) => { - return ParseResult { - address: Address::from(tokenizer), - error: Some(Error::new_parse_error(ParseErrorKind::Prefecture)), - } - } - }; - // その都道府県の市町村名リストを取得 - let prefecture_master = match api.get_prefecture_master(prefecture.name_ja()).await { - Err(error) => { - return ParseResult { - address: Address::from(tokenizer.finish()), - error: Some(error), - }; - } - Ok(result) => result, - }; - // 市町村名を特定 - let (city_name, tokenizer) = match tokenizer.read_city(&prefecture_master.cities) { - Ok(found) => found, - Err(not_found) => { - // 市区町村が特定できない場合かつフィーチャフラグが有効な場合、郡名が抜けている可能性を検討 - match not_found.read_city_with_county_name_completion(&prefecture_master.cities) { - Ok(found) if cfg!(feature = "city-name-correction") => found, - _ => { - // それでも見つからない場合は終了 - return ParseResult { - address: Address::from(tokenizer.finish()), - error: Some(Error::new_parse_error(ParseErrorKind::City)), - }; - } - } - } - }; - // その市町村の町名リストを取得 - let city = match api.get_city_master(prefecture.name_ja(), &city_name).await { - Err(error) => { - return ParseResult { - address: Address::from(tokenizer.finish()), - error: Some(error), - }; - } - Ok(result) => result, - }; - // 町名を特定 - let Ok((_, tokenizer)) = - tokenizer.read_town(city.towns.iter().map(|x| x.name.clone()).collect()) - else { - return ParseResult { - address: Address::from(tokenizer.finish()), - error: Some(Error::new_parse_error(ParseErrorKind::Town)), - }; - }; - - ParseResult { - address: Address::from(tokenizer.finish()), - error: None, - } -} - #[cfg(all(test, not(feature = "blocking")))] mod tests { use crate::domain::geolonia::error::ParseErrorKind; From f05b4b730f3b0272d439a566493735ae73e8e290 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 14 Nov 2024 23:31:28 +0900 Subject: [PATCH 04/41] =?UTF-8?q?delete:=20#473:=20`core::parser::parse=5F?= =?UTF-8?q?blocking`=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/parser.rs | 66 ---------------------------------------------- 1 file changed, 66 deletions(-) diff --git a/core/src/parser.rs b/core/src/parser.rs index 5018128b..79619f6f 100644 --- a/core/src/parser.rs +++ b/core/src/parser.rs @@ -1,8 +1,5 @@ -#![allow(deprecated)] use std::sync::Arc; -#[cfg(feature = "blocking")] -use crate::api::BlockingApi; use crate::domain::common::token::Token; use crate::domain::geolonia::entity::Address; use crate::domain::geolonia::error::{Error, ParseErrorKind}; @@ -249,69 +246,6 @@ mod tests { } } -/// A function to parse the given address synchronously. -/// -/// publicにしていますが、直接の使用は推奨されません。[Parser]の利用を検討してください。 -#[cfg(feature = "blocking")] -#[deprecated(since = "0.1.23", note = "This module will be deleted in v0.2")] -pub fn parse_blocking(api: Arc, input: &str) -> ParseResult { - let tokenizer = Tokenizer::new(input); - let (prefecture, tokenizer) = match tokenizer.read_prefecture() { - Ok(found) => found, - Err(tokenizer) => { - return ParseResult { - address: Address::from(tokenizer), - error: Some(Error::new_parse_error(ParseErrorKind::Prefecture)), - } - } - }; - let prefecture_master = match api.get_prefecture_master(prefecture.name_ja()) { - Err(error) => { - return ParseResult { - address: Address::from(tokenizer.finish()), - error: Some(error), - }; - } - Ok(result) => result, - }; - let (city_name, tokenizer) = match tokenizer.read_city(&prefecture_master.cities) { - Ok(found) => found, - Err(not_found) => { - match not_found.read_city_with_county_name_completion(&prefecture_master.cities) { - Ok(found) if cfg!(feature = "city-name-correction") => found, - _ => { - return ParseResult { - address: Address::from(tokenizer.finish()), - error: Some(Error::new_parse_error(ParseErrorKind::City)), - }; - } - } - } - }; - let city = match api.get_city_master(prefecture.name_ja(), &city_name) { - Err(error) => { - return ParseResult { - address: Address::from(tokenizer.finish()), - error: Some(error), - }; - } - Ok(result) => result, - }; - let Ok((_, tokenizer)) = - tokenizer.read_town(city.towns.iter().map(|x| x.name.clone()).collect()) - else { - return ParseResult { - address: Address::from(tokenizer.finish()), - error: Some(Error::new_parse_error(ParseErrorKind::Town)), - }; - }; - - ParseResult { - address: Address::from(tokenizer.finish()), - error: None, - } -} - #[cfg(all(test, feature = "blocking"))] mod blocking_tests { use crate::domain::geolonia::error::ParseErrorKind; From b5a5063ea7584933290317425415b3c8b8bd8517 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 14 Nov 2024 23:38:04 +0900 Subject: [PATCH 05/41] =?UTF-8?q?delete:=20#473:=20`core::api`=E3=83=A2?= =?UTF-8?q?=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/api.rs | 47 ----------------------------------------------- core/src/lib.rs | 2 -- 2 files changed, 49 deletions(-) delete mode 100644 core/src/api.rs diff --git a/core/src/api.rs b/core/src/api.rs deleted file mode 100644 index 0c9696c5..00000000 --- a/core/src/api.rs +++ /dev/null @@ -1,47 +0,0 @@ -#![allow(deprecated)] -pub use crate::repository::geolonia::city_master_api; -pub use crate::repository::geolonia::prefecture_master_api; - -use crate::domain::geolonia::entity::{City, Prefecture}; -use crate::domain::geolonia::error::Error; -use crate::repository::geolonia::city_master_api::CityMasterApi; -use crate::repository::geolonia::prefecture_master_api::PrefectureMasterApi; - -#[derive(Default)] -pub struct AsyncApi { - pub prefecture_master_api: PrefectureMasterApi, - pub city_master_api: CityMasterApi, -} - -impl AsyncApi { - pub async fn get_prefecture_master(&self, prefecture_name: &str) -> Result { - self.prefecture_master_api.get(prefecture_name).await - } - - pub async fn get_city_master( - &self, - prefecture_name: &str, - city_name: &str, - ) -> Result { - self.city_master_api.get(prefecture_name, city_name).await - } -} - -#[cfg(feature = "blocking")] -#[derive(Default)] -pub struct BlockingApi { - prefecture_master_api: PrefectureMasterApi, - city_master_api: CityMasterApi, -} - -#[cfg(feature = "blocking")] -impl BlockingApi { - pub fn get_prefecture_master(&self, prefecture_name: &str) -> Result { - self.prefecture_master_api.get_blocking(prefecture_name) - } - - pub fn get_city_master(&self, prefecture_name: &str, city_name: &str) -> Result { - self.city_master_api - .get_blocking(prefecture_name, city_name) - } -} diff --git a/core/src/lib.rs b/core/src/lib.rs index 5589a3bc..2b92a7aa 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -14,8 +14,6 @@ compile_error! { } mod adapter; -#[deprecated(since = "0.1.23", note = "This module will be deleted in v0.2")] -pub mod api; pub(crate) mod domain; #[cfg(feature = "experimental")] #[cfg_attr(docsrs, doc(cfg(feature = "experimental")))] From 5a01a0f771af2e9b5ff513e8027a802be84485d2 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 14 Nov 2024 23:41:59 +0900 Subject: [PATCH 06/41] =?UTF-8?q?delete:=20#473:=20`core::repository::city?= =?UTF-8?q?=5Fmaster=5Fapi`=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/repository/geolonia.rs | 2 - .../repository/geolonia/city_master_api.rs | 108 ------------------ 2 files changed, 110 deletions(-) delete mode 100644 core/src/repository/geolonia/city_master_api.rs diff --git a/core/src/repository/geolonia.rs b/core/src/repository/geolonia.rs index 5a4724a4..33604127 100644 --- a/core/src/repository/geolonia.rs +++ b/core/src/repository/geolonia.rs @@ -1,6 +1,4 @@ pub(crate) mod city; -#[deprecated(since = "0.1.23", note = "This module will be deleted in v0.2")] -pub mod city_master_api; pub(crate) mod prefecture; #[deprecated(since = "0.1.23", note = "This module will be deleted in v0.2")] pub mod prefecture_master_api; diff --git a/core/src/repository/geolonia/city_master_api.rs b/core/src/repository/geolonia/city_master_api.rs deleted file mode 100644 index b00eff84..00000000 --- a/core/src/repository/geolonia/city_master_api.rs +++ /dev/null @@ -1,108 +0,0 @@ -use crate::domain::geolonia::entity::{City, Town}; -use crate::domain::geolonia::error::Error; -use crate::service::geolonia::GeoloniaApiService; - -pub struct CityMasterApi { - pub server_url: &'static str, -} - -impl Default for CityMasterApi { - fn default() -> Self { - Self { - server_url: "https://geolonia.github.io/japanese-addresses/api/ja", - } - } -} - -impl CityMasterApi { - pub async fn get(&self, prefecture_name: &str, city_name: &str) -> Result { - let endpoint = format!("{}/{}/{}.json", self.server_url, prefecture_name, city_name); - let api_service = GeoloniaApiService {}; - let towns = api_service.get::>(&endpoint).await?; - Ok(City { - name: city_name.to_string(), - towns, - }) - } - #[cfg(feature = "blocking")] - pub fn get_blocking(&self, prefecture_name: &str, city_name: &str) -> Result { - let endpoint = format!("{}/{}/{}.json", self.server_url, prefecture_name, city_name); - let api_service = GeoloniaApiService {}; - let towns = api_service.get_blocking::>(&endpoint)?; - Ok(City { - name: city_name.to_string(), - towns, - }) - } -} - -#[cfg(all(test, not(feature = "blocking")))] -mod tests { - use crate::domain::geolonia::entity::Town; - - use crate::repository::geolonia::city_master_api::CityMasterApi; - - #[tokio::test] - async fn 非同期_石川県羽咋郡志賀町_成功() { - let city_master_api: CityMasterApi = Default::default(); - let result = city_master_api.get("石川県", "羽咋郡志賀町").await; - let city = result.unwrap(); - assert_eq!(city.name, "羽咋郡志賀町"); - let town = Town { - name: "末吉".to_string(), - koaza: "千古".to_string(), - lat: Some(37.006235), - lng: Some(136.779155), - }; - assert!(city.towns.contains(&town)); - } - - #[tokio::test] - async fn 非同期_誤った市区町村名_失敗() { - let city_master_api: CityMasterApi = Default::default(); - let result = city_master_api.get("石川県", "敦賀市").await; - assert!(result.is_err()); - assert_eq!( - result.err().unwrap().error_message, - format!( - "{}/石川県/敦賀市.jsonを取得できませんでした", - city_master_api.server_url - ) - ); - } -} - -#[cfg(all(test, feature = "blocking"))] -mod blocking_tests { - use crate::domain::geolonia::entity::Town; - use crate::repository::geolonia::city_master_api::CityMasterApi; - - #[test] - fn 同期_石川県羽咋郡志賀町_成功() { - let city_master_api: CityMasterApi = Default::default(); - let result = city_master_api.get_blocking("石川県", "羽咋郡志賀町"); - let city = result.unwrap(); - assert_eq!(city.name, "羽咋郡志賀町"); - let town = Town { - name: "末吉".to_string(), - koaza: "千古".to_string(), - lat: Some(37.006235), - lng: Some(136.779155), - }; - assert!(city.towns.contains(&town)); - } - - #[test] - fn 同期_誤った市区町村名_失敗() { - let city_master_api: CityMasterApi = Default::default(); - let result = city_master_api.get_blocking("石川県", "敦賀市"); - assert!(result.is_err()); - assert_eq!( - result.err().unwrap().error_message, - format!( - "{}/石川県/敦賀市.jsonを取得できませんでした", - city_master_api.server_url - ) - ); - } -} From 10b9552a71204928b978757cd5b5110ad836fe22 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 14 Nov 2024 23:47:26 +0900 Subject: [PATCH 07/41] =?UTF-8?q?delete:=20#473:=20`core::repository::pref?= =?UTF-8?q?ecture=5Fmaster=5Fapi`=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit テストコードに一部使用箇所が残っていたので併せて修正 --- core/src/repository/geolonia.rs | 2 - core/src/repository/geolonia/prefecture.rs | 10 +- .../geolonia/prefecture_master_api.rs | 123 ------------------ 3 files changed, 3 insertions(+), 132 deletions(-) delete mode 100644 core/src/repository/geolonia/prefecture_master_api.rs diff --git a/core/src/repository/geolonia.rs b/core/src/repository/geolonia.rs index 33604127..bd72317e 100644 --- a/core/src/repository/geolonia.rs +++ b/core/src/repository/geolonia.rs @@ -1,4 +1,2 @@ pub(crate) mod city; pub(crate) mod prefecture; -#[deprecated(since = "0.1.23", note = "This module will be deleted in v0.2")] -pub mod prefecture_master_api; diff --git a/core/src/repository/geolonia/prefecture.rs b/core/src/repository/geolonia/prefecture.rs index 9681c587..3e89489c 100644 --- a/core/src/repository/geolonia/prefecture.rs +++ b/core/src/repository/geolonia/prefecture.rs @@ -28,7 +28,6 @@ impl PrefectureMasterRepository { #[cfg(all(test, not(feature = "blocking")))] mod tests { use crate::repository::geolonia::prefecture::PrefectureMasterRepository; - use crate::repository::geolonia::prefecture_master_api::PrefectureMasterApi; use crate::service::geolonia::GeoloniaApiService; #[tokio::test] @@ -61,15 +60,12 @@ mod tests { #[tokio::test] async fn 非同期_誤った都道府県名_失敗() { - let prefecture_master_api: PrefectureMasterApi = Default::default(); - let result = prefecture_master_api.get("大阪都").await; + let api_service = GeoloniaApiService {}; + let result = PrefectureMasterRepository::get(&api_service, "大阪都").await; assert!(result.is_err()); assert_eq!( result.err().unwrap().error_message, - format!( - "{}/大阪都/master.jsonを取得できませんでした", - prefecture_master_api.server_url - ) + "https://yuukitoriyama.github.io/geolonia-japanese-addresses-accompanist/大阪都/master.jsonを取得できませんでした", ); } } diff --git a/core/src/repository/geolonia/prefecture_master_api.rs b/core/src/repository/geolonia/prefecture_master_api.rs deleted file mode 100644 index b98d0929..00000000 --- a/core/src/repository/geolonia/prefecture_master_api.rs +++ /dev/null @@ -1,123 +0,0 @@ -use crate::domain::geolonia::entity::Prefecture; -use crate::domain::geolonia::error::Error; -use crate::service::geolonia::GeoloniaApiService; - -pub struct PrefectureMasterApi { - pub server_url: &'static str, -} - -impl Default for PrefectureMasterApi { - fn default() -> Self { - Self { - server_url: "https://yuukitoriyama.github.io/geolonia-japanese-addresses-accompanist", - } - } -} - -impl PrefectureMasterApi { - pub async fn get(&self, prefecture_name: &str) -> Result { - let endpoint = format!("{}/{}/master.json", self.server_url, prefecture_name); - let api_service = GeoloniaApiService {}; - api_service.get::(&endpoint).await - } - #[cfg(feature = "blocking")] - pub fn get_blocking(&self, prefecture_name: &str) -> Result { - let endpoint = format!("{}/{}/master.json", self.server_url, prefecture_name); - let api_service = GeoloniaApiService {}; - api_service.get_blocking::(&endpoint) - } -} - -#[cfg(all(test, not(feature = "blocking")))] -mod tests { - use crate::repository::geolonia::prefecture_master_api::PrefectureMasterApi; - - #[tokio::test] - async fn 非同期_富山県_成功() { - let prefecture_master_api: PrefectureMasterApi = Default::default(); - let result = prefecture_master_api.get("富山県").await; - let prefecture = result.unwrap(); - assert_eq!(prefecture.name, "富山県"); - let cities = vec![ - "富山市", - "高岡市", - "魚津市", - "氷見市", - "滑川市", - "黒部市", - "砺波市", - "小矢部市", - "南砺市", - "射水市", - "中新川郡舟橋村", - "中新川郡上市町", - "中新川郡立山町", - "下新川郡入善町", - "下新川郡朝日町", - ]; - for city in cities { - assert!(prefecture.cities.contains(&city.to_string())); - } - } - - #[tokio::test] - async fn 非同期_誤った都道府県名_失敗() { - let prefecture_master_api: PrefectureMasterApi = Default::default(); - let result = prefecture_master_api.get("大阪都").await; - assert!(result.is_err()); - assert_eq!( - result.err().unwrap().error_message, - format!( - "{}/大阪都/master.jsonを取得できませんでした", - prefecture_master_api.server_url - ) - ); - } -} - -#[cfg(all(test, feature = "blocking"))] -mod blocking_tests { - use crate::repository::geolonia::prefecture_master_api::PrefectureMasterApi; - - #[test] - fn 同期_富山県_成功() { - let prefecture_master_api: PrefectureMasterApi = Default::default(); - let result = prefecture_master_api.get_blocking("富山県"); - let prefecture = result.unwrap(); - assert_eq!(prefecture.name, "富山県"); - let cities = vec![ - "富山市", - "高岡市", - "魚津市", - "氷見市", - "滑川市", - "黒部市", - "砺波市", - "小矢部市", - "南砺市", - "射水市", - "中新川郡舟橋村", - "中新川郡上市町", - "中新川郡立山町", - "下新川郡入善町", - "下新川郡朝日町", - ]; - for city in cities { - assert!(prefecture.cities.contains(&city.to_string())); - } - } - - #[test] - fn 同期_誤った都道府県名_失敗() { - let prefecture_master_api: PrefectureMasterApi = Default::default(); - let result = prefecture_master_api.get_blocking("大阪都"); - assert!(result.is_err()); - assert_eq!( - result.err().unwrap().error_message, - format!( - "{}/大阪都/master.jsonを取得できませんでした", - prefecture_master_api.server_url - ) - ); - } -} From 8b7fd477c1af2bf383034ba4c1d36ba7240c5059 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Fri, 15 Nov 2024 00:16:24 +0900 Subject: [PATCH 08/41] =?UTF-8?q?fix:=20#473:=20`core::domain::geolonia::e?= =?UTF-8?q?ntity`=E3=81=AB=E5=AE=9A=E7=BE=A9=E3=81=97=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F=E3=83=86=E3=82=B9=E3=83=88=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E9=96=A2=E6=95=B0=E3=81=AB=E6=9C=AA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=AD=A6=E5=91=8A=E3=81=8C=E5=87=BA=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/domain/geolonia/entity.rs | 33 ++++++------------------------ 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/core/src/domain/geolonia/entity.rs b/core/src/domain/geolonia/entity.rs index 63f81573..86dd513d 100644 --- a/core/src/domain/geolonia/entity.rs +++ b/core/src/domain/geolonia/entity.rs @@ -6,18 +6,9 @@ pub struct Prefecture { pub cities: Vec, } -impl Prefecture { - // 主にテストコードで使用する - pub fn new(prefecture_name: &str, city_names: Vec<&str>) -> Self { - Prefecture { - name: prefecture_name.to_string(), - cities: city_names.iter().map(|s| s.to_string()).collect(), - } - } -} - #[derive(Debug)] pub struct City { + #[allow(dead_code)] pub name: String, pub towns: Vec, } @@ -32,18 +23,6 @@ pub struct Town { pub lng: Option, } -impl Town { - // 主にテストコードで使用する - pub fn new(town_name: &str, koaza_name: &str, lat: f32, lng: f32) -> Self { - Town { - name: town_name.to_string(), - koaza: koaza_name.to_string(), - lat: Some(lat), - lng: Some(lng), - } - } -} - #[derive(Serialize, PartialEq, Debug)] pub struct Address { pub prefecture: String, @@ -63,10 +42,10 @@ impl Address { } } -#[doc(hidden)] +#[cfg(test)] impl Prefecture { /// only for testing - pub fn yamagata() -> Self { + pub(crate) fn yamagata() -> Self { Prefecture { name: "山形県".to_string(), cities: vec![ @@ -110,7 +89,7 @@ impl Prefecture { } /// only for testing - pub fn fukushima() -> Self { + pub(crate) fn fukushima() -> Self { Prefecture { name: "福島県".to_string(), cities: vec![ @@ -178,7 +157,7 @@ impl Prefecture { } /// only for testing - pub fn fukui() -> Self { + pub(crate) fn fukui() -> Self { Prefecture { name: "福井県".to_string(), cities: vec![ @@ -204,7 +183,7 @@ impl Prefecture { } /// only for testing - pub fn saga() -> Self { + pub(crate) fn saga() -> Self { Prefecture { name: "佐賀県".to_string(), cities: vec![ From c08a9e64be0a1d3505fc3439b5b44ffd715f7922 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Fri, 15 Nov 2024 00:46:32 +0900 Subject: [PATCH 09/41] =?UTF-8?q?update:=20#473:=20`core::domain::geolonia?= =?UTF-8?q?`=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=AE?= =?UTF-8?q?=E4=BB=A5=E4=B8=8B=E3=81=AE=E6=A7=8B=E9=80=A0=E4=BD=93=E3=81=AE?= =?UTF-8?q?=E3=81=BF=E3=82=92public=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `entity::Address` - `error::Error` 公開している`ParseResult`のフィールドに含まれるため --- core/src/domain.rs | 4 ++-- core/src/domain/geolonia/entity.rs | 13 +++++++++---- core/src/domain/geolonia/error.rs | 8 ++++---- core/src/lib.rs | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/core/src/domain.rs b/core/src/domain.rs index d1184822..9d94f776 100644 --- a/core/src/domain.rs +++ b/core/src/domain.rs @@ -1,4 +1,4 @@ #[cfg(feature = "experimental")] -pub mod chimei_ruiju; -pub mod common; +pub(crate) mod chimei_ruiju; +pub(crate) mod common; pub mod geolonia; diff --git a/core/src/domain/geolonia/entity.rs b/core/src/domain/geolonia/entity.rs index 86dd513d..cf5994b3 100644 --- a/core/src/domain/geolonia/entity.rs +++ b/core/src/domain/geolonia/entity.rs @@ -1,20 +1,20 @@ use serde::{Deserialize, Serialize}; #[derive(Deserialize, PartialEq, Debug)] -pub struct Prefecture { +pub(crate) struct Prefecture { pub name: String, pub cities: Vec, } #[derive(Debug)] -pub struct City { +pub(crate) struct City { #[allow(dead_code)] pub name: String, pub towns: Vec, } #[derive(PartialEq, Deserialize, Debug)] -pub struct Town { +pub(crate) struct Town { #[serde(alias = "town")] pub name: String, pub koaza: String, @@ -32,7 +32,12 @@ pub struct Address { } impl Address { - pub fn new(prefecture_name: &str, city_name: &str, town_name: &str, rest_name: &str) -> Self { + pub(crate) fn new( + prefecture_name: &str, + city_name: &str, + town_name: &str, + rest_name: &str, + ) -> Self { Address { prefecture: prefecture_name.to_string(), city: city_name.to_string(), diff --git a/core/src/domain/geolonia/error.rs b/core/src/domain/geolonia/error.rs index 66aed401..b73f61aa 100644 --- a/core/src/domain/geolonia/error.rs +++ b/core/src/domain/geolonia/error.rs @@ -9,13 +9,13 @@ pub struct Error { } impl Error { - pub fn new_parse_error(parse_error_kind: ParseErrorKind) -> Self { + pub(crate) fn new_parse_error(parse_error_kind: ParseErrorKind) -> Self { Error { error_type: "ParseError".to_string(), error_message: parse_error_kind.to_string(), } } - pub fn new_api_error(api_error_kind: ApiErrorKind) -> Self { + pub(crate) fn new_api_error(api_error_kind: ApiErrorKind) -> Self { let error_message = match api_error_kind { ApiErrorKind::Fetch(url) => format!("{}を取得できませんでした", url), ApiErrorKind::Deserialize(url) => format!("{}のデシリアライズに失敗しました", url), @@ -27,7 +27,7 @@ impl Error { } } -pub enum ParseErrorKind { +pub(crate) enum ParseErrorKind { Prefecture, City, Town, @@ -44,7 +44,7 @@ impl Display for ParseErrorKind { } } -pub enum ApiErrorKind { +pub(crate) enum ApiErrorKind { Fetch(String), Deserialize(String), } diff --git a/core/src/lib.rs b/core/src/lib.rs index 2b92a7aa..83feb51d 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -14,7 +14,7 @@ compile_error! { } mod adapter; -pub(crate) mod domain; +pub mod domain; #[cfg(feature = "experimental")] #[cfg_attr(docsrs, doc(cfg(feature = "experimental")))] pub mod experimental; From f238ebbdb6cb8d3cd3c0dac16c2508d333721e83 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Fri, 15 Nov 2024 00:59:28 +0900 Subject: [PATCH 10/41] =?UTF-8?q?remove:=20#473:=20`dev-dependencies`?= =?UTF-8?q?=E3=81=8B=E3=82=89`criterion`=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 現在使用されていないため --- core/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/core/Cargo.toml b/core/Cargo.toml index fb632967..9b1e9cc3 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -33,7 +33,6 @@ thiserror = "1.0.63" jisx0401 = "0.1.0-beta.3" [dev-dependencies] -criterion = { version = "0.5.1", default-features = false, features = ["html_reports"] } tokio.workspace = true wasm-bindgen-test = { workspace = true } From 1e08985e67a31a65be8ef01576433ddbf092ba64 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Fri, 15 Nov 2024 01:08:38 +0900 Subject: [PATCH 11/41] update-version: 0.1.24 -> 0.2.0-rc.1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 59c3baa9..25c3ed6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.1.24" +version = "0.2.0-rc.1" edition = "2021" description = "A Rust Library to parse japanese addresses." repository = "https://github.com/YuukiToriyama/japanese-address-parser" From 85eb1969ec8780db6e538b0443f48516ccf97a10 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Fri, 15 Nov 2024 01:10:20 +0900 Subject: [PATCH 12/41] =?UTF-8?q?update:=20=E3=82=AF=E3=83=AC=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=AE`description`=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 25c3ed6e..92d98d5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ resolver = "2" [workspace.package] version = "0.2.0-rc.1" edition = "2021" -description = "A Rust Library to parse japanese addresses." +description = "A library for processing addresses of Japan" repository = "https://github.com/YuukiToriyama/japanese-address-parser" authors = ["Yuuki Toriyama "] license = "MIT" From 368c4270dba3d831d478037abff5f50c90076016 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 16:59:56 +0900 Subject: [PATCH 13/41] =?UTF-8?q?update:=20#535:=20`#[wasm=5Fbindgen(start?= =?UTF-8?q?)]=20fn=20start()`=E3=81=AE=E5=AE=9A=E7=BE=A9=E7=AE=87=E6=89=80?= =?UTF-8?q?=E3=82=92`nightly.rs`=E3=81=8B=E3=82=89`lib.rs`=E3=81=AB?= =?UTF-8?q?=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wasm/src/lib.rs | 6 ++++++ wasm/src/nightly.rs | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wasm/src/lib.rs b/wasm/src/lib.rs index 5054d856..0334f25e 100644 --- a/wasm/src/lib.rs +++ b/wasm/src/lib.rs @@ -5,6 +5,12 @@ use japanese_address_parser::parser; use wasm_bindgen::prelude::wasm_bindgen; use wasm_bindgen::JsValue; +#[wasm_bindgen(start)] +fn start() { + #[cfg(feature = "nightly")] + console_log::init_with_level(log::Level::Trace).expect("could not initialize log"); +} + #[wasm_bindgen(typescript_custom_section)] const TYPESCRIPT_TYPE: &'static str = r#" export interface ParseResult { diff --git a/wasm/src/nightly.rs b/wasm/src/nightly.rs index bbe07dea..4e6e868d 100644 --- a/wasm/src/nightly.rs +++ b/wasm/src/nightly.rs @@ -30,11 +30,6 @@ export interface ParsedAddress { metadata: Metadata; }"#; -#[wasm_bindgen(start)] -fn start() { - console_log::init_with_level(log::Level::Trace).expect("could not initialize log"); -} - #[derive(Deserialize)] pub struct Options { #[serde(alias = "dataSource")] From 106a23095db1f64c44d7a8466c1fbd6cef2366a5 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 17:01:59 +0900 Subject: [PATCH 14/41] =?UTF-8?q?update:=20#535:=20`console=5Ferror=5Fpani?= =?UTF-8?q?c=5Fhook::set=5Fonce()`=E3=81=AE=E5=91=BC=E3=81=B3=E5=87=BA?= =?UTF-8?q?=E3=81=97=E7=AE=87=E6=89=80=E3=82=92`#[wasm=5Fbindgen(start)]?= =?UTF-8?q?=20fn=20start()`=E3=81=AB=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wasm/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wasm/src/lib.rs b/wasm/src/lib.rs index 0334f25e..365e5ece 100644 --- a/wasm/src/lib.rs +++ b/wasm/src/lib.rs @@ -7,6 +7,8 @@ use wasm_bindgen::JsValue; #[wasm_bindgen(start)] fn start() { + #[cfg(feature = "debug")] + console_error_panic_hook::set_once(); #[cfg(feature = "nightly")] console_log::init_with_level(log::Level::Trace).expect("could not initialize log"); } @@ -47,8 +49,6 @@ pub struct Parser { impl Parser { #[wasm_bindgen(constructor)] pub fn new() -> Self { - #[cfg(feature = "debug")] - console_error_panic_hook::set_once(); Parser { parser: parser::Parser::default(), } From ea2ce3b644bc39c3ab1ff12ff799c013c0f44a1f Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 17:28:15 +0900 Subject: [PATCH 15/41] =?UTF-8?q?update:=20#455:=20=E3=80=8C=E7=A5=9E?= =?UTF-8?q?=E4=BB=A3=E5=9B=BD=E8=A1=99=E3=80=8D=E3=81=A8=E3=80=8C=E7=A5=9E?= =?UTF-8?q?=E4=BB=A3=E5=9C=8B=E8=A1=99=E3=80=8D=E3=81=AE=E8=A1=A8=E8=A8=98?= =?UTF-8?q?=E3=82=86=E3=82=8C=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/adapter/orthographical_variant_adapter.rs | 2 ++ core/src/tokenizer/read_town.rs | 1 + ...75\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 +++ 3 files changed, 6 insertions(+) diff --git a/core/src/adapter/orthographical_variant_adapter.rs b/core/src/adapter/orthographical_variant_adapter.rs index 7fba398a..56f38227 100644 --- a/core/src/adapter/orthographical_variant_adapter.rs +++ b/core/src/adapter/orthographical_variant_adapter.rs @@ -28,6 +28,7 @@ pub enum OrthographicalVariant { 濱, 祗, 曾, + 國, } impl OrthographicalVariant { @@ -61,6 +62,7 @@ impl OrthographicalVariant { OrthographicalVariant::濱 => &['濱', '浜'], OrthographicalVariant::祗 => &['祗', '祇'], OrthographicalVariant::曾 => &['曾', '曽'], + OrthographicalVariant::國 => &['國', '国'], } } diff --git a/core/src/tokenizer/read_town.rs b/core/src/tokenizer/read_town.rs index 7474f747..0f41f9f0 100644 --- a/core/src/tokenizer/read_town.rs +++ b/core/src/tokenizer/read_town.rs @@ -90,6 +90,7 @@ fn find_town(input: &str, candidates: &Vec) -> Option<(String, String)> OrthographicalVariant::濱, OrthographicalVariant::祗, OrthographicalVariant::曾, + OrthographicalVariant::國, ], }; if let Some(result) = adapter.apply(input, candidate) { diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" index 8afeb572..de962e26 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -84,3 +84,6 @@ address,prefecture,city,town,rest # 「小曾根」と「小曽根」の表記ゆれへの対応 埼玉県熊谷市小曽根1220,埼玉県,熊谷市,小曽根,1220 埼玉県熊谷市小曾根1220,埼玉県,熊谷市,小曽根,1220 +# 「神代國衙」と「神代国衙」の表記揺れへの対応 +兵庫県南あわじ市神代國衙1680,兵庫県,南あわじ市,神代國衙,1680 +兵庫県南あわじ市神代国衙1680,兵庫県,南あわじ市,神代國衙,1680 From 21d91cce8798cb77854897699cb8b051310cfee9 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 17:45:52 +0900 Subject: [PATCH 16/41] =?UTF-8?q?update:=20#458:=20=E3=80=8C=E4=B8=8A?= =?UTF-8?q?=E6=B0=B7=E9=89=8B=E3=80=8D=E3=81=A8=E3=80=8C=E4=B8=8A=E6=B0=B7?= =?UTF-8?q?=E9=A3=BD=E3=80=8D=E3=81=AE=E8=A1=A8=E8=A8=98=E3=82=86=E3=82=8C?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/adapter/orthographical_variant_adapter.rs | 2 ++ core/src/tokenizer/read_town.rs | 1 + ...02\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 +++ 3 files changed, 6 insertions(+) diff --git a/core/src/adapter/orthographical_variant_adapter.rs b/core/src/adapter/orthographical_variant_adapter.rs index 56f38227..2dbef93b 100644 --- a/core/src/adapter/orthographical_variant_adapter.rs +++ b/core/src/adapter/orthographical_variant_adapter.rs @@ -29,6 +29,7 @@ pub enum OrthographicalVariant { 祗, 曾, 國, + 鉋, } impl OrthographicalVariant { @@ -63,6 +64,7 @@ impl OrthographicalVariant { OrthographicalVariant::祗 => &['祗', '祇'], OrthographicalVariant::曾 => &['曾', '曽'], OrthographicalVariant::國 => &['國', '国'], + OrthographicalVariant::鉋 => &['鉋', '飽'], } } diff --git a/core/src/tokenizer/read_town.rs b/core/src/tokenizer/read_town.rs index 0f41f9f0..564e273e 100644 --- a/core/src/tokenizer/read_town.rs +++ b/core/src/tokenizer/read_town.rs @@ -91,6 +91,7 @@ fn find_town(input: &str, candidates: &Vec) -> Option<(String, String)> OrthographicalVariant::祗, OrthographicalVariant::曾, OrthographicalVariant::國, + OrthographicalVariant::鉋, ], }; if let Some(result) = adapter.apply(input, candidate) { diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" index 4c1b0914..f19ab02e 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -3,3 +3,6 @@ address,prefecture,city,town,rest 神奈川県鎌倉市山ノ内189,神奈川県,鎌倉市,山ノ内,189 神奈川県鎌倉市山の内189,神奈川県,鎌倉市,山ノ内,189 神奈川県鎌倉市山之内189,神奈川県,鎌倉市,山ノ内,189 +# 「上氷鉋」と「上氷飽」の表記揺れへの対応 +長野県長野市川中島町上氷鉋1368,長野県,長野市,川中島町上氷鉋,1368 +長野県長野市川中島町上氷飽1368,長野県,長野市,川中島町上氷鉋,1368 From 493fe895a505f827671d105ebb574e8a6348bcfa Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 17:56:57 +0900 Subject: [PATCH 17/41] =?UTF-8?q?update:=20#451:=20=E3=80=8C=E9=B7=8F?= =?UTF-8?q?=E5=92=8C=E3=80=8D=E3=81=A8=E3=80=8C=E9=B7=86=E5=92=8C=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E8=A8=98=E3=82=86=E3=82=8C=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/adapter/orthographical_variant_adapter.rs | 2 ++ core/src/tokenizer/read_town.rs | 1 + ...75\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 +++ 3 files changed, 6 insertions(+) diff --git a/core/src/adapter/orthographical_variant_adapter.rs b/core/src/adapter/orthographical_variant_adapter.rs index 2dbef93b..1e51c4dd 100644 --- a/core/src/adapter/orthographical_variant_adapter.rs +++ b/core/src/adapter/orthographical_variant_adapter.rs @@ -30,6 +30,7 @@ pub enum OrthographicalVariant { 曾, 國, 鉋, + 鷆, } impl OrthographicalVariant { @@ -65,6 +66,7 @@ impl OrthographicalVariant { OrthographicalVariant::曾 => &['曾', '曽'], OrthographicalVariant::國 => &['國', '国'], OrthographicalVariant::鉋 => &['鉋', '飽'], + OrthographicalVariant::鷆 => &['鷆', '鷏'], } } diff --git a/core/src/tokenizer/read_town.rs b/core/src/tokenizer/read_town.rs index 564e273e..a10d4c7b 100644 --- a/core/src/tokenizer/read_town.rs +++ b/core/src/tokenizer/read_town.rs @@ -92,6 +92,7 @@ fn find_town(input: &str, candidates: &Vec) -> Option<(String, String)> OrthographicalVariant::曾, OrthographicalVariant::國, OrthographicalVariant::鉋, + OrthographicalVariant::鷆, ], }; if let Some(result) = adapter.apply(input, candidate) { diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" index de962e26..e4d86a79 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -87,3 +87,6 @@ address,prefecture,city,town,rest # 「神代國衙」と「神代国衙」の表記揺れへの対応 兵庫県南あわじ市神代國衙1680,兵庫県,南あわじ市,神代國衙,1680 兵庫県南あわじ市神代国衙1680,兵庫県,南あわじ市,神代國衙,1680 +# 「鷏和」と「鷆和」の表記揺れへの対応 +兵庫県赤穂市鷏和422,兵庫県,赤穂市,鷏和,422 +兵庫県赤穂市鷆和422,兵庫県,赤穂市,鷏和,422 From 5b1fafb21922c61a2de172c472a321cc14f7dc32 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 18:08:45 +0900 Subject: [PATCH 18/41] =?UTF-8?q?update:=20#408:=20=E3=80=8C=E7=8F=AD?= =?UTF-8?q?=E7=9B=AE=E3=80=8D=E3=81=A8=E3=80=8C=E6=96=91=E7=9B=AE=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E8=A8=98=E3=82=86=E3=82=8C=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/adapter/orthographical_variant_adapter.rs | 2 ++ core/src/tokenizer/read_town.rs | 1 + ...02\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 +++ 3 files changed, 6 insertions(+) diff --git a/core/src/adapter/orthographical_variant_adapter.rs b/core/src/adapter/orthographical_variant_adapter.rs index 1e51c4dd..da053bcc 100644 --- a/core/src/adapter/orthographical_variant_adapter.rs +++ b/core/src/adapter/orthographical_variant_adapter.rs @@ -31,6 +31,7 @@ pub enum OrthographicalVariant { 國, 鉋, 鷆, + 斑, } impl OrthographicalVariant { @@ -67,6 +68,7 @@ impl OrthographicalVariant { OrthographicalVariant::國 => &['國', '国'], OrthographicalVariant::鉋 => &['鉋', '飽'], OrthographicalVariant::鷆 => &['鷆', '鷏'], + OrthographicalVariant::斑 => &['斑', '班'], } } diff --git a/core/src/tokenizer/read_town.rs b/core/src/tokenizer/read_town.rs index a10d4c7b..defaffcf 100644 --- a/core/src/tokenizer/read_town.rs +++ b/core/src/tokenizer/read_town.rs @@ -93,6 +93,7 @@ fn find_town(input: &str, candidates: &Vec) -> Option<(String, String)> OrthographicalVariant::國, OrthographicalVariant::鉋, OrthographicalVariant::鷆, + OrthographicalVariant::斑, ], }; if let Some(result) = adapter.apply(input, candidate) { diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" index f19ab02e..ba065e89 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -6,3 +6,6 @@ address,prefecture,city,town,rest # 「上氷鉋」と「上氷飽」の表記揺れへの対応 長野県長野市川中島町上氷鉋1368,長野県,長野市,川中島町上氷鉋,1368 長野県長野市川中島町上氷飽1368,長野県,長野市,川中島町上氷鉋,1368 +# 「斑目」と「班目」の表記揺れへの対応 +神奈川県南足柄市班目639,神奈川県,南足柄市,班目,639 +神奈川県南足柄市斑目639,神奈川県,南足柄市,班目,639 From d47240eba85563e6be8c87f98a16c965784e4aee Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 18:22:36 +0900 Subject: [PATCH 19/41] =?UTF-8?q?update:=20#456:=20=E3=80=8C=E5=8D=97?= =?UTF-8?q?=E6=AB=BB=E3=80=8D=E3=81=A8=E3=80=8C=E5=8D=97=E6=A1=9C=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E8=A8=98=E3=82=86=E3=82=8C=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/adapter/orthographical_variant_adapter.rs | 2 ++ core/src/tokenizer/read_town.rs | 1 + ...75\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 +++ 3 files changed, 6 insertions(+) diff --git a/core/src/adapter/orthographical_variant_adapter.rs b/core/src/adapter/orthographical_variant_adapter.rs index da053bcc..069d5904 100644 --- a/core/src/adapter/orthographical_variant_adapter.rs +++ b/core/src/adapter/orthographical_variant_adapter.rs @@ -32,6 +32,7 @@ pub enum OrthographicalVariant { 鉋, 鷆, 斑, + 櫻, } impl OrthographicalVariant { @@ -69,6 +70,7 @@ impl OrthographicalVariant { OrthographicalVariant::鉋 => &['鉋', '飽'], OrthographicalVariant::鷆 => &['鷆', '鷏'], OrthographicalVariant::斑 => &['斑', '班'], + OrthographicalVariant::櫻 => &['櫻', '桜'], } } diff --git a/core/src/tokenizer/read_town.rs b/core/src/tokenizer/read_town.rs index defaffcf..dfe36715 100644 --- a/core/src/tokenizer/read_town.rs +++ b/core/src/tokenizer/read_town.rs @@ -94,6 +94,7 @@ fn find_town(input: &str, candidates: &Vec) -> Option<(String, String)> OrthographicalVariant::鉋, OrthographicalVariant::鷆, OrthographicalVariant::斑, + OrthographicalVariant::櫻, ], }; if let Some(result) = adapter.apply(input, candidate) { diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" index e4d86a79..11f9e596 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -90,3 +90,6 @@ address,prefecture,city,town,rest # 「鷏和」と「鷆和」の表記揺れへの対応 兵庫県赤穂市鷏和422,兵庫県,赤穂市,鷏和,422 兵庫県赤穂市鷆和422,兵庫県,赤穂市,鷏和,422 +# 「南桜」と「南櫻」の表記揺れへの対応 +滋賀県野洲市南桜1792,滋賀県,野洲市,南櫻,1792 +滋賀県野洲市南櫻1792,滋賀県,野洲市,南櫻,1792 From c32547c2b0bf7aa2148fe85e47f253bbccc278e1 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 18:33:32 +0900 Subject: [PATCH 20/41] =?UTF-8?q?update:=20#454:=20=E3=80=8C=E6=9D=BE?= =?UTF-8?q?=E5=B8=86=E6=93=BD=E7=94=B0=E3=80=8D=E3=81=A8=E3=80=8C=E6=9D=BE?= =?UTF-8?q?=E5=B8=86=E6=AB=9F=E7=94=B0=E3=80=8D=E3=81=AE=E8=A1=A8=E8=A8=98?= =?UTF-8?q?=E3=82=86=E3=82=8C=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/adapter/orthographical_variant_adapter.rs | 2 ++ core/src/tokenizer/read_town.rs | 1 + ...02\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 +++ 3 files changed, 6 insertions(+) diff --git a/core/src/adapter/orthographical_variant_adapter.rs b/core/src/adapter/orthographical_variant_adapter.rs index 069d5904..cc73589b 100644 --- a/core/src/adapter/orthographical_variant_adapter.rs +++ b/core/src/adapter/orthographical_variant_adapter.rs @@ -33,6 +33,7 @@ pub enum OrthographicalVariant { 鷆, 斑, 櫻, + 櫟, } impl OrthographicalVariant { @@ -71,6 +72,7 @@ impl OrthographicalVariant { OrthographicalVariant::鷆 => &['鷆', '鷏'], OrthographicalVariant::斑 => &['斑', '班'], OrthographicalVariant::櫻 => &['櫻', '桜'], + OrthographicalVariant::櫟 => &['櫟', '擽'], } } diff --git a/core/src/tokenizer/read_town.rs b/core/src/tokenizer/read_town.rs index dfe36715..4789b608 100644 --- a/core/src/tokenizer/read_town.rs +++ b/core/src/tokenizer/read_town.rs @@ -95,6 +95,7 @@ fn find_town(input: &str, candidates: &Vec) -> Option<(String, String)> OrthographicalVariant::鷆, OrthographicalVariant::斑, OrthographicalVariant::櫻, + OrthographicalVariant::櫟, ], }; if let Some(result) = adapter.apply(input, candidate) { diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" index ba065e89..f76a6bd8 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\343\201\247\343\201\257\343\201\252\343\201\204\350\241\250\350\250\230\343\202\206\343\202\214\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -9,3 +9,6 @@ address,prefecture,city,town,rest # 「斑目」と「班目」の表記揺れへの対応 神奈川県南足柄市班目639,神奈川県,南足柄市,班目,639 神奈川県南足柄市斑目639,神奈川県,南足柄市,班目,639 +# 「櫟」と「擽」の表記ゆれへの対応 +兵庫県南あわじ市松帆櫟田196,兵庫県,南あわじ市,松帆櫟田,196 +兵庫県南あわじ市松帆擽田196,兵庫県,南あわじ市,松帆櫟田,196 From 09bc73c2fc04d155b0028dbe50ab97127183960f Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 18:45:38 +0900 Subject: [PATCH 21/41] =?UTF-8?q?update:=20#452:=20=E3=80=8C=E5=90=89?= =?UTF-8?q?=E5=86=A8=E3=80=8D=E3=81=A8=E3=80=8C=E5=90=89=E5=AF=8C=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E8=A8=98=E3=82=86=E3=82=8C=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/adapter/orthographical_variant_adapter.rs | 2 ++ core/src/tokenizer/read_town.rs | 1 + ...75\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 +++ 3 files changed, 6 insertions(+) diff --git a/core/src/adapter/orthographical_variant_adapter.rs b/core/src/adapter/orthographical_variant_adapter.rs index cc73589b..05aaf730 100644 --- a/core/src/adapter/orthographical_variant_adapter.rs +++ b/core/src/adapter/orthographical_variant_adapter.rs @@ -34,6 +34,7 @@ pub enum OrthographicalVariant { 斑, 櫻, 櫟, + 冨, } impl OrthographicalVariant { @@ -73,6 +74,7 @@ impl OrthographicalVariant { OrthographicalVariant::斑 => &['斑', '班'], OrthographicalVariant::櫻 => &['櫻', '桜'], OrthographicalVariant::櫟 => &['櫟', '擽'], + OrthographicalVariant::冨 => &['冨', '富'], } } diff --git a/core/src/tokenizer/read_town.rs b/core/src/tokenizer/read_town.rs index 4789b608..517bb363 100644 --- a/core/src/tokenizer/read_town.rs +++ b/core/src/tokenizer/read_town.rs @@ -96,6 +96,7 @@ fn find_town(input: &str, candidates: &Vec) -> Option<(String, String)> OrthographicalVariant::斑, OrthographicalVariant::櫻, OrthographicalVariant::櫟, + OrthographicalVariant::冨, ], }; if let Some(result) = adapter.apply(input, candidate) { diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" index 11f9e596..459577f9 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -93,3 +93,6 @@ address,prefecture,city,town,rest # 「南桜」と「南櫻」の表記揺れへの対応 滋賀県野洲市南桜1792,滋賀県,野洲市,南櫻,1792 滋賀県野洲市南櫻1792,滋賀県,野洲市,南櫻,1792 +# 「富」と「冨」の表記ゆれへの対応 +兵庫県神崎郡神河町吉冨88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号 +兵庫県神崎郡神河町吉富88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号 From 7fbafc5f621fefb3875d4dc3fcc3ef011059281c Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 16 Nov 2024 18:56:41 +0900 Subject: [PATCH 22/41] update-version: 0.2.0-rc.1 -> 0.2.0-rc.2 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 92d98d5a..febc3bd0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.2.0-rc.1" +version = "0.2.0-rc.2" edition = "2021" description = "A library for processing addresses of Japan" repository = "https://github.com/YuukiToriyama/japanese-address-parser" From c86eef25eb58d8577d78621c4b0e66e33192ee46 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Mon, 18 Nov 2024 22:49:27 +0900 Subject: [PATCH 23/41] =?UTF-8?q?update:=20=E3=83=A9=E3=82=A4=E3=82=BB?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=81=AB=E3=81=8A=E3=81=91=E3=82=8B=E8=91=97?= =?UTF-8?q?=E4=BD=9C=E6=A8=A9=E8=80=85=E3=81=AE=E6=B0=8F=E5=90=8D=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ToriChan` -> `Yuuki Toriyama` --- LICENSE | 2 +- wasm/LICENSE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 09fdfd2d..2c98bacc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 ToriChan +Copyright (c) 2023-2024 Yuuki Toriyama Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/wasm/LICENSE b/wasm/LICENSE index 09fdfd2d..2c98bacc 100644 --- a/wasm/LICENSE +++ b/wasm/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 ToriChan +Copyright (c) 2023-2024 Yuuki Toriyama Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 745c1751a24fbe095010625918226e216e2a7944 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 20:50:56 +0900 Subject: [PATCH 24/41] update-version: 0.2.0-rc.2 -> 0.2.0-rc.3 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index febc3bd0..a7653314 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.2.0-rc.2" +version = "0.2.0-rc.3" edition = "2021" description = "A library for processing addresses of Japan" repository = "https://github.com/YuukiToriyama/japanese-address-parser" From 2e0a8cc482ff8592661011b4f9cf12a71145eaaa Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 20:58:07 +0900 Subject: [PATCH 25/41] =?UTF-8?q?update:=20#552:=20=E3=80=8C=E8=AB=AB?= =?UTF-8?q?=E3=80=8D=E3=81=A8=E3=80=8C=E8=AB=8C=E3=80=8D=E3=81=AE=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E3=82=86=E3=82=8C=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=82=B1=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...75\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 +++ 1 file changed, 3 insertions(+) diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" index 459577f9..c50223b2 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -96,3 +96,6 @@ address,prefecture,city,town,rest # 「富」と「冨」の表記ゆれへの対応 兵庫県神崎郡神河町吉冨88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号 兵庫県神崎郡神河町吉富88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号 +# 「諫」と「諌」の表記ゆれへの対応 +長崎県諫早市東小路町7-1,長崎県,諫早市,東小路町,7-1 +長崎県諌早市東小路町7-1,長崎県,諫早市,東小路町,7-1 From e07f7ad5d9045183bee2abada823535c8f822331 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 20:59:21 +0900 Subject: [PATCH 26/41] =?UTF-8?q?update:=20#552:=20=E5=B8=82=E5=8C=BA?= =?UTF-8?q?=E7=94=BA=E6=9D=91=E5=90=8D=E3=81=AE=E6=A4=9C=E5=87=BA=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6=E3=80=8C=E8=AB=AB?= =?UTF-8?q?=E3=80=8D=E3=81=A8=E3=80=8C=E8=AB=8C=E3=80=8D=E3=81=AE=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E3=82=86=E3=82=8C=E3=82=92=E8=80=83=E6=85=AE=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/adapter/orthographical_variant_adapter.rs | 2 ++ core/src/tokenizer/read_city.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/core/src/adapter/orthographical_variant_adapter.rs b/core/src/adapter/orthographical_variant_adapter.rs index 05aaf730..51222cf3 100644 --- a/core/src/adapter/orthographical_variant_adapter.rs +++ b/core/src/adapter/orthographical_variant_adapter.rs @@ -35,6 +35,7 @@ pub enum OrthographicalVariant { 櫻, 櫟, 冨, + 諫, } impl OrthographicalVariant { @@ -75,6 +76,7 @@ impl OrthographicalVariant { OrthographicalVariant::櫻 => &['櫻', '桜'], OrthographicalVariant::櫟 => &['櫟', '擽'], OrthographicalVariant::冨 => &['冨', '富'], + OrthographicalVariant::諫 => &['諫', '諌'], } } diff --git a/core/src/tokenizer/read_city.rs b/core/src/tokenizer/read_city.rs index 0233f777..57e6f63a 100644 --- a/core/src/tokenizer/read_city.rs +++ b/core/src/tokenizer/read_city.rs @@ -53,6 +53,9 @@ impl Tokenizer { Some("福岡県") => { variant_list.push(OrthographicalVariant::恵); } + Some("長崎県") => { + variant_list.push(OrthographicalVariant::諫); + } _ => {} } for candidate in candidates { From 0ba91cbcffb9d43b4b51c3e8af759feeba7e67ff Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 21:11:09 +0900 Subject: [PATCH 27/41] =?UTF-8?q?update:=20#549:=20=E3=80=8C=E9=B0=BA?= =?UTF-8?q?=E3=80=8D=E3=81=A8=E3=80=8C=E9=AF=B5=E3=80=8D=E3=81=AE=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E3=82=86=E3=82=8C=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=82=B1=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...01\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" | 3 +++ 1 file changed, 3 insertions(+) diff --git "a/tests/test_data/\345\270\202\345\214\272\347\224\272\346\235\221\345\220\215\343\203\254\343\203\231\343\203\253\343\201\247\343\201\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" "b/tests/test_data/\345\270\202\345\214\272\347\224\272\346\235\221\345\220\215\343\203\254\343\203\231\343\203\253\343\201\247\343\201\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" index 5b526087..3f053c58 100644 --- "a/tests/test_data/\345\270\202\345\214\272\347\224\272\346\235\221\345\220\215\343\203\254\343\203\231\343\203\253\343\201\247\343\201\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" +++ "b/tests/test_data/\345\270\202\345\214\272\347\224\272\346\235\221\345\220\215\343\203\254\343\203\231\343\203\253\343\201\247\343\201\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" @@ -1,4 +1,7 @@ address,prefecture,city,town,rest +# 青森県 +青森県西津軽郡鰺ヶ沢町大字舞戸町字鳴戸321番地,青森県,西津軽郡鰺ヶ沢町,大字舞戸町,字鳴戸321番地 +青森県西津軽郡鯵ヶ沢町大字舞戸町字鳴戸321番地,青森県,西津軽郡鰺ヶ沢町,大字舞戸町,字鳴戸321番地 # 宮城県 宮城県塩竈市海岸通15-1,宮城県,塩竈市,海岸通,15-1 宮城県塩釜市海岸通15-1,宮城県,塩竈市,海岸通,15-1 From 8d96a80a82314a407c238c3ab6b1ffef097d5fc9 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 21:11:38 +0900 Subject: [PATCH 28/41] =?UTF-8?q?update:=20#549:=20=E5=B8=82=E5=8C=BA?= =?UTF-8?q?=E7=94=BA=E6=9D=91=E5=90=8D=E3=81=AE=E6=A4=9C=E5=87=BA=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6=E3=80=8C=E9=B0=BA?= =?UTF-8?q?=E3=80=8D=E3=81=A8=E3=80=8C=E9=AF=B5=E3=80=8D=E3=81=AE=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E3=82=86=E3=82=8C=E3=82=92=E8=80=83=E6=85=AE=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/adapter/orthographical_variant_adapter.rs | 2 ++ core/src/tokenizer/read_city.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/core/src/adapter/orthographical_variant_adapter.rs b/core/src/adapter/orthographical_variant_adapter.rs index 05aaf730..2718f459 100644 --- a/core/src/adapter/orthographical_variant_adapter.rs +++ b/core/src/adapter/orthographical_variant_adapter.rs @@ -10,6 +10,7 @@ pub enum OrthographicalVariant { 竈, 嶋, 舘, + 鰺, 脊, 渕, 己, @@ -50,6 +51,7 @@ impl OrthographicalVariant { OrthographicalVariant::竈 => &['竈', '竃', '釜'], OrthographicalVariant::嶋 => &['嶋', '島'], OrthographicalVariant::舘 => &['舘', '館'], + OrthographicalVariant::鰺 => &['鰺', '鯵'], OrthographicalVariant::脊 => &['脊', '背'], OrthographicalVariant::渕 => &['渕', '淵'], OrthographicalVariant::己 => &['己', '巳'], diff --git a/core/src/tokenizer/read_city.rs b/core/src/tokenizer/read_city.rs index 0233f777..ec47f311 100644 --- a/core/src/tokenizer/read_city.rs +++ b/core/src/tokenizer/read_city.rs @@ -33,6 +33,7 @@ impl Tokenizer { match self.get_prefecture_name() { Some("青森県") => { variant_list.push(OrthographicalVariant::舘); + variant_list.push(OrthographicalVariant::鰺); } Some("宮城県") => { variant_list.push(OrthographicalVariant::竈); From 95b9ff407f7f748661ef7a92ec3befb7db3fcaa0 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 21:22:11 +0900 Subject: [PATCH 29/41] =?UTF-8?q?update:=20#549:=20=E7=94=BA=E5=90=8D?= =?UTF-8?q?=E3=83=AC=E3=83=99=E3=83=AB=E3=81=A7=E3=82=82=E3=80=8C=E9=B0=BA?= =?UTF-8?q?=E3=80=8D=E3=81=A8=E3=80=8C=E9=AF=B5=E3=80=8D=E3=81=AE=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E3=82=86=E3=82=8C=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/tokenizer/read_town.rs | 1 + ...75\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 +++ 2 files changed, 4 insertions(+) diff --git a/core/src/tokenizer/read_town.rs b/core/src/tokenizer/read_town.rs index 517bb363..cab113fa 100644 --- a/core/src/tokenizer/read_town.rs +++ b/core/src/tokenizer/read_town.rs @@ -73,6 +73,7 @@ fn find_town(input: &str, candidates: &Vec) -> Option<(String, String)> OrthographicalVariant::檜, OrthographicalVariant::竈, OrthographicalVariant::舘, + OrthographicalVariant::鰺, OrthographicalVariant::脊, OrthographicalVariant::渕, OrthographicalVariant::己, diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" index 459577f9..6ca27f7f 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -96,3 +96,6 @@ address,prefecture,city,town,rest # 「富」と「冨」の表記ゆれへの対応 兵庫県神崎郡神河町吉冨88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号 兵庫県神崎郡神河町吉富88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号 +# 「鰺」と「鯵」の表記ゆれへの対応 +新潟県新潟市南区鯵潟423,新潟県,新潟市南区,鯵潟,423 +新潟県新潟市南区鰺潟423,新潟県,新潟市南区,鯵潟,423 From 4dfaec552a8ef0b0ee64bfc058e8df83c918abfe Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 21:24:07 +0900 Subject: [PATCH 30/41] =?UTF-8?q?fix:=20#552:=20=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=B1=E3=83=BC=E3=82=B9=E3=81=AE=E8=A8=98=E8=BC=89?= =?UTF-8?q?=E5=A0=B4=E6=89=80=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...01\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" | 3 +++ ...75\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git "a/tests/test_data/\345\270\202\345\214\272\347\224\272\346\235\221\345\220\215\343\203\254\343\203\231\343\203\253\343\201\247\343\201\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" "b/tests/test_data/\345\270\202\345\214\272\347\224\272\346\235\221\345\220\215\343\203\254\343\203\231\343\203\253\343\201\247\343\201\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" index 5b526087..1c5f3027 100644 --- "a/tests/test_data/\345\270\202\345\214\272\347\224\272\346\235\221\345\220\215\343\203\254\343\203\231\343\203\253\343\201\247\343\201\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" +++ "b/tests/test_data/\345\270\202\345\214\272\347\224\272\346\235\221\345\220\215\343\203\254\343\203\231\343\203\253\343\201\247\343\201\256\350\241\250\350\250\230\343\202\206\343\202\214.csv" @@ -10,3 +10,6 @@ address,prefecture,city,town,rest 兵庫県宝塚市売布東の町8-19,兵庫県,宝塚市,売布東の町,8-19 兵庫県宝塚市武庫川町1-1,兵庫県,宝塚市,武庫川町,1-1 兵庫県宝塚市武庫川町1-1,兵庫県,宝塚市,武庫川町,1-1 +# 長崎県 +長崎県諫早市東小路町7-1,長崎県,諫早市,東小路町,7-1 +長崎県諌早市東小路町7-1,長崎県,諫早市,東小路町,7-1 diff --git "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" index c50223b2..459577f9 100644 --- "a/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" +++ "b/tests/test_data/\347\225\260\345\255\227\344\275\223\346\227\247\345\255\227\344\275\223\343\201\270\343\201\256\345\257\276\345\277\234.csv" @@ -96,6 +96,3 @@ address,prefecture,city,town,rest # 「富」と「冨」の表記ゆれへの対応 兵庫県神崎郡神河町吉冨88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号 兵庫県神崎郡神河町吉富88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号 -# 「諫」と「諌」の表記ゆれへの対応 -長崎県諫早市東小路町7-1,長崎県,諫早市,東小路町,7-1 -長崎県諌早市東小路町7-1,長崎県,諫早市,東小路町,7-1 From 45fabdc45c389bbd021b91d7e4fd99d683056818 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 21:45:05 +0900 Subject: [PATCH 31/41] =?UTF-8?q?update:=20#534:=20python=E3=82=AF?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=83=88=E3=81=A7=E4=BD=BF=E7=94=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B=E3=82=AF=E3=83=AC=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=82=92=E6=9C=80=E6=96=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/Cargo.toml b/python/Cargo.toml index 9c38f501..5b435843 100644 --- a/python/Cargo.toml +++ b/python/Cargo.toml @@ -17,4 +17,4 @@ crate-type = ["cdylib"] [dependencies] japanese-address-parser = { path = "../core", features = ["blocking"] } -pyo3 = { version = "0.22.0", features = ["abi3-py37"] } +pyo3 = { version = "0.23.2", features = ["abi3-py37"] } From bef06bdc7f15c03e31e0b86b679e693e90eb7269 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 21:51:17 +0900 Subject: [PATCH 32/41] =?UTF-8?q?update:=20#534:=20wasm=E3=82=AF=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=A7=E4=BD=BF=E7=94=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=82=AF=E3=83=AC=E3=83=BC=E3=83=88=E3=82=92?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wasm/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 59db0218..2372d2da 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -27,7 +27,7 @@ nightly = [ [dependencies] console_error_panic_hook = "0.1.7" japanese-address-parser = { path = "../core" } -serde-wasm-bindgen = "0.6.1" +serde-wasm-bindgen = "0.6.5" wasm-bindgen = { workspace = true } wasm-bindgen-futures = { workspace = true } # 以下は`nightly`が有効な場合のみ使用される From b321faf18fc923d3f952bb5dc5661f1b99eefe9b Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 21:53:00 +0900 Subject: [PATCH 33/41] =?UTF-8?q?update:=20#534:=20test=E3=82=AF=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=A7=E4=BD=BF=E7=94=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=82=AF=E3=83=AC=E3=83=BC=E3=83=88=E3=82=92?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `serde`はworkspaceで定義しているバージョンを使用するように修正 --- tests/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 3a572731..65503637 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -10,7 +10,7 @@ name = "integration_tests" path = "integration_tests.rs" [dev-dependencies] -csv = "1.3.0" +csv = "1.3.1" japanese-address-parser = { path = "../core" } -serde = { version = "1.0.197", features = ["derive"] } +serde.workspace = true tokio.workspace = true From 46f100e7604d92ddde33408c7be8c7cb12043cc1 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 21:57:58 +0900 Subject: [PATCH 34/41] =?UTF-8?q?update:=20#534:=20core=E3=82=AF=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=A7=E4=BD=BF=E7=94=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=82=AF=E3=83=AC=E3=83=BC=E3=83=88=E3=82=92?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Cargo.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/Cargo.toml b/core/Cargo.toml index 9b1e9cc3..ac097e2b 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -25,11 +25,11 @@ experimental = [] [dependencies] log.workspace = true rapidfuzz = "0.5.0" -regex = { version = "1.10.6", default-features = false, features = ["std", "unicode-perl"] } +regex = { version = "1.11.1", default-features = false, features = ["std", "unicode-perl"] } serde.workspace = true -reqwest = { version = "0.12.5", default-features = false, features = ["json", "rustls-tls"] } -js-sys = "0.3.67" -thiserror = "1.0.63" +reqwest = { version = "0.12.9", default-features = false, features = ["json", "rustls-tls"] } +js-sys = "0.3.74" +thiserror = "2.0.3" jisx0401 = "0.1.0-beta.3" [dev-dependencies] @@ -37,7 +37,7 @@ tokio.workspace = true wasm-bindgen-test = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] -mockito = "1.4.0" # mockitoがwasm32に対応していないため +mockito = "1.6.1" # mockitoがwasm32に対応していないため [package.metadata.docs.rs] all-features = true From 5bad7a6717141b6d64bca176eaa6dd589489bb2b Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Tue, 3 Dec 2024 22:00:40 +0900 Subject: [PATCH 35/41] =?UTF-8?q?update:=20#534:=20workspace=E3=81=A7?= =?UTF-8?q?=E3=81=BE=E3=81=A8=E3=82=81=E3=81=A6=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=82=92=E7=AE=A1=E7=90=86=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=82=AF=E3=83=AC=E3=83=BC=E3=83=88=E3=82=92?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index febc3bd0..9fc31cde 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,8 @@ categories = ["parser-implementations", "wasm"] [workspace.dependencies] log = "0.4.22" -serde = { version = "1.0.192", features = ["derive"] } -tokio = { version = "1.38.0", features = ["rt", "macros"] } -wasm-bindgen = "0.2.92" -wasm-bindgen-futures = "0.4.42" -wasm-bindgen-test = "0.3.42" +serde = { version = "1.0.215", features = ["derive"] } +tokio = { version = "1.41.1", features = ["rt", "macros"] } +wasm-bindgen = "0.2.97" +wasm-bindgen-futures = "0.4.47" +wasm-bindgen-test = "0.3.47" From 894cf229f0d83b5da9941d0efe4932ce4153f139 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 14 Dec 2024 23:08:35 +0900 Subject: [PATCH 36/41] update-version: 0.2.0-rc.3 -> 0.2.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c6d2a3f2..07da6ea6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.2.0-rc.3" +version = "0.2.0" edition = "2021" description = "A library for processing addresses of Japan" repository = "https://github.com/YuukiToriyama/japanese-address-parser" From ed1f8a6dfc6fd803857421b360b1ec7259aa3546 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Sat, 14 Dec 2024 23:25:12 +0900 Subject: [PATCH 37/41] =?UTF-8?q?update:=20=E3=83=9E=E3=82=A4=E3=83=8A?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=A2?= =?UTF-8?q?=E3=83=83=E3=83=97=E3=81=AB=E4=BC=B4=E3=81=84README=E3=82=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- wasm/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cbd0f7eb..6c668d80 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Add the following to your `Cargo.toml`. ```toml [dependencies] -japanese-address-parser = "0.1" +japanese-address-parser = "0.2" ``` ### Async Version diff --git a/wasm/README.md b/wasm/README.md index b1d1c954..6c17ceb2 100644 --- a/wasm/README.md +++ b/wasm/README.md @@ -11,13 +11,13 @@ A Library for processing addresses of Japan written in Rust. Install with npm: ```bash -npm install @toriyama/japanese-address-parser +npm install @toriyama/japanese-address-parser@0.2 ``` Install with yarn: ```bash -yarn add @toriyama/japanese-address-parser +yarn add @toriyama/japanese-address-parser@0.2 ``` ## Introduction From 1c49f38a491d66264555d298e85ce03ae37d11ae Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 26 Dec 2024 21:39:41 +0900 Subject: [PATCH 38/41] =?UTF-8?q?add:=20=E3=83=9E=E3=82=A4=E3=83=8A?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=A2?= =?UTF-8?q?=E3=83=83=E3=83=97=E3=81=AB=E4=BC=B4=E3=81=84CHANGELOG=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..caf69432 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +マイナーバージョンアップやメジャーバージョンアップの際に発生する破壊的変更についてこのファイルに記載します。 +それ以外の変更については[リリースノート](https://github.com/YuukiToriyama/japanese-address-parser/releases)を参照ください。 + +## v0.2.0 + +### 非推奨に指定していたモジュール、関数を削除しました([#532](https://github.com/YuukiToriyama/japanese-address-parser/pull/532))。 + +- `japanese_address_parser::parser::parse`や`japanese_address_parser::parser::parse_blocking`を使用しているコードは動かなくなります。 + `japanese_address_parser::parser::Parser`の使用を検討してください。 +- また、`japanese_address_parser::entity::Address`は`japanese_address_parser::domain::geolonia::Address`に移動しました。 + そのままだと動かないので、use文を修正してください。 From 8df51bb2ed43b30cd9b4be4f377ff317c24dce70 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 26 Dec 2024 21:44:46 +0900 Subject: [PATCH 39/41] =?UTF-8?q?update:=20`jisx0401`=E3=81=AE=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92`0.1.1`=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Cargo.toml b/core/Cargo.toml index ac097e2b..183d1a08 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -30,7 +30,7 @@ serde.workspace = true reqwest = { version = "0.12.9", default-features = false, features = ["json", "rustls-tls"] } js-sys = "0.3.74" thiserror = "2.0.3" -jisx0401 = "0.1.0-beta.3" +jisx0401 = "0.1.1" [dev-dependencies] tokio.workspace = true From acfeb3c02bf64b10aba17f19b323de384e40f9ef Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 26 Dec 2024 21:58:02 +0900 Subject: [PATCH 40/41] =?UTF-8?q?update:=20`maturin`=E3=81=AE=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=921.7.8=E3=81=AB?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.8.0がリリースされているがこちらを用いるとビルドに失敗するため --- .github/workflows/python-build-check.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python-build-check.yaml b/.github/workflows/python-build-check.yaml index df44e5fa..41790d9c 100644 --- a/.github/workflows/python-build-check.yaml +++ b/.github/workflows/python-build-check.yaml @@ -27,6 +27,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: 1.7.8 target: x86_64 args: --release --out dist --zig working-directory: python @@ -50,6 +51,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: 1.7.8 target: x64 args: --release --out dist working-directory: python @@ -71,6 +73,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: 1.7.8 target: aarch64 args: --release --out dist working-directory: python @@ -89,6 +92,7 @@ jobs: - name: Build sdist uses: PyO3/maturin-action@v1 with: + maturin-version: 1.7.8 command: sdist args: --out dist working-directory: python From d18699b63aa65717b03f04e43274d66320a869d4 Mon Sep 17 00:00:00 2001 From: Yuuki Toriyama Date: Thu, 26 Dec 2024 22:27:27 +0900 Subject: [PATCH 41/41] =?UTF-8?q?update:=20`upload-pypi-org.yaml`=E3=81=AB?= =?UTF-8?q?=E3=81=8A=E3=81=91=E3=82=8B`maturin`=E3=81=AE=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=921.7.8=E3=81=AB=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.8.0がリリースされているがこちらを用いるとビルドに失敗するため --- .github/workflows/upload-pypi-org.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/upload-pypi-org.yaml b/.github/workflows/upload-pypi-org.yaml index 8b7626bd..17b39f9d 100644 --- a/.github/workflows/upload-pypi-org.yaml +++ b/.github/workflows/upload-pypi-org.yaml @@ -38,6 +38,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: 1.7.8 target: ${{ matrix.platform.target }} args: --release --out dist --zig working-directory: python @@ -67,6 +68,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: 1.7.8 target: ${{ matrix.platform.target }} args: --release --out dist working-directory: python @@ -94,6 +96,7 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: 1.7.8 target: ${{ matrix.platform.target }} args: --release --out dist working-directory: python @@ -111,6 +114,7 @@ jobs: - name: Build sdist uses: PyO3/maturin-action@v1 with: + maturin-version: 1.7.8 command: sdist args: --out dist working-directory: python @@ -133,5 +137,6 @@ jobs: MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} MATURIN_REPOSITORY: "pypi" # test.pypi.orgにアップロードする際は"testpypi"を設定する with: + maturin-version: 1.7.8 command: upload args: --non-interactive --skip-existing wheels-*/*