Пример #1
0
 public RatingCounterTests(AlghorythmTestSeed testSeed)
 {
     _ratingCounter = testSeed.RatingCounter;
     _cV            = testSeed.CV;
     _vacancy       = testSeed.Vacancy;
     _splitedSkills = testSeed.SkillsMatcher.MatchSkills(testSeed.SkillKnowledge, testSeed.SplitedSkills);
 }
Пример #2
0
 private void ConfigCV()
 {
     CV = new CVAlghorythmModel()
     {
         Id              = new Guid("12aab432-50c0-424a-aae0-4cf89a3d577b"),
         Qualification   = INTERMEDIATE_QUALIFICATION_VALUE,
         SkillKnowledges = SkillKnowledge
     };
 }
Пример #3
0
        public int GetRating(VacancyAlghorythmModel vacancy, CVAlghorythmModel cV)
        {
            int middleWeight  = FindMiddleWeight(vacancy.SkillRequests);
            var splitedSkills = _skillSplitter.SplitSkills(vacancy.SkillRequests, middleWeight);

            splitedSkills = _skillsMatcher.MatchSkills(cV.SkillKnowledges, splitedSkills);

            return(_ratingCounter.CountRating(splitedSkills, cV, vacancy, middleWeight));
        }
Пример #4
0
        public int CountRating(SplitedSkillsAlghorythmModel splitedSkills, CVAlghorythmModel cv, VacancyAlghorythmModel vacancy
                               , int middleWeight)
        {
            int rating = 1;

            rating += CountOtherSkillScore(splitedSkills.SoftSkills, _softKnowledgeScaleStep);
            rating += CountMainSkillScore(splitedSkills.MainSkills);
            rating += CountOtherSkillScore(splitedSkills.HardSkills, _hardKnowledgeScaleStep);
            rating += CountLanguageSkillScore(splitedSkills, middleWeight);
            rating  = CountRatingWithQualification(rating, cv, vacancy);

            rating = RatingToZeroIfLess(rating);

            return(rating);
        }
Пример #5
0
        private int CountRatingWithQualification(int raiting, CVAlghorythmModel cv
                                                 , VacancyAlghorythmModel vacancy)
        {
            if (cv.Qualification < vacancy.Qualification)
            {
                raiting = raiting - raiting * (vacancy.Qualification - cv.Qualification)
                          * _qualificationScaleStep / PERCENT_DIVIDER;
            }
            else if (cv.Qualification > vacancy.Qualification)
            {
                raiting = raiting - raiting * (cv.Qualification - vacancy.Qualification)
                          * _qualificationScaleStep / PERCENT_DIVIDER;
            }

            return(raiting);
        }
Пример #6
0
        public List <IdAndRating> GetVacancysRaiting(IEnumerable <VacancyAlghorythmModel> vacancys, CVAlghorythmModel cV)
        {
            List <IdAndRating>           vacancysByRating = new List <IdAndRating>();
            SplitedSkillsAlghorythmModel splitedSkills;

            int middleWeight;
            int raiting;

            foreach (VacancyAlghorythmModel vacancy in vacancys)
            {
                middleWeight  = FindMiddleWeight(vacancy.SkillRequests);
                splitedSkills = _skillSplitter.SplitSkills(vacancy.SkillRequests, middleWeight);

                splitedSkills = _skillsMatcher.MatchSkills(cV.SkillKnowledges, splitedSkills);

                raiting = _ratingCounter.CountRating(splitedSkills, cV, vacancy, middleWeight);
                vacancysByRating.Add(new IdAndRating()
                {
                    Rating = raiting,
                    Id     = vacancy.Id
                });

                splitedSkills = new SplitedSkillsAlghorythmModel();
            }
            vacancysByRating = vacancysByRating.OrderByDescending(x => x.Rating).ToList();

            return(vacancysByRating);
        }