Commit 32e2a22a authored by Gabriel Gutu-Robu's avatar Gabriel Gutu-Robu

Merge branch 'cercetare_analiza_CV' into 'master'

Added check for essential sections of a CV

See merge request !108
parents a0dacc3e 6d3656bd
......@@ -413,8 +413,9 @@ public class PdfToTxtConverter {
BufferedReader bufferReader = new BufferedReader(new StringReader(lowerParsedText));
String line;
while ((line = bufferReader.readLine()) != null) {
line.trim();
for (String sectionTitle : lowerSectionTitles) {
if(line.contains(sectionTitle)) return true;
if(line.equals(sectionTitle)) return true;
}
}
} catch (IOException ex) {
......
......@@ -957,6 +957,27 @@ public class ReaderBenchServer {
socialNetworksLinks.add("LinkedIn");
socialNetworksLinks.add("Viadeo");
Set<String> experienceSectionTitles = new HashSet<>();
experienceSectionTitles.add("Expérience");
experienceSectionTitles.add("Expériences");
experienceSectionTitles.add("Experience");
experienceSectionTitles.add("Experiences");
experienceSectionTitles.add("Expériences professionnelles");
experienceSectionTitles.add("Expériences professionnelle");
experienceSectionTitles.add("Parcours professionnell");
experienceSectionTitles.add("Experiences professionnelles");
Set<String> competencesSectionTitles = new HashSet<>();
competencesSectionTitles.add("Compétences");
competencesSectionTitles.add("Competences");
competencesSectionTitles.add("Compétence");
competencesSectionTitles.add("Competence");
Set<String> educationSectionTitles = new HashSet<>();
educationSectionTitles.add("Formation");
educationSectionTitles.add("Formations");
educationSectionTitles.add("compétence");
Set<String> requiredParams = setInitialRequiredParams();
JSONObject json = (JSONObject) new JSONParser().parse(request.body());
// additional required parameters
......@@ -1052,6 +1073,18 @@ public class ReaderBenchServer {
result.getWarnings().add(ResourceBundle.getBundle("utils.localization.cv_errors").getString("social_network_viadeo_not_found"));
}
if (!pdfToTxtConverter.sectionExists(experienceSectionTitles)) {
result.getWarnings().add(ResourceBundle.getBundle("utils.localization.cv_errors").getString("experience_not_found"));
}
if (!pdfToTxtConverter.sectionExists(competencesSectionTitles)) {
result.getWarnings().add(ResourceBundle.getBundle("utils.localization.cv_errors").getString("competences_not_found"));
}
if (!pdfToTxtConverter.sectionExists(educationSectionTitles)) {
result.getWarnings().add(ResourceBundle.getBundle("utils.localization.cv_errors").getString("formation_not_found"));
}
queryResult.setData(result);
response.type("application/json");
......
......@@ -17,7 +17,9 @@ junior_too_many_pages=Vous devriez avoir un CV avec un maximum de 1 page. Soyez
senior_too_few_pages=Vous devriez avoir un CV avec au moins 2 pages. Essayez de d\u00e9tailler votre exp\u00e9rience.
senior_too_many_pages=Vous devriez avoir un CV avec un maximum de 3 pages. Soyez synth\u00e9tique.
experience_not_found=You should have a CV with work experience included.
competences_not_found=Vous devriez pr\u00e9senter vos meilleures comp\u00e9tences dans la premi\u00e8re partie de votre CV.
formation_not_found=You should include information about your studies in your CV.
junior_too_few_words=En tant que junior, vous devriez avoir un CV plus complet. Essayez de d\u00e9tailler votre exp\u00e9rience.
junior_too_many_words=En tant que junior, votre CV doit \u00eatre plus synth\u00e9tique et comporter moins de mots.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment