Improve structured CV fallback extraction
This commit is contained in:
@@ -55,12 +55,24 @@ public static class StructuredCvProfileJson
|
||||
primary.Contact.Website ??= secondary.Contact.Website;
|
||||
primary.Contact.LinkedIn ??= secondary.Contact.LinkedIn;
|
||||
|
||||
if (primary.Summary.Count == 0) primary.Summary = secondary.Summary;
|
||||
primary.Summary = primary.Summary.Count == 0
|
||||
? secondary.Summary
|
||||
: primary.Summary.Concat(secondary.Summary).Distinct(StringComparer.OrdinalIgnoreCase).ToList();
|
||||
if (primary.Jobs.Count == 0) primary.Jobs = secondary.Jobs;
|
||||
if (primary.Education.Count == 0) primary.Education = secondary.Education;
|
||||
if (primary.Skills.Count == 0) primary.Skills = secondary.Skills;
|
||||
if (primary.Languages.Count == 0) primary.Languages = secondary.Languages;
|
||||
if (primary.Interests.Count == 0) primary.Interests = secondary.Interests;
|
||||
primary.Skills = primary.Skills.Count == 0
|
||||
? secondary.Skills
|
||||
: primary.Skills.Concat(secondary.Skills).Distinct(StringComparer.OrdinalIgnoreCase).ToList();
|
||||
primary.Languages = primary.Languages.Count == 0
|
||||
? secondary.Languages
|
||||
: primary.Languages
|
||||
.Concat(secondary.Languages)
|
||||
.GroupBy(language => language.Name ?? string.Empty, StringComparer.OrdinalIgnoreCase)
|
||||
.Select(group => group.First())
|
||||
.ToList();
|
||||
primary.Interests = primary.Interests.Count == 0
|
||||
? secondary.Interests
|
||||
: primary.Interests.Concat(secondary.Interests).Distinct(StringComparer.OrdinalIgnoreCase).ToList();
|
||||
if (primary.OtherSections.Count == 0) primary.OtherSections = secondary.OtherSections;
|
||||
if (primary.Sections.Count == 0) primary.Sections = secondary.Sections;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user