SchoolCode.cs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. using Microsoft.AspNetCore.Hosting;
  2. using Microsoft.AspNetCore.Mvc;
  3. using Microsoft.International.Converters.PinYinConverter;
  4. using Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Text.Json;
  11. using System.Text.RegularExpressions;
  12. using System.Threading.Tasks;
  13. using TEAMModelOS.SDK.DI;
  14. using TEAMModelOS.SDK.Extension;
  15. using TEAMModelOS.SDK.Models.Cosmos.BI;
  16. namespace TEAMModelOS.SDK.Models.Service
  17. {
  18. public class SchoolCode
  19. {
  20. /// <summary>
  21. /// 依据彬哥写的生成的学校Code所改的方法
  22. /// </summary>
  23. /// <param name="json"></param>
  24. /// <param name="_dingDing"></param>
  25. /// <param name="_environment"></param>
  26. /// <returns></returns>
  27. public static async Task<CreateSchoolInfo> GenerateSchoolCode(CreateSchoolInfo schoolInfo, DingDing _dingDing, IWebHostEnvironment _environment)
  28. {
  29. string path = $"{_environment.ContentRootPath}/JsonFile/Region/region.json";
  30. StreamReader streamReader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Encoding.UTF8);
  31. StringBuilder stringBuilder = new StringBuilder();
  32. string text;
  33. while ((text = streamReader.ReadLine()) != null)
  34. {
  35. stringBuilder.Append(text.ToString());
  36. }
  37. streamReader.Close();
  38. string input = stringBuilder.ToString();
  39. List<Region> region = input.ToObject<List<Region>>();
  40. schoolInfo.province = ChineseConverter.Convert(schoolInfo.province, ChineseConversionDirection.TraditionalToSimplified);
  41. if (String.IsNullOrEmpty(schoolInfo.city))
  42. {
  43. schoolInfo.city = schoolInfo.province;
  44. }
  45. else
  46. {
  47. schoolInfo.city = ChineseConverter.Convert(schoolInfo.city, ChineseConversionDirection.TraditionalToSimplified);
  48. }
  49. schoolInfo.name = ChineseConverter.Convert(schoolInfo.name, ChineseConversionDirection.TraditionalToSimplified);
  50. comeRemoveStr.ForEach(c => { schoolInfo.province = schoolInfo.province.Replace(c, ""); });
  51. prvcRemoveStr.ForEach(c => { schoolInfo.province = schoolInfo.province.Replace(c, ""); });
  52. var province = region.Find(r => r.name.Contains(schoolInfo.province));
  53. string tmpprovince = schoolInfo.province;
  54. string tmpcity = schoolInfo.city;
  55. if (province != null)
  56. {
  57. schoolInfo.province = province.name;
  58. comeRemoveStr.ForEach(c => { schoolInfo.city = schoolInfo.city.Replace(c, ""); });
  59. cityRemoveStr.ForEach(c => { schoolInfo.city = schoolInfo.city.Replace(c, ""); });
  60. nationRemoveStr.ForEach(c => { schoolInfo.city = schoolInfo.city.Replace(c, ""); });
  61. tmpcity = schoolInfo.city;
  62. var city = province.children.Find(r => r.name.Contains(schoolInfo.city));
  63. if (city == null)
  64. {
  65. city = province.children.Find(r => r.name.Contains(schoolInfo.city));
  66. if (city == null)
  67. {
  68. city = province.children.SelectMany(x => x.children).ToList().Find(r => r.name.Contains(schoolInfo.city));
  69. }
  70. }
  71. if (city != null)
  72. {
  73. schoolInfo.city = city.name;
  74. }
  75. }
  76. string name = schoolInfo.name;
  77. //去除冗余的学校信息,只保留地名和校名关键信息
  78. schemoveStr.ForEach(str =>
  79. {
  80. name = name.Replace(str, "");
  81. });
  82. string[] names = name.Split("(");
  83. if (names.Length > 1)
  84. {
  85. name = $"{names[0]}";
  86. for (int index = 1; index < names.Length; index++)
  87. {
  88. name = $"{name}{names[index].Substring(0, 1)}";
  89. var afnames = names[index].Split(")");
  90. if (afnames.Length > 1)
  91. {
  92. for (int i = 1; i < afnames.Length; i++)
  93. {
  94. name = $"{name}{afnames[i]}";
  95. }
  96. }
  97. }
  98. }
  99. names = name.Split("(");
  100. if (names.Length > 1)
  101. {
  102. name = $"{names[0]}";
  103. for (int index = 1; index < names.Length; index++)
  104. {
  105. name = $"{name}{names[index].Substring(0, 1)}";
  106. var afnames = names[index].Split(")");
  107. if (afnames.Length > 1)
  108. {
  109. for (int i = 1; i < afnames.Length; i++)
  110. {
  111. name = $"{name}{afnames[i]}";
  112. }
  113. }
  114. }
  115. }
  116. name = Regex.Replace(name, "[ \\[ \\] \\^ \\-|()【】/' {}_*×――(^)$%~!@#$…&%¥—+=<>《》!!???::•`·、。,;,.;\"‘’“”-]", " ");
  117. //检查是否有英文
  118. if (Regex.Matches(name, "[a-zA-Z]").Count > 0)
  119. {
  120. var array = Regex.Split(name, "\\s+", RegexOptions.IgnoreCase);
  121. StringBuilder tmpname = new StringBuilder();
  122. if (array.Length > 1)
  123. {
  124. foreach (var item in array)
  125. {
  126. var arr = item.Select(x => $"{x}");
  127. int index = 0;
  128. foreach (var stra in arr)
  129. {
  130. if (Regex.Matches(stra, "[a-zA-Z]").Count > 0)
  131. {
  132. if (index == 1 || index == 0)
  133. {
  134. tmpname.Append(stra);
  135. }
  136. else
  137. {
  138. }
  139. }
  140. else
  141. {
  142. tmpname.Append(stra);
  143. }
  144. index++;
  145. }
  146. }
  147. }
  148. else
  149. {
  150. var arr = name.Select(x => $"{x}");
  151. int index = 0;
  152. foreach (var stra in arr)
  153. {
  154. if (Regex.Matches(stra, "[A-Z]").Count > 0)
  155. {
  156. tmpname.Append(stra);
  157. }
  158. else if (Regex.Matches(stra, "[a-z]").Count > 0)
  159. {
  160. }
  161. else
  162. {
  163. tmpname.Append(stra);
  164. }
  165. index++;
  166. }
  167. }
  168. name = tmpname.ToString();
  169. }
  170. name = Regex.Replace(name, @"\s", "");
  171. name = name.Replace("\\", "");
  172. if (name.Length > 6)
  173. {
  174. //新区,高新,产业等非新政单位
  175. areaRemoveStr.ForEach(str =>
  176. {
  177. name = name.Replace(str.Key, str.Value);
  178. });
  179. //去除冗余的学校信息,只保留地名和校名关键信息
  180. schooRemoveStr.ForEach(str =>
  181. {
  182. name = name.Replace(str, "");
  183. });
  184. //替换民族信息词
  185. if (name.Length > 6)
  186. {
  187. nationRemoveStr.ForEach(str =>
  188. {
  189. name = name.Replace(str, "");
  190. });
  191. }
  192. //替换学校信息的副词
  193. if (name.Length > 6)
  194. {
  195. foreach (var str in schooReplaceStr)
  196. {
  197. if (name.Length <= 6)
  198. {
  199. break;
  200. }
  201. name = name.Replace(str.Key, str.Value);
  202. }
  203. }
  204. //替换省简称信息词
  205. string tmpname = name;
  206. if (name.Length > 6)
  207. {
  208. proReplaceStr.ForEach(str =>
  209. {
  210. name = name.Replace(str.Key, str.Value);
  211. });
  212. //如果替换后仍然大于6位,则取消,直接替换省份完整的词
  213. if (name.Length > 6)
  214. {
  215. name = tmpname.Replace(tmpprovince, "");
  216. }
  217. }
  218. //替换城市信息词
  219. if (name.Length > 6)
  220. {
  221. name = name.Replace(tmpcity, "");
  222. }
  223. }
  224. int len = name.Length;
  225. if (len > 6)
  226. {
  227. foreach (var str in afterSchoolRm)
  228. {
  229. if (name.Length <= 6)
  230. {
  231. break;
  232. }
  233. name = name.Replace(str, "");
  234. }
  235. }
  236. len = name.Length;
  237. if (len >= 6)
  238. {
  239. name = $"{name.Substring(0, 1)}{name.Substring(len - 5, 3)}{name.Substring(len - 2, 2)}";
  240. }
  241. //if (len <= 7 && len > 6)
  242. //{
  243. // name = name.Substring(len - 6);
  244. //}
  245. if (len <= 4)
  246. {
  247. name = $"{schoolInfo.city.Substring(0, 2)}{name}";
  248. }
  249. if (len == 5)
  250. {
  251. name = $"{schoolInfo.city.Substring(0, 1)}{name}";
  252. }
  253. string code = ToFirstPinYin(name);
  254. schoolInfo.aname = name;
  255. schoolInfo.id = code;
  256. switch (schoolInfo.createCount)
  257. {
  258. case 1:
  259. if (schoolInfo.id.Equals(code))
  260. {
  261. string a_z = "abcdefghijklmnopqrstuvwxyz";
  262. var fs = schoolInfo.aname.Select(x => x).ToArray();
  263. var sp = schoolInfo.name.Select(x => x).ToArray();
  264. int Len = sp.Length;
  265. if (sp.Length >= fs.Length)
  266. {
  267. len = fs.Count();
  268. }
  269. for (int index = 0; index < len; index++)
  270. {
  271. if ($"{sp[index]}".Equals($"{fs[index]}"))
  272. {
  273. short st = ChineseChar.GetStrokeNumber(sp[index]);
  274. if (st > 0)
  275. {
  276. var ins = st % 27;
  277. var insch = a_z[ins];
  278. if (schoolInfo.aname.EndsWith($"{insch}"))
  279. {
  280. ins = (st + 1) % 27;
  281. insch = a_z[ins];
  282. }
  283. schoolInfo.id = schoolInfo.id.Insert(index, $"{insch}").Remove(index + 1, 1);
  284. break;
  285. }
  286. }
  287. }
  288. }
  289. break;
  290. case 2:
  291. if (schoolInfo.id.Equals(code))
  292. {
  293. var fs = schoolInfo.aname.Select(x => x).ToArray();
  294. var sp = schoolInfo.name.Select(x => x).ToArray();
  295. int Len = sp.Length;
  296. if (sp.Length >= fs.Length)
  297. {
  298. len = fs.Count();
  299. }
  300. for (int index = 0; index < len; index++)
  301. {
  302. if (!$"{sp[index]}".Equals($"{fs[index]}"))
  303. {
  304. var spstr = ToPinYin($"{sp[index]}");
  305. var fsstr = ToPinYin($"{fs[index]}");
  306. var insch = spstr.Select(x => $"{x}").Except(fsstr.Select(z => $"{z}"));
  307. if (insch != null && insch.Count() > 0)
  308. {
  309. if (index > 1)
  310. {
  311. schoolInfo.id = schoolInfo.id.Insert(index - 1, insch.First()).Remove(index, 1);
  312. }
  313. else if (index == 1)
  314. {
  315. schoolInfo.id = schoolInfo.id.Insert(index, insch.First()).Remove(index - 1, 1);
  316. }
  317. }
  318. }
  319. }
  320. }
  321. break;
  322. case 3:
  323. if (schoolInfo.id.Equals(code))
  324. {
  325. string letter = RandomSmallLetter(1, false);
  326. string small = code.Substring(0, code.Length - 1);
  327. bool end = code.EndsWith(letter);
  328. if (end)
  329. {
  330. string tempLetter = RandomSmallLetter(1, false);
  331. schoolInfo.id = $"{small}{tempLetter}";
  332. }
  333. else
  334. {
  335. schoolInfo.id = $"{small}{letter}";
  336. }
  337. }
  338. break;
  339. default:
  340. break;
  341. }
  342. return schoolInfo;
  343. }
  344. /// <summary>
  345. /// 生成随机字母
  346. /// </summary>
  347. /// <param name="Length">长度</param>
  348. /// <param name="Sleep">是否要在生成前将当前线程阻止以避免重复</param>
  349. /// <returns></returns>
  350. public static string RandomSmallLetter(int Length, bool Sleep)
  351. {
  352. if (Sleep) System.Threading.Thread.Sleep(3);
  353. char[] Pattern = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
  354. string result = "";
  355. int n = Pattern.Length;
  356. System.Random random = new Random(~unchecked((int)DateTime.Now.Ticks));
  357. for (int i = 0; i < Length; i++)
  358. {
  359. int rnd = random.Next(0, n);
  360. result += Pattern[rnd];
  361. }
  362. return result;
  363. }
  364. public static string ToPinYin(string val)
  365. {
  366. StringBuilder sb = new StringBuilder();
  367. val.ToCharArray().ToList().ForEach(x =>
  368. {
  369. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  370. {
  371. sb.Append(x);
  372. }
  373. else
  374. {
  375. try
  376. {
  377. ChineseChar cc = new ChineseChar(x);
  378. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  379. {
  380. sb.Append(cc.Pinyins[0]);
  381. }
  382. }
  383. catch (Exception ex)
  384. {
  385. }
  386. }
  387. });
  388. return sb.ToString().ToLower();
  389. }
  390. public static string ToFirstPinYin(string val)
  391. {
  392. StringBuilder sb = new StringBuilder();
  393. val.ToCharArray().ToList().ForEach(x =>
  394. {
  395. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  396. {
  397. sb.Append(x);
  398. }
  399. else
  400. {
  401. try
  402. {
  403. ChineseChar cc = new ChineseChar(x);
  404. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  405. {
  406. sb.Append(cc.Pinyins[0][0]);
  407. }
  408. }
  409. catch (Exception ex)
  410. {
  411. }
  412. }
  413. });
  414. return sb.ToString().ToLower();
  415. }
  416. public static List<string> comeRemoveStr = new List<string>() { "省", "市", "区", "州", "县", "旗", "盟", "自治" };
  417. public static List<string> prvcRemoveStr = new List<string>() { "回族", "维吾尔", "壮族", };
  418. public static List<string> cityRemoveStr = new List<string>() { "蒙古族", "地区", "壮族", "朝鲜族", "直辖" };
  419. public static List<string> nationRemoveStr = new List<string> {
  420. "维吾尔","回族", "自治", "满族", "蒙古", "壮族", "苗族" , "侗族", "瑶族",
  421. "达斡尔","鄂温克","朝鲜","畲族","土家","各族","仫佬","毛南","羌族","彝族","仡佬","布依","水族",
  422. "傣族","纳西","哈尼","拉祜","佤族","傈僳","独龙","怒族","白族","普米","固族","哈萨克","土族","撒拉","景颇","族"
  423. };
  424. public static List<string> schemoveStr = new List<string> { "第", "校区", "部", "楼", "与", "学校", "校园", };
  425. public static List<string> schooRemoveStr = new List<string>() {"省", "市", "区", "州", "县", "旗", "盟","办事处","街道", "自治",
  426. "镇","村","乡","街","路","站","馆"
  427. };
  428. public static List<string> afterSchoolRm = new List<string>() {"校","园","院", "湾","峡","沟","山","庄",
  429. "堡","江","屯","岭","溪","河","桥","营","铺","坡","寨","场","湖","巷","集","关","庙","寺","矿","塘"};
  430. public static List<KeyValuePair<string, string>> areaRemoveStr = new List<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. new KeyValuePair<string, string>("基础", ""),
  460. new KeyValuePair<string, string>("制造", "")
  461. };
  462. public static List<KeyValuePair<string, string>> schooReplaceStr = new List<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. new KeyValuePair<string, string>("社会", "社") ,
  591. new KeyValuePair<string, string>("自动化", "自") ,
  592. };
  593. public static List<KeyValuePair<string, string>> proReplaceStr = new List<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. new KeyValuePair<string, string>("澳门","澳") ,
  627. new KeyValuePair<string, string>("台湾","台")
  628. };
  629. }
  630. }