Commit ddd7a507 authored by stefan's avatar stefan

Merge origin/master

parents 09d71613 32e2a22a
......@@ -148,7 +148,11 @@
<sparkjava.version>2.5.4</sparkjava.version>
<solrj.version>6.3.0</solrj.version>
<elasticsearch.version>5.6.2</elasticsearch.version>
<elasticsearch.version>5.4.0</elasticsearch.version>
<netty-all.version>4.1.7.Final</netty-all.version>
<log4j-core.version>2.7</log4j-core.version>
<log4j-api.version>2.7</log4j-api.version>
<lucene-core.vesrion>6.5.1</lucene-core.vesrion>
<slf4j.version>1.7.10</slf4j.version>
<c3p0.version>0.9.1.2</c3p0.version>
......@@ -548,6 +552,27 @@
<artifactId>transport</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<!-- Ths -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${lucene-core.vesrion}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j-core.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty-all.version}</version>
</dependency>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
......
......@@ -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");
......@@ -1502,11 +1535,6 @@ public class ReaderBenchServer {
eligibleLessons.put(new ResultEneaLesson(l.getLessonDescriptives(), l.getTitle(), l.getUri(), l.getTime(), l.getSimilarityScore(), ldpre, ldpost), l.getSimilarityScore());
}
Map<ResultEneaLesson, Double> eligibleLessonsSorted = eligibleLessons.entrySet().stream().sorted(Entry.comparingByValue()).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (e1, e2) -> e2, HashMap::new));
List<ResultEneaLesson> lessonsList = new ArrayList();
lessonsList.addAll(eligibleLessonsSorted.keySet());
it = keptLessons.entrySet().iterator();
List<String> recommendedList = new ArrayList<>();
Integer time = 0;
......@@ -1554,6 +1582,11 @@ public class ReaderBenchServer {
ldpost.add(l.getPostrequisites());
eligibleLessons.put(new ResultEneaLesson(l.getLessonDescriptives(), l.getTitle(), l.getUri(), l.getTime(), l.getSimilarityScore(), ldpre, ldpost), 0.0);
}
Map<ResultEneaLesson, Double> eligibleLessonsSorted = eligibleLessons.entrySet().stream().sorted(Entry.comparingByValue()).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (e1, e2) -> e2, HashMap::new));
List<ResultEneaLesson> lessonsList = new ArrayList();
lessonsList.addAll(eligibleLessonsSorted.keySet());
ResultEneaCustomisation result = new ResultEneaCustomisation(lessonsList, recommendedList, time, cmePoints);
QueryResultEneaCustomisation queryResult = new QueryResultEneaCustomisation();
......@@ -2001,6 +2034,8 @@ public class ReaderBenchServer {
= new webService.services.cscl.result.dto.Community("mathequalslove.blogspot.ro", "Math Equals Love");
webService.services.cscl.result.dto.Community community4
= new webService.services.cscl.result.dto.Community("MOOC", "Massive Open Online Courses");
webService.services.cscl.result.dto.Community community5 =
new webService.services.cscl.result.dto.Community("Barnes_MOOC", "Barnes Massive Open Online Courses");
webService.services.cscl.result.dto.Category category1
= new webService.services.cscl.result.dto.Category("online communities", "Online Communities",
......@@ -2010,7 +2045,7 @@ public class ReaderBenchServer {
Arrays.asList(community3));
webService.services.cscl.result.dto.Category category3
= new webService.services.cscl.result.dto.Category("MOOC", "Massive Open Online Courses",
Arrays.asList(community4));
Arrays.asList(community4, community5));
List<webService.services.cscl.result.dto.Category> categories = Arrays.asList(category1, category2, category3);
QueryResultAllCommunities queryResult = new QueryResultAllCommunities(categories);
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