SchoolService.cs 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. using Microsoft.AspNetCore.Hosting;
  2. using Microsoft.International.Converters.PinYinConverter;
  3. using Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Text.Json;
  10. using System.Text.RegularExpressions;
  11. using System.Threading.Tasks;
  12. using TEAMModelOS.SDK.DI;
  13. using TEAMModelOS.SDK.Extension;
  14. namespace TEAMModelOS.SDK
  15. {
  16. public class SchoolService
  17. {
  18. public static async Task<List<SchoolData>> GenerateSchoolCode(List<SchoolData> schools, DingDing _dingDing, IWebHostEnvironment _environment)
  19. {
  20. string path = $"{_environment.ContentRootPath}/JsonFile/Core/region.json";
  21. //var schools = jsonstr.ToObject<JsonElement>().GetProperty("schools").ToObject<List<SchoolData>>();
  22. schools = schools.Where((x, i) => schools.FindIndex(n => n.name.Equals(x.name)) == i).ToList();
  23. StreamReader streamReader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Encoding.UTF8);
  24. StringBuilder stringBuilder = new StringBuilder();
  25. string text;
  26. while ((text = streamReader.ReadLine()) != null)
  27. {
  28. stringBuilder.Append(text.ToString());
  29. }
  30. streamReader.Close();
  31. string input = stringBuilder.ToString();
  32. List<Region> region = input.ToObject<List<Region>>();
  33. try
  34. {
  35. schools.ForEach(x =>
  36. {
  37. x.province = ChineseConverter.Convert(x.province, ChineseConversionDirection.TraditionalToSimplified);
  38. if (String.IsNullOrEmpty(x.city))
  39. {
  40. x.city = x.province;
  41. }
  42. else
  43. {
  44. x.city = ChineseConverter.Convert(x.city, ChineseConversionDirection.TraditionalToSimplified);
  45. }
  46. x.name = ChineseConverter.Convert(x.name, ChineseConversionDirection.TraditionalToSimplified);
  47. comeRemoveStr.ForEach(c => { x.province = x.province.Replace(c, ""); });
  48. prvcRemoveStr.ForEach(c => { x.province = x.province.Replace(c, ""); });
  49. var province = region.Find(r => r.name.Contains(x.province));
  50. string tmpprovince = x.province;
  51. string tmpcity = x.city;
  52. if (province != null)
  53. {
  54. x.province = province.name;
  55. comeRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); });
  56. cityRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); });
  57. nationRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); });
  58. tmpcity = x.city;
  59. var city = province.children.Find(r => r.name.Contains(x.city));
  60. if (city == null)
  61. {
  62. city = province.children.Find(r => r.name.Contains(x.city));
  63. if (city == null)
  64. {
  65. city = province.children.SelectMany(x => x.children).ToList().Find(r => r.name.Contains(x.city));
  66. }
  67. }
  68. if (city != null)
  69. {
  70. x.city = city.name;
  71. }
  72. }
  73. string name = x.name;
  74. //去除冗余的学校信息,只保留地名和校名关键信息
  75. schemoveStr.ForEach(str =>
  76. {
  77. name = name.Replace(str, "");
  78. });
  79. string[] names = name.Split("(");
  80. if (names.Length > 1)
  81. {
  82. name = $"{names[0]}";
  83. for (int index = 1; index < names.Length; index++)
  84. {
  85. name = $"{name}{names[index].Substring(0, 1)}";
  86. var afnames = names[index].Split(")");
  87. if (afnames.Length > 1)
  88. {
  89. for (int i = 1; i < afnames.Length; i++)
  90. {
  91. name = $"{name}{afnames[i]}";
  92. }
  93. }
  94. }
  95. }
  96. names = name.Split("(");
  97. if (names.Length > 1)
  98. {
  99. name = $"{names[0]}";
  100. for (int index = 1; index < names.Length; index++)
  101. {
  102. name = $"{name}{names[index].Substring(0, 1)}";
  103. var afnames = names[index].Split(")");
  104. if (afnames.Length > 1)
  105. {
  106. for (int i = 1; i < afnames.Length; i++)
  107. {
  108. name = $"{name}{afnames[i]}";
  109. }
  110. }
  111. }
  112. }
  113. name = Regex.Replace(name, "[ \\[ \\] \\^ \\-|()【】/' {}_*×――(^)$%~!@#$…&%¥—+=<>《》!!???::•`·、。,;,.;\"‘’“”-]", " ");
  114. //检查是否有英文
  115. if (Regex.Matches(name, "[a-zA-Z]").Count > 0)
  116. {
  117. var array = Regex.Split(name, "\\s+", RegexOptions.IgnoreCase);
  118. StringBuilder tmpname = new StringBuilder();
  119. if (array.Length > 1)
  120. {
  121. foreach (var item in array)
  122. {
  123. var arr = item.Select(x => $"{x}");
  124. int index = 0;
  125. foreach (var stra in arr)
  126. {
  127. if (Regex.Matches(stra, "[a-zA-Z]").Count > 0)
  128. {
  129. if (index == 1|| index == 0)
  130. {
  131. tmpname.Append(stra);
  132. }
  133. else
  134. {
  135. }
  136. }
  137. else
  138. {
  139. tmpname.Append(stra);
  140. }
  141. index++;
  142. }
  143. }
  144. }
  145. else
  146. {
  147. var arr = name.Select(x => $"{x}");
  148. int index = 0;
  149. foreach (var stra in arr)
  150. {
  151. if (Regex.Matches(stra, "[A-Z]").Count > 0)
  152. {
  153. tmpname.Append(stra);
  154. }
  155. else if (Regex.Matches(stra, "[a-z]").Count > 0)
  156. {
  157. }
  158. else
  159. {
  160. tmpname.Append(stra);
  161. }
  162. index++;
  163. }
  164. }
  165. name = tmpname.ToString();
  166. }
  167. name = Regex.Replace(name, @"\s", "");
  168. name = name.Replace("\\", "");
  169. if (name.Length > 6)
  170. {
  171. //新区,高新,产业等非新政单位
  172. areaRemoveStr.ForEach(str =>
  173. {
  174. name = name.Replace(str.Key, str.Value);
  175. });
  176. //去除冗余的学校信息,只保留地名和校名关键信息
  177. schooRemoveStr.ForEach(str =>
  178. {
  179. name = name.Replace(str, "");
  180. });
  181. //替换民族信息词
  182. if (name.Length > 6)
  183. {
  184. nationRemoveStr.ForEach(str =>
  185. {
  186. name = name.Replace(str, "");
  187. });
  188. }
  189. //替换学校信息的副词
  190. if (name.Length > 6)
  191. {
  192. foreach (var str in schooReplaceStr)
  193. {
  194. if (name.Length <= 6)
  195. {
  196. break;
  197. }
  198. name = name.Replace(str.Key, str.Value);
  199. }
  200. }
  201. //替换省简称信息词
  202. string tmpname = name;
  203. if (name.Length > 6)
  204. {
  205. proReplaceStr.ForEach(str =>
  206. {
  207. name = name.Replace(str.Key, str.Value);
  208. });
  209. //如果替换后仍然大于6位,则取消,直接替换省份完整的词
  210. if (name.Length > 6)
  211. {
  212. name = tmpname.Replace(tmpprovince, "");
  213. }
  214. }
  215. //替换城市信息词
  216. if (name.Length > 6)
  217. {
  218. name = name.Replace(tmpcity, "");
  219. }
  220. }
  221. int len = name.Length;
  222. if (len > 6)
  223. {
  224. foreach (var str in afterSchoolRm)
  225. {
  226. if (name.Length <= 6)
  227. {
  228. break;
  229. }
  230. name = name.Replace(str, "");
  231. }
  232. }
  233. len = name.Length;
  234. if (len >= 6)
  235. {
  236. name = $"{name.Substring(0, 1)}{name.Substring(len - 5, 3)}{name.Substring(len - 2, 2)}";
  237. }
  238. //if (len <= 7 && len > 6)
  239. //{
  240. // name = name.Substring(len - 6);
  241. //}
  242. if (len <= 4)
  243. {
  244. name = $"{x.city.Substring(0, 2)}{name}";
  245. }
  246. if (len == 5)
  247. {
  248. name = $"{x.city.Substring(0, 1)}{name}";
  249. }
  250. string code = ToFirstPinYin(name);
  251. x.aname = name;
  252. x.id = code;
  253. });
  254. }
  255. catch (Exception ex)
  256. {
  257. await _dingDing.SendBotMsg($"{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
  258. }
  259. string a_z = "abcdefghijklmnopqrstuvwxyz";
  260. var data = schools.GroupBy(x => x.id).Select(x => new { key = x.Key, more = x.ToList().Count > 2, count = x.ToList().Count, list = x.ToList() }).ToList();
  261. data.ForEach(x =>
  262. {
  263. if (x.count > 1)
  264. {
  265. var first = x.list.First();
  266. var same = x.list.Skip(1).Take(x.count - 1).ToList();
  267. var fs = first.aname.Select(x => x).ToArray();
  268. same.ForEach(z =>
  269. {
  270. var sp = z.aname.Select(x => x).ToArray();
  271. int len = sp.Length;
  272. if (sp.Length >= fs.Length)
  273. {
  274. len = fs.Count();
  275. }
  276. for (int index = 0; index < len; index++)
  277. {
  278. if (!$"{sp[index]}".Equals($"{fs[index]}"))
  279. {
  280. short st = ChineseChar.GetStrokeNumber(sp[index]);
  281. if (st > 0)
  282. {
  283. var ins = st % 27;
  284. var insch = a_z[ins];
  285. if (z.aname.EndsWith($"{insch}"))
  286. {
  287. ins = (st + 1) % 27;
  288. insch = a_z[ins];
  289. }
  290. z.id = z.id.Insert(index, $"{insch}").Remove(index + 1, 1);
  291. break;
  292. }
  293. }
  294. }
  295. });
  296. }
  297. });
  298. var dataz = data.SelectMany(y=>y.list).GroupBy(x => x.id).Select(x => new { key = x.Key, more = x.ToList().Count > 2, count = x.ToList().Count, list = x.ToList() }).ToList();
  299. dataz.ForEach(x =>
  300. {
  301. if (x.count > 1)
  302. {
  303. var first = x.list.First();
  304. var same = x.list.Skip(1).Take(x.count - 1).ToList();
  305. var fs = first.aname.Select(x => x).ToArray();
  306. same.ForEach(z =>
  307. {
  308. var sp = z.aname.Select(x => x).ToArray();
  309. int len = sp.Length;
  310. if (sp.Length >= fs.Length)
  311. {
  312. len = fs.Count();
  313. }
  314. for (int index = 0; index < len; index++)
  315. {
  316. if (!$"{sp[index]}".Equals($"{fs[index]}"))
  317. {
  318. var spstr = ToPinYin($"{sp[index]}" );
  319. var fsstr = ToPinYin($"{fs[index]}");
  320. var insch= spstr.Select(x => $"{x}").Except( fsstr.Select(z => $"{z}"));
  321. if (insch != null && insch.Count() > 0) {
  322. if (index > 1)
  323. {
  324. z.id = z.id.Insert(index - 1, insch.First()).Remove(index, 1);
  325. }
  326. else if (index == 1)
  327. {
  328. z.id = z.id.Insert(index, insch.First()).Remove(index - 1, 1);
  329. }
  330. }
  331. }
  332. }
  333. });
  334. }
  335. });
  336. var dataa = dataz.SelectMany(y => y.list).GroupBy(x => x.id).Select(x => new { key = x.Key, more = x.ToList().Count > 2, count = x.ToList().Count, list = x.ToList() }).ToList();
  337. Random random = new Random();
  338. List<SchoolData> list = new List<SchoolData>();
  339. dataa.ForEach(x =>
  340. {
  341. if (x.count > 1)
  342. {
  343. x.list.ForEach(y => {
  344. int r= random.Next(25);
  345. int index= random.Next(5);
  346. y.id = y.id.Insert(index - 1, $"{a_z[r]}").Remove(index, 1);
  347. });
  348. }
  349. list.AddRange(x.list);
  350. });
  351. return list;
  352. }
  353. public static string ToPinYin(string val)
  354. {
  355. StringBuilder sb = new StringBuilder();
  356. val.ToCharArray().ToList().ForEach(x =>
  357. {
  358. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  359. {
  360. sb.Append(x);
  361. }
  362. else
  363. {
  364. try
  365. {
  366. ChineseChar cc = new ChineseChar(x);
  367. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  368. {
  369. sb.Append(cc.Pinyins[0]);
  370. }
  371. }
  372. catch (Exception ex)
  373. {
  374. }
  375. }
  376. });
  377. return sb.ToString().ToLower();
  378. }
  379. public static string ToFirstPinYin(string val)
  380. {
  381. StringBuilder sb = new StringBuilder();
  382. val.ToCharArray().ToList().ForEach(x =>
  383. {
  384. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  385. {
  386. sb.Append(x);
  387. }
  388. else
  389. {
  390. try
  391. {
  392. ChineseChar cc = new ChineseChar(x);
  393. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  394. {
  395. sb.Append(cc.Pinyins[0][0]);
  396. }
  397. }
  398. catch (Exception ex)
  399. {
  400. }
  401. }
  402. });
  403. return sb.ToString().ToLower();
  404. }
  405. public class SchoolData
  406. {
  407. public string province { get; set; }
  408. public string id { get; set; }
  409. public string name { get; set; }
  410. public string city { get; set; }
  411. public string aname { get; set; }
  412. public string uid { get; set; }
  413. }
  414. public static List<string> comeRemoveStr = new List<string>() { "省", "市", "区", "州", "县", "旗", "盟", "自治" };
  415. public static List<string> prvcRemoveStr = new List<string>() { "回族", "维吾尔", "壮族", };
  416. public static List<string> cityRemoveStr = new List<string>() { "蒙古族", "地区", "壮族", "朝鲜族", "直辖" };
  417. public static List<string> nationRemoveStr = new List<string> {
  418. "维吾尔","回族", "自治", "满族", "蒙古", "壮族", "苗族" , "侗族", "瑶族",
  419. "达斡尔","鄂温克","朝鲜","畲族","土家","各族","仫佬","毛南","羌族","彝族","仡佬","布依","水族",
  420. "傣族","纳西","哈尼","拉祜","佤族","傈僳","独龙","怒族","白族","普米","固族","哈萨克","土族","撒拉","景颇","族"
  421. };
  422. public static List<string> schemoveStr = new List<string> { "第", "校区", "部", "楼", "与", "学校", "校园", };
  423. public static List<string> schooRemoveStr = new List<string>() {"省", "市", "区", "州", "县", "旗", "盟","办事处","街道", "自治",
  424. "镇","村","乡","街","路","站","馆"
  425. };
  426. public static List<string> afterSchoolRm = new List<string>() {"校","园","院", "湾","峡","沟","山","庄",
  427. "堡","江","屯","岭","溪","河","桥","营","铺","坡","寨","场","湖","巷","集","关","庙","寺","矿","塘"};
  428. public static List<KeyValuePair<string, string>> areaRemoveStr = new List<KeyValuePair<string, string>>{
  429. new KeyValuePair<string, string>("高新技术产业开发区", "高") ,
  430. new KeyValuePair<string, string>("经济技术开发区", "经") ,
  431. new KeyValuePair<string, string>("国际", "际") ,
  432. new KeyValuePair<string, string>("中国", ""),
  433. new KeyValuePair<string, string>("国家", ""),
  434. new KeyValuePair<string, string>("新区", ""),
  435. new KeyValuePair<string, string>("高新", "高"),
  436. new KeyValuePair<string, string>("园区", ""),
  437. new KeyValuePair<string, string>("产业", "产"),
  438. new KeyValuePair<string, string>("经济", "经"),
  439. new KeyValuePair<string, string>("开发", "开"),
  440. new KeyValuePair<string, string>("中心", "") ,
  441. new KeyValuePair<string, string>("集团", "") ,
  442. new KeyValuePair<string, string>("公司", "") ,
  443. new KeyValuePair<string, string>("有限", "") ,
  444. new KeyValuePair<string, string>("股份", "") ,
  445. new KeyValuePair<string, string>("服务", "") ,
  446. new KeyValuePair<string, string>("基地", "") ,
  447. new KeyValuePair<string, string>("社区", "社") ,
  448. new KeyValuePair<string, string>("职工", "") ,
  449. new KeyValuePair<string, string>("专修", ""),
  450. new KeyValuePair<string, string>("实验", "验"),
  451. new KeyValuePair<string, string>("完全", ""),
  452. new KeyValuePair<string, string>("一贯制", "") ,
  453. new KeyValuePair<string, string>("联办", ""),
  454. new KeyValuePair<string, string>("联合", ""),
  455. new KeyValuePair<string, string>("完小", "小"),
  456. new KeyValuePair<string, string>("义务", ""),
  457. new KeyValuePair<string, string>("基础", ""),
  458. new KeyValuePair<string, string>("制造", "")
  459. };
  460. public static List<KeyValuePair<string, string>> schooReplaceStr = new List<KeyValuePair<string, string>> {
  461. new KeyValuePair<string, string>("分校", "分") ,
  462. new KeyValuePair<string, string>("分园", "分") ,
  463. new KeyValuePair<string, string>("分院", "分") ,
  464. new KeyValuePair<string, string>("藏文", "藏"),
  465. new KeyValuePair<string, string>("职业技术学院", "职") ,
  466. new KeyValuePair<string, string>("创新创业", "创") ,
  467. new KeyValuePair<string, string>("就业创业", "就") ,
  468. new KeyValuePair<string, string>("应用核技术", "核") ,
  469. new KeyValuePair<string, string>("职业学院", "职") ,
  470. new KeyValuePair<string, string>("幼儿园", "幼") ,
  471. new KeyValuePair<string, string>("幼儿", "幼") ,
  472. new KeyValuePair<string, string>("小学", "小") ,
  473. new KeyValuePair<string, string>("中学", "中") ,
  474. new KeyValuePair<string, string>("中等", "中") ,
  475. new KeyValuePair<string, string>("双语", "双") ,
  476. new KeyValuePair<string, string>("初中", "初") ,
  477. new KeyValuePair<string, string>("初级", "初") ,
  478. new KeyValuePair<string, string>("广播", "广"),
  479. new KeyValuePair<string, string>("高中", "高") ,
  480. new KeyValuePair<string, string>("高级", "高") ,
  481. new KeyValuePair<string, string>("大学", "大") ,
  482. new KeyValuePair<string, string>("学院", "院") ,
  483. new KeyValuePair<string, string>("综合", "综") ,
  484. new KeyValuePair<string, string>("职业", "职") ,
  485. new KeyValuePair<string, string>("技术", "技") ,
  486. new KeyValuePair<string, string>("专科", "专") ,
  487. new KeyValuePair<string, string>("外国语", "外") ,
  488. new KeyValuePair<string, string>("九年", "九") ,
  489. new KeyValuePair<string, string>("五年", "五") ,
  490. new KeyValuePair<string, string>("年制", "制") ,
  491. new KeyValuePair<string, string>("高等", "高") ,
  492. new KeyValuePair<string, string>("院校", "院") ,
  493. new KeyValuePair<string, string>("初等", "小") ,
  494. new KeyValuePair<string, string>("附属", "附"),
  495. new KeyValuePair<string, string>("寄宿制", "寄") ,
  496. new KeyValuePair<string, string>("寄宿", "寄") ,
  497. new KeyValuePair<string, string>("卫生", "卫") ,
  498. new KeyValuePair<string, string>("创业", "创") ,
  499. new KeyValuePair<string, string>("继续", "继") ,
  500. new KeyValuePair<string, string>("开放", "开") ,
  501. new KeyValuePair<string, string>("技师", "技") ,
  502. new KeyValuePair<string, string>("成人", "成") ,
  503. new KeyValuePair<string, string>("教育", "教") ,
  504. new KeyValuePair<string, string>("科技", "科") ,
  505. new KeyValuePair<string, string>("行政", "政") ,
  506. new KeyValuePair<string, string>("生物", "生") ,
  507. new KeyValuePair<string, string>("美术", "美") ,
  508. new KeyValuePair<string, string>("设计", "设") ,
  509. new KeyValuePair<string, string>("传播", "传") ,
  510. new KeyValuePair<string, string>("计算机", "算") ,
  511. new KeyValuePair<string, string>("土木", "土") ,
  512. new KeyValuePair<string, string>("石油", "油") ,
  513. new KeyValuePair<string, string>("科普", "普") ,
  514. new KeyValuePair<string, string>("电信", "信") ,
  515. new KeyValuePair<string, string>("联合", "联") ,
  516. new KeyValuePair<string, string>("电商", "商") ,
  517. new KeyValuePair<string, string>("纺织", "织") ,
  518. new KeyValuePair<string, string>("服装", "服") ,
  519. new KeyValuePair<string, string>("新闻", "新") ,
  520. new KeyValuePair<string, string>("网络", "网") ,
  521. new KeyValuePair<string, string>("应用", "应") ,
  522. new KeyValuePair<string, string>("畜牧", "畜") ,
  523. new KeyValuePair<string, string>("兽医", "兽") ,
  524. new KeyValuePair<string, string>("师范", "师") ,
  525. new KeyValuePair<string, string>("人文", "文") ,
  526. new KeyValuePair<string, string>("创新", "创") ,
  527. new KeyValuePair<string, string>("法官", "法") ,
  528. new KeyValuePair<string, string>("邮电", "邮") ,
  529. new KeyValuePair<string, string>("文化", "文") ,
  530. new KeyValuePair<string, string>("函授", "函") ,
  531. new KeyValuePair<string, string>("科学", "科") ,
  532. new KeyValuePair<string, string>("信息", "息") ,
  533. new KeyValuePair<string, string>("水利", "利") ,
  534. new KeyValuePair<string, string>("水电", "电") ,
  535. new KeyValuePair<string, string>("电力", "力") ,
  536. new KeyValuePair<string, string>("环境", "环") ,
  537. new KeyValuePair<string, string>("建材", "材") ,
  538. new KeyValuePair<string, string>("机电", "机") ,
  539. new KeyValuePair<string, string>("航空", "空") ,
  540. new KeyValuePair<string, string>("航天", "天") ,
  541. new KeyValuePair<string, string>("警察", "警") ,
  542. new KeyValuePair<string, string>("警官", "警") ,
  543. new KeyValuePair<string, string>("财贸", "财") ,
  544. new KeyValuePair<string, string>("电子", "电") ,
  545. new KeyValuePair<string, string>("建筑", "筑") ,
  546. new KeyValuePair<string, string>("艺术", "艺") ,
  547. new KeyValuePair<string, string>("体育", "体") ,
  548. new KeyValuePair<string, string>("城市", "城") ,
  549. new KeyValuePair<string, string>("地质", "地") ,
  550. new KeyValuePair<string, string>("医药", "药") ,
  551. new KeyValuePair<string, string>("政法", "法") ,
  552. new KeyValuePair<string, string>("铁路", "铁") ,
  553. new KeyValuePair<string, string>("铁道", "道") ,
  554. new KeyValuePair<string, string>("轨道", "轨") ,
  555. new KeyValuePair<string, string>("交通", "通") ,
  556. new KeyValuePair<string, string>("医学院", "医") ,
  557. new KeyValuePair<string, string>("医学", "医") ,
  558. new KeyValuePair<string, string>("传媒", "媒") ,
  559. new KeyValuePair<string, string>("工程", "程") ,
  560. new KeyValuePair<string, string>("临床", "临") ,
  561. new KeyValuePair<string, string>("化工", "化") ,
  562. new KeyValuePair<string, string>("林业", "林") ,
  563. new KeyValuePair<string, string>("老年", "老") ,
  564. new KeyValuePair<string, string>("旅游", "游") ,
  565. new KeyValuePair<string, string>("护理", "护") ,
  566. new KeyValuePair<string, string>("贸易", "贸") ,
  567. new KeyValuePair<string, string>("中医药", "中医") ,
  568. new KeyValuePair<string, string>("资源", "源") ,
  569. new KeyValuePair<string, string>("冶金", "冶") ,
  570. new KeyValuePair<string, string>("能源", "能") ,
  571. new KeyValuePair<string, string>("汽车", "车") ,
  572. new KeyValuePair<string, string>("医科", "医") ,
  573. new KeyValuePair<string, string>("机械", "械") ,
  574. new KeyValuePair<string, string>("应用", "应") ,
  575. new KeyValuePair<string, string>("电气", "电") ,
  576. new KeyValuePair<string, string>("材料", "材") ,
  577. new KeyValuePair<string, string>("劳动", "劳") ,
  578. new KeyValuePair<string, string>("轻工", "轻") ,
  579. new KeyValuePair<string, string>("农业", "农") ,
  580. new KeyValuePair<string, string>("委员会", "委") ,
  581. new KeyValuePair<string, string>("专业", "专") ,
  582. new KeyValuePair<string, string>("广播", "广"),
  583. new KeyValuePair<string, string>("电视", "电") ,
  584. new KeyValuePair<string, string>("工商", "商") ,
  585. new KeyValuePair<string, string>("工业", "工") ,
  586. new KeyValuePair<string, string>("管理", "管") ,
  587. new KeyValuePair<string, string>("社会主义", "社") ,
  588. new KeyValuePair<string, string>("社会", "社") ,
  589. new KeyValuePair<string, string>("自动化", "自") ,
  590. };
  591. public static List<KeyValuePair<string, string>> proReplaceStr = new List<KeyValuePair<string, string>> {
  592. new KeyValuePair<string, string>("北京","京") ,
  593. new KeyValuePair<string, string>("天津","津") ,
  594. new KeyValuePair<string, string>("河北","冀") ,
  595. new KeyValuePair<string, string>("山西","晋") ,
  596. new KeyValuePair<string, string>("内蒙古","蒙") ,
  597. new KeyValuePair<string, string>("辽宁","辽") ,
  598. new KeyValuePair<string, string>("吉林","吉") ,
  599. new KeyValuePair<string, string>("黑龙江","黑") ,
  600. new KeyValuePair<string, string>("上海","沪") ,
  601. new KeyValuePair<string, string>("江苏","苏") ,
  602. new KeyValuePair<string, string>("浙江","浙") ,
  603. new KeyValuePair<string, string>("安徽","皖") ,
  604. new KeyValuePair<string, string>("福建","闽") ,
  605. new KeyValuePair<string, string>("江西","赣") ,
  606. new KeyValuePair<string, string>("山东","鲁") ,
  607. new KeyValuePair<string, string>("河南","豫") ,
  608. new KeyValuePair<string, string>("湖北","鄂") ,
  609. new KeyValuePair<string, string>("湖南","湘") ,
  610. new KeyValuePair<string, string>("广东","粤") ,
  611. new KeyValuePair<string, string>("广西","桂") ,
  612. new KeyValuePair<string, string>("海南","琼") ,
  613. new KeyValuePair<string, string>("四川","川") ,
  614. new KeyValuePair<string, string>("贵州","贵") ,
  615. new KeyValuePair<string, string>("云南","云") ,
  616. new KeyValuePair<string, string>("重庆","渝") ,
  617. new KeyValuePair<string, string>("西藏","藏") ,
  618. new KeyValuePair<string, string>("陕西","陕") ,
  619. new KeyValuePair<string, string>("甘肃","甘") ,
  620. new KeyValuePair<string, string>("青海","青") ,
  621. new KeyValuePair<string, string>("宁夏","宁") ,
  622. new KeyValuePair<string, string>("新疆","新") ,
  623. new KeyValuePair<string, string>("香港","港") ,
  624. new KeyValuePair<string, string>("澳门","澳") ,
  625. new KeyValuePair<string, string>("台湾","台")
  626. };
  627. /*
  628. [
  629. {"method":"台北市","params":{"CountryId":"TW","CityId":"30"}},1
  630. {"method":"新北市","params":{"CountryId":"TW","CityId":"01"}},1
  631. {"method":"桃园市","params":{"CountryId":"TW","CityId":"03"}},1
  632. {"method":"台中市","params":{"CountryId":"TW","CityId":"66"}},1
  633. {"method":"台南市","params":{"CountryId":"TW","CityId":"67"}},1
  634. {"method":"高雄市","params":{"CountryId":"TW","CityId":"64"}},1
  635. {"method":"基隆市","params":{"CountryId":"TW","CityId":"17"}},1
  636. {"method":"新竹市","params":{"CountryId":"TW","CityId":"18"}},1
  637. {"method":"嘉义市","params":{"CountryId":"TW","CityId":"20"}},1
  638. {"method":"新竹县","params":{"CountryId":"TW","CityId":"04"}},1
  639. {"method":"苗栗县","params":{"CountryId":"TW","CityId":"05"}},1
  640. {"method":"彰化县","params":{"CountryId":"TW","CityId":"07"}},1
  641. {"method":"南投县","params":{"CountryId":"TW","CityId":"08"}},1
  642. {"method":"云林县","params":{"CountryId":"TW","CityId":"09"}},1
  643. {"method":"嘉义县","params":{"CountryId":"TW","CityId":"10"}},1
  644. {"method":"屏东县","params":{"CountryId":"TW","CityId":"13"}},1
  645. {"method":"宜兰县","params":{"CountryId":"TW","CityId":"02"}},1
  646. {"method":"花莲县","params":{"CountryId":"TW","CityId":"15"}},1
  647. {"method":"台东县","params":{"CountryId":"TW","CityId":"14"}},1
  648. {"method":"澎湖县","params":{"CountryId":"TW","CityId":"16"}},1
  649. {"method":"金门县","params":{"CountryId":"TW","CityId":"71"}},
  650. {"method":"连江县","params":{"CountryId":"TW","CityId":"72"}}
  651. ]
  652. */
  653. }
  654. }