-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #447 from YuukiToriyama/feature/improve-tokenizer/…
…master Tokenizerのリファクタをrelease/v0.1.18にマージ
- Loading branch information
Showing
11 changed files
with
420 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod common; | ||
pub mod geolonia; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod latlng; | ||
pub mod token; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[derive(Clone, Debug, PartialEq)] | ||
pub struct LatLng { | ||
/// 緯度 | ||
latitude: f64, | ||
/// 軽度 | ||
longitude: f64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use crate::domain::common::latlng::LatLng; | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub enum Token { | ||
Prefecture(Prefecture), | ||
City(City), | ||
Town(Town), | ||
Rest(String), | ||
} | ||
|
||
#[derive(Debug, PartialEq, Clone)] | ||
pub(crate) struct Prefecture { | ||
pub(crate) prefecture_name: String, | ||
pub(crate) representative_point: Option<LatLng>, | ||
} | ||
|
||
#[derive(Debug, PartialEq, Clone)] | ||
pub(crate) struct City { | ||
pub(crate) city_name: String, | ||
pub(crate) representative_point: Option<LatLng>, | ||
} | ||
|
||
#[derive(Debug, PartialEq, Clone)] | ||
pub(crate) struct Town { | ||
pub(crate) town_name: String, | ||
pub(crate) representative_point: Option<LatLng>, | ||
} | ||
|
||
pub(crate) fn append_token(tokens: &[Token], token: Token) -> Vec<Token> { | ||
[tokens.to_owned(), vec![token]].concat() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.