SchoolCode.cs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  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. if (!string.IsNullOrEmpty(tmpprovince))
  216. name = tmpname.Replace(tmpprovince, "");
  217. }
  218. }
  219. //替换城市信息词
  220. if (name.Length > 6)
  221. {
  222. if (!string.IsNullOrEmpty(tmpcity))
  223. {
  224. name = name.Replace(tmpcity, "");
  225. }
  226. }
  227. }
  228. int len = name.Length;
  229. if (len > 6)
  230. {
  231. foreach (var str in afterSchoolRm)
  232. {
  233. if (name.Length <= 6)
  234. {
  235. break;
  236. }
  237. name = name.Replace(str, "");
  238. }
  239. }
  240. len = name.Length;
  241. if (len >= 6)
  242. {
  243. name = $"{name.Substring(0, 1)}{name.Substring(len - 5, 3)}{name.Substring(len - 2, 2)}";
  244. }
  245. //if (len <= 7 && len > 6)
  246. //{
  247. // name = name.Substring(len - 6);
  248. //}
  249. if (len <= 4)
  250. {
  251. name = $"{schoolInfo.city.Substring(0, 2)}{name}";
  252. }
  253. if (len == 5)
  254. {
  255. name = $"{schoolInfo.city.Substring(0, 1)}{name}";
  256. }
  257. string code = ToFirstPinYin(name);
  258. schoolInfo.aname = name;
  259. schoolInfo.id = code;
  260. switch (schoolInfo.createCount)
  261. {
  262. case 1:
  263. if (schoolInfo.id.Equals(code))
  264. {
  265. string a_z = "abcdefghijklmnopqrstuvwxyz";
  266. var fs = schoolInfo.aname.Select(x => x).ToArray();
  267. var sp = schoolInfo.name.Select(x => x).ToArray();
  268. int Len = sp.Length;
  269. if (sp.Length >= fs.Length)
  270. {
  271. len = fs.Count();
  272. }
  273. for (int index = 0; index < len; index++)
  274. {
  275. if ($"{sp[index]}".Equals($"{fs[index]}"))
  276. {
  277. short st = ChineseChar.GetStrokeNumber(sp[index]);
  278. if (st > 0)
  279. {
  280. var ins = st % 27;
  281. var insch = a_z[ins];
  282. if (schoolInfo.aname.EndsWith($"{insch}"))
  283. {
  284. ins = (st + 1) % 27;
  285. insch = a_z[ins];
  286. }
  287. schoolInfo.id = schoolInfo.id.Insert(index, $"{insch}").Remove(index + 1, 1);
  288. break;
  289. }
  290. }
  291. }
  292. }
  293. break;
  294. case 2:
  295. if (schoolInfo.id.Equals(code))
  296. {
  297. var fs = schoolInfo.aname.Select(x => x).ToArray();
  298. var sp = schoolInfo.name.Select(x => x).ToArray();
  299. int Len = sp.Length;
  300. if (sp.Length >= fs.Length)
  301. {
  302. len = fs.Count();
  303. }
  304. for (int index = 0; index < len; index++)
  305. {
  306. if (!$"{sp[index]}".Equals($"{fs[index]}"))
  307. {
  308. var spstr = ToPinYin($"{sp[index]}");
  309. var fsstr = ToPinYin($"{fs[index]}");
  310. var insch = spstr.Select(x => $"{x}").Except(fsstr.Select(z => $"{z}"));
  311. if (insch != null && insch.Count() > 0)
  312. {
  313. if (index > 1)
  314. {
  315. schoolInfo.id = schoolInfo.id.Insert(index - 1, insch.First()).Remove(index, 1);
  316. }
  317. else if (index == 1)
  318. {
  319. schoolInfo.id = schoolInfo.id.Insert(index, insch.First()).Remove(index - 1, 1);
  320. }
  321. }
  322. }
  323. }
  324. }
  325. break;
  326. case 3:
  327. if (schoolInfo.id.Equals(code))
  328. {
  329. string letter = RandomSmallLetter(1, false);
  330. string small = code.Substring(0, code.Length - 1);
  331. bool end = code.EndsWith(letter);
  332. if (end)
  333. {
  334. string tempLetter = RandomSmallLetter(1, false);
  335. schoolInfo.id = $"{small}{tempLetter}";
  336. }
  337. else
  338. {
  339. schoolInfo.id = $"{small}{letter}";
  340. }
  341. }
  342. break;
  343. default:
  344. break;
  345. }
  346. return schoolInfo;
  347. }
  348. /// <summary>
  349. /// 生成随机字母
  350. /// </summary>
  351. /// <param name="Length">长度</param>
  352. /// <param name="Sleep">是否要在生成前将当前线程阻止以避免重复</param>
  353. /// <returns></returns>
  354. public static string RandomSmallLetter(int Length, bool Sleep)
  355. {
  356. if (Sleep) System.Threading.Thread.Sleep(3);
  357. 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' };
  358. string result = "";
  359. int n = Pattern.Length;
  360. System.Random random = new Random(~unchecked((int)DateTime.Now.Ticks));
  361. for (int i = 0; i < Length; i++)
  362. {
  363. int rnd = random.Next(0, n);
  364. result += Pattern[rnd];
  365. }
  366. return result;
  367. }
  368. public static string ToPinYin(string val)
  369. {
  370. StringBuilder sb = new StringBuilder();
  371. val.ToCharArray().ToList().ForEach(x =>
  372. {
  373. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  374. {
  375. sb.Append(x);
  376. }
  377. else
  378. {
  379. try
  380. {
  381. ChineseChar cc = new ChineseChar(x);
  382. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  383. {
  384. sb.Append(cc.Pinyins[0]);
  385. }
  386. }
  387. catch (Exception ex)
  388. {
  389. }
  390. }
  391. });
  392. return sb.ToString().ToLower();
  393. }
  394. public static string ToFirstPinYin(string val)
  395. {
  396. StringBuilder sb = new StringBuilder();
  397. val.ToCharArray().ToList().ForEach(x =>
  398. {
  399. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  400. {
  401. sb.Append(x);
  402. }
  403. else
  404. {
  405. try
  406. {
  407. ChineseChar cc = new ChineseChar(x);
  408. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  409. {
  410. sb.Append(cc.Pinyins[0][0]);
  411. }
  412. }
  413. catch (Exception ex)
  414. {
  415. }
  416. }
  417. });
  418. return sb.ToString().ToLower();
  419. }
  420. public static List<string> comeRemoveStr = new List<string>() { "省", "市", "区", "州", "县", "旗", "盟", "自治" };
  421. public static List<string> prvcRemoveStr = new List<string>() { "回族", "维吾尔", "壮族", };
  422. public static List<string> cityRemoveStr = new List<string>() { "蒙古族", "地区", "壮族", "朝鲜族", "直辖" };
  423. public static List<string> nationRemoveStr = new List<string> {
  424. "维吾尔","回族", "自治", "满族", "蒙古", "壮族", "苗族" , "侗族", "瑶族",
  425. "达斡尔","鄂温克","朝鲜","畲族","土家","各族","仫佬","毛南","羌族","彝族","仡佬","布依","水族",
  426. "傣族","纳西","哈尼","拉祜","佤族","傈僳","独龙","怒族","白族","普米","固族","哈萨克","土族","撒拉","景颇","族"
  427. };
  428. public static List<string> schemoveStr = new List<string> { "第", "校区", "部", "楼", "与", "学校", "校园", };
  429. public static List<string> schooRemoveStr = new List<string>() {"省", "市", "区", "州", "县", "旗", "盟","办事处","街道", "自治",
  430. "镇","村","乡","街","路","站","馆"
  431. };
  432. public static List<string> afterSchoolRm = new List<string>() {"校","园","院", "湾","峡","沟","山","庄",
  433. "堡","江","屯","岭","溪","河","桥","营","铺","坡","寨","场","湖","巷","集","关","庙","寺","矿","塘"};
  434. public static List<KeyValuePair<string, string>> areaRemoveStr = new List<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. new KeyValuePair<string, string>("完小", "小"),
  462. new KeyValuePair<string, string>("义务", ""),
  463. new KeyValuePair<string, string>("基础", ""),
  464. new KeyValuePair<string, string>("制造", "")
  465. };
  466. public static List<KeyValuePair<string, string>> schooReplaceStr = new List<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. new KeyValuePair<string, string>("管理", "管") ,
  593. new KeyValuePair<string, string>("社会主义", "社") ,
  594. new KeyValuePair<string, string>("社会", "社") ,
  595. new KeyValuePair<string, string>("自动化", "自") ,
  596. };
  597. public static List<KeyValuePair<string, string>> proReplaceStr = new List<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. new KeyValuePair<string, string>("新疆","新") ,
  629. new KeyValuePair<string, string>("香港","港") ,
  630. new KeyValuePair<string, string>("澳门","澳") ,
  631. new KeyValuePair<string, string>("台湾","台")
  632. };
  633. }
  634. }