Пример #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (rtbSourceText.Text.IsNullOrEmpty())
            {
                WinFormControlHelper.AddLog(rtbLog, "请输入文本!!!", "");
            }

            WinFormControlHelper.AddLog(rtbLog, "开始分词", "");
            List <string> lsStrResult = PanGuSegmentHelper.SegmentToStringList(rtbSourceText.Text);

            if (lsStrResult.IsNull())
            {
                WinFormControlHelper.AddLog(rtbLog, "无分词结果!!!", "");
                return;
            }

            WinFormControlHelper.AddLog(rtbLog, "分词数", lsStrResult.Count.ToString());
            HashSet <string> hsStrResult = new HashSet <string>();

            foreach (string str in lsStrResult)
            {
                hsStrResult.Add(str);
            }

            WinFormControlHelper.AddLog(rtbLog, "不重复数", hsStrResult.Count.ToString());
            string strResult = "";

            foreach (string str in hsStrResult)
            {
                strResult += str + "\r\n";
            }
            rtbResultText.Text = strResult;
        }
Пример #2
0
        public frmResumeOutline()
        {
            InitializeComponent();

            tbStNo.Text  = "9028";
            tbEndNo.Text = "9075";
            string        path           = Path.Combine(Application.StartupPath, Config.CVJDKeywordFilePath);
            string        strCVJDKeyWord = FileHelper.ReadFromFile(path);                          //读文件
            List <string> lsCVJDKeyWord  = PanGuSegmentHelper.SegmentToStringList(strCVJDKeyWord); //盘古分词

            foreach (string key in lsCVJDKeyWord)                                                  //加入集合
            {
                hsCVJDKeyWord.Add(key);
            }
        }
Пример #3
0
        void funResumeOutLine(int ResumeID)
        {
            try
            {
                #region


                WinFormControlHelper.AddLog(rtbLog, "开始操作" + ResumeID, "");
                int    count  = 0;
                string _where = "";
                string _order = " id desc";
                //获取详情
                tabResumeModel modelRm = tabResumeBLL.GetInstance().GetModel(ResumeID);
                _where = string.Format(" id={0} ", modelRm.ParentID);
                tabUserModel modelUsr = tabUserBLL.GetInstance().GetModel(_where, 0);
                if (modelUsr.IsNull())
                {
                    modelUsr = new tabUserModel();
                }
                _where = string.Format(" ParentID={0} ", modelRm.id);
                List <tabExperienceEduModel> lsmodelEdu = tabExperienceEduBLL.GetInstance().GetModelList(20, 1, _where, _order, out count);
                if (lsmodelEdu.IsNull())
                {
                    lsmodelEdu = new List <tabExperienceEduModel>();
                }
                List <tabExperienceWorkModel> lsmodelWork = tabExperienceWorkBLL.GetInstance().GetModelList(20, 1, _where, _order, out count);
                if (lsmodelWork.IsNull())
                {
                    lsmodelWork = new List <tabExperienceWorkModel>();
                }
                List <tabExperienceProjectModel> lsmodelProject = tabExperienceProjectBLL.GetInstance().GetModelList(20, 1, _where, _order, out count);
                if (lsmodelProject.IsNull())
                {
                    lsmodelProject = new List <tabExperienceProjectModel>();
                }
                //组合成新的模型
                bool IsExist = false;
                _where = string.Format(" ResumeID={0} ", modelRm.id);
                tabResumeOutlineModel modelRmOtln = tabResumeOutlineBLL.GetInstance().GetModel(_where, 0);
                IsExist = modelRmOtln.IsNotNull();
                if (!IsExist)
                {
                    modelRmOtln = new tabResumeOutlineModel();
                }
                #region
                modelRmOtln.ResumeID     = modelRm.id;
                modelRmOtln.ResumeNo     = modelRm.ResumeNo;
                modelRmOtln.ResumeName   = modelRm.ResumeName;
                modelRmOtln.HopeAddress  = modelRm.HopeAddress;
                modelRmOtln.HopeIndustry = modelRm.HopeIndustry;
                modelRmOtln.HopePosition = modelRm.HopePosition;
                modelRmOtln.HopeSalary   = modelRm.HopeSalary;
                modelRmOtln.RealName     = modelUsr.RealName;
                modelRmOtln.Birthday     = modelUsr.Birthday;
                modelRmOtln.Mobile       = modelUsr.Mobile;
                modelRmOtln.Email        = modelUsr.Email;
                modelRmOtln.Sex          = modelUsr.Sex;
                string strSkill = modelRm.Other + " ";
                #region
                modelRmOtln.School = "";
                modelRmOtln.Major  = "";
                foreach (tabExperienceEduModel model in lsmodelEdu)
                {
                    modelRmOtln.School += model.SchoolName + " ";
                    modelRmOtln.Major  += model.ProfessionalName + " ";
                }
                #endregion
                #region
                foreach (tabExperienceWorkModel model in lsmodelWork)
                {
                    strSkill += model.PositionDuties + " " + model.WorkPerformance + " ";
                }
                #endregion
                #region
                foreach (tabExperienceProjectModel model in lsmodelProject)
                {
                    strSkill += model.ProjectDesc + " " + model.ProjectPerformance + " ";
                }
                #endregion
                #region  Skill
                //
                List <string> lsSkill = PanGuSegmentHelper.SegmentToStringList(strSkill); //分词
                hsCVSkill = new HashSet <string>();
                foreach (string key in lsSkill)                                           //加入集合
                {
                    hsCVSkill.Add(key);
                    hsCVJDSkillFull.Add(key);
                }
                //获得交集
                hsCVSkill.IntersectWith(hsCVJDKeyWord);
                //转化成字符串
                strSkill = "";
                foreach (string str in hsCVSkill)
                {
                    strSkill += str + " ";
                }
                modelRmOtln.Skill = strSkill;
                WinFormControlHelper.AddLog(rtbLog, modelRmOtln.ResumeName, modelRmOtln.Skill);
                #endregion
                #endregion
                //插入或更新
                if (IsExist)
                {
                    tabResumeOutlineBLL.GetInstance().Update(modelRmOtln);
                }
                else
                {
                    tabResumeOutlineBLL.GetInstance().Add(modelRmOtln);
                }

                #endregion
            }
            catch (Exception ex)
            {
                WinFormControlHelper.AddLog(rtbLog, "funResumeOutLine", ex.Message);
            }
        }
Пример #4
0
        void funPositionOutLine(int PositionID)
        {
            try
            {
                #region


                WinFormControlHelper.AddLog(rtbLog, "开始操作" + PositionID, "");
                int    count  = 0;
                string _where = "";
                string _order = " id desc";
                //获取详情
                tabPositionModel modelPos = tabPositionBLL.GetInstance().GetModel(PositionID);
                _where = string.Format(" id={0} ", modelPos.ParentID);
                tabOrgModel modelOrg = tabOrgBLL.GetInstance().GetModel(_where, 0);
                if (modelOrg.IsNull())
                {
                    modelOrg = new tabOrgModel();
                }

                //组合成新的模型
                bool IsExist = false;
                _where = string.Format(" PositionID={0} ", modelPos.id);
                tabPositionOutlineModel modelPosOtln = tabPositionOutlineBLL.GetInstance().GetModel(_where, 0);
                IsExist = modelPosOtln.IsNotNull();
                if (!IsExist)
                {
                    modelPosOtln = new tabPositionOutlineModel();
                }
                #region
                modelPosOtln.PositionID      = modelPos.id;
                modelPosOtln.PositionName    = modelPos.PositionName;
                modelPosOtln.RequireWorkYear = modelPos.RequireYear;
                modelPosOtln.RequireXueLi    = modelPos.RequireEdu;
                modelPosOtln.SalaryBein      = modelPos.SalaryBein;
                modelPosOtln.SalaryEnd       = modelPos.SalaryEnd;
                modelPosOtln.WordAddress     = modelPos.WordAddress;

                modelPosOtln.OrgName  = modelOrg.OrgName;
                modelPosOtln.OrgPro   = modelOrg.OrgPro;
                modelPosOtln.OrgScale = modelOrg.Scale;

                string strSkill = " ";
                strSkill += modelPos.PositionDesc + " ";
                strSkill += modelPos.RequireContent + " ";
                strSkill += modelPos.RequireAbility + " ";
                strSkill += modelPos.RequireExperience + " ";
                strSkill += modelPos.AdditionInfo + " ";
                #region  Skill
                //
                List <string> lsSkill = PanGuSegmentHelper.SegmentToStringList(strSkill); //分词
                hsJDSkill = new HashSet <string>();
                foreach (string key in lsSkill)                                           //加入集合
                {
                    hsJDSkill.Add(key);
                    hsCVJDSkillFull.Add(key);
                }
                //获得交集
                hsJDSkill.IntersectWith(hsCVJDKeyWord);
                //转化成字符串
                strSkill = "";
                foreach (string str in hsJDSkill)
                {
                    strSkill += str + " ";
                }
                modelPosOtln.RequireSkill = strSkill;
                WinFormControlHelper.AddLog(rtbLog, modelPosOtln.PositionName, modelPosOtln.RequireSkill);
                #endregion
                #endregion
                //插入或更新
                if (IsExist)
                {
                    tabPositionOutlineBLL.GetInstance().Update(modelPosOtln);
                }
                else
                {
                    tabPositionOutlineBLL.GetInstance().Add(modelPosOtln);
                }

                #endregion
            }
            catch (Exception ex)
            {
                WinFormControlHelper.AddLog(rtbLog, "funPositionOutLine", ex.Message);
            }
        }