private void Main_Load(object sender, EventArgs e) { _syncContext = SynchronizationContext.Current; _service = new ResumeParseService(); PrintCpuInfo(); PrintServiceStatus(); Notice("资源加载中....."); ThreadPool.QueueUserWorkItem((w) => { ResourcesConfig.Load(); Notice("资源加载完成"); UpdateUI(() => { btnDocExt.Enabled = true; btnParse.Enabled = true; btnResumeParse.Enabled = true; btnScan.Enabled = true; }); }); }
public void preProcess() { ResourcesConfig.Load(); string[] datas = ResumeText.Split(new string[] { "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries); foreach (string n in datas) { string line = n; if ((line.Contains("前程无忧") || line.Contains("智联招聘") || line.Contains("猎聘网"))) { continue; } line = Regex.Replace(line, "[\\u00A0]+", " "); line = Regex.Replace(line, "[\\\u3000]+", " "); line = line.Replace("http://my.51job.com", " ").Replace("此简历来自猎聘网", " ").Replace("Liepin.com ", " ").Replace("最大的中文高端招聘社区", " "); line = line.Replace(":", ":").Trim(); if (!line.IsNullOrWhiteSpace()) { resumeContentList.Add(line); } } // building segmentIndexMap info this.segmentMap = SegmentSplit.GetSegments(resumeContentList); foreach (var v in segmentMap) { string key = v.Key; SectionInfo sectionInfo = v.Value; string content = getContent(sectionInfo.Start, sectionInfo.End); this.segmentTextMap[key] = content; this.sectionInfoList.Add(sectionInfo); } }