Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新依赖的数据源 #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "data"]
path = data
url = https://github.com/cn/GB2260.git
url = https://github.com/huangjj27/GB2260.git
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data.rs 已经更新了,子模块可以不需要更改。

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "gb2260"
version = "0.1.2"
authors = ["messense <[email protected]>"]
authors = ["messense <[email protected]>", "huangjj27 <[email protected]>"]
description = "The Rust implementation for looking up Chinese administrative divisions"
keywords = ["chinese", "divisions"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion data
Submodule data updated 85 files
+3,107 −3,107 mca/198012.tsv
+3,118 −3,118 mca/198112.tsv
+3,142 −3,142 mca/198212.tsv
+3,126 −3,126 mca/198312.tsv
+3,166 −3,166 mca/198412.tsv
+3,182 −3,182 mca/198512.tsv
+3,185 −3,185 mca/198612.tsv
+3,182 −3,182 mca/198712.tsv
+3,195 −3,196 mca/198812.tsv
+3,196 −3,196 mca/198912.tsv
+3,200 −3,200 mca/199012.tsv
+3,202 −3,202 mca/199112.tsv
+3,203 −3,203 mca/199212.tsv
+3,201 −3,201 mca/199312.tsv
+3,209 −3,208 mca/199412.tsv
+3,214 −3,213 mca/199512.tsv
+3,224 −3,223 mca/199612.tsv
+3,226 −3,226 mca/199712.tsv
+3,226 −3,225 mca/199812.tsv
+3,221 −3,221 mca/199912.tsv
+3,226 −3,226 mca/200012.tsv
+3,225 −3,225 mca/200112.tsv
+3,224 −3,224 mca/200212.tsv
+3,226 −3,226 mca/200312.tsv
+3,227 −3,227 mca/200412.tsv
+3,227 −3,227 mca/200512.tsv
+3,225 −3,225 mca/200612.tsv
+3,224 −3,224 mca/200712.tsv
+3,224 −3,224 mca/200812.tsv
+3,223 −3,223 mca/200912.tsv
+3,221 −3,221 mca/201012.tsv
+3,217 −3,220 mca/201112.tsv
+3,217 −0 mca/201212.tsv
+3,221 −3,221 mca/201312.tsv
+3,223 −3,223 mca/201412.tsv
+3,222 −3,222 mca/201501.tsv
+3,222 −3,222 mca/201502.tsv
+3,224 −3,224 mca/201503.tsv
+3,223 −3,223 mca/201504.tsv
+3,223 −3,223 mca/201505.tsv
+3,222 −3,222 mca/201506.tsv
+3,222 −3,222 mca/201507.tsv
+3,222 −3,222 mca/201508.tsv
+3,222 −3,222 mca/201509.tsv
+3,222 −3,222 mca/201510.tsv
+3,222 −3,222 mca/201511.tsv
+3,220 −3,220 mca/201512.tsv
+3,220 −3,220 mca/201601.tsv
+3,220 −3,220 mca/201602.tsv
+3,220 −3,220 mca/201603.tsv
+3,220 −3,220 mca/201604.tsv
+3,219 −3,219 mca/201605.tsv
+3,220 −3,220 mca/201606.tsv
+3,221 −3,221 mca/201607.tsv
+3,221 −3,221 mca/201608.tsv
+3,221 −3,221 mca/201609.tsv
+3,222 −3,222 mca/201610.tsv
+3,220 −3,220 mca/201611.tsv
+3,221 −3,221 mca/201612.tsv
+3,220 −3,220 mca/201701.tsv
+3,220 −3,220 mca/201702.tsv
+3,220 −3,220 mca/201703.tsv
+3,220 −3,220 mca/201704.tsv
+3,220 −3,220 mca/201705.tsv
+3,220 −3,220 mca/201706.tsv
+3,220 −3,220 mca/201707.tsv
+3,220 −3,220 mca/201708.tsv
+3,220 −3,220 mca/201709.tsv
+3,220 −3,220 mca/201710.tsv
+3,220 −3,220 mca/201711.tsv
+3,220 −3,220 mca/201712.tsv
+3,220 −3,220 mca/201801.tsv
+3,219 −0 mca/201812.tsv
+3,220 −0 mca/201904.tsv
+3,214 −0 mca/201912.tsv
+3,211 −0 mca/202011.tsv
+3,210 −0 mca/202012.tsv
+3,209 −0 mca/202112.tsv
+23 −0 revisions.json
+4 −4 scripts/parse.py
+1 −1 scripts/requirements.txt
+38 −66 sources.tsv
+1 −0 stats/201810.tsv
+3,220 −0 stats/201904.tsv
+3,211 −0 stats/202011.tsv
6 changes: 3 additions & 3 deletions generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ fn main() {
println!("#![allow(non_upper_case_globals)]\n");
println!("use phf;\n");
let path: PathBuf = data_dir.into();
let stats_codes =
generate_by_dir(path.join("stats").as_path()).expect("generate from stats failed");
let mca_codes =
generate_by_dir(path.join("mca").as_path()).expect("generate from mca failed");
let contrib_codes =
generate_by_dir(path.join("contrib").as_path()).expect("generate from contrib failed");
print!("pub static DIVISIONS: phf::Map<&'static str, &'static phf::Map<&'static str, &'static str>> = ");
let mut map = phf_codegen::Map::new();
for code in &stats_codes {
for code in &mca_codes {
let code_name = code.replace("-", "_");
map.entry(&code[..], &format!("&DIVISIONS_{}", code_name));
}
Expand Down
Loading