#country #name #normalization

normalize_country

将国家名称和代码转换为标准

3 个版本

0.1.2 2022年8月19日
0.1.1 2022年6月23日
0.1.0 2022年6月21日

国际化 (i18n) 中排名第 260

MIT 许可证

20KB
198 行代码(不包括注释)

国家名称标准化库

将国家名称和代码转换为标准。

使用示例

let cn = CountryNameNormalizer::new("./countries/en.toml").unwrap();
let st_kittis_nevis = cn.normalize_country("St. Kitts & Nevis").unwrap();

println!("{:?}", st_kittis_nevis)

//
// Country {
//   aliases: Some(["Federation of Saint Christopher and Nevi"]),
//   alpha2: "KN",
//   alpha3: "KNA",
//   fifa: "SKN",
//   ioc: "SKN",
//   iso_name: "Saint Kitts And Nevis",
//   numeric: 659,
//   official: "Federation of Saint Kitts and Nevis",
//   short: "Saint Kitts And Nevis",
//   emoji: "🇰🇳",
//   shortcode: ":flag-kn:",
// }

依赖项

~2.6–4.5MB
~80K SLoC