Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump log4j-api from 2.11.0 to 2.17.1 #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

<slf4j.version>1.7.25</slf4j.version>
<log4j-core.version>2.11.0</log4j-core.version>
<log4j-api.version>2.11.0</log4j-api.version>
<log4j-api.version>2.17.1</log4j-api.version>
<junit.version>4.12</junit.version>

<akka.version>2.5.2</akka.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Valence_ANEW=Affective Norms for English Words Valence
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public List<ComplexityIndex> build(Lang lang) {
if (!WordValences.SUPPORTED_LANGUAGES.contains(lang)) {
return result;
}
WordValences.getValences(lang).stream()
WordValences.getValences(lang).keySet().stream()
.forEach(sv -> {
result.add(new AvgWordsInList(
ComplexityIndicesEnum.AVG_WORDS_IN_LIST_PER_DOC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*/
package com.readerbench.textualcomplexity.wordLists;

import com.readerbench.coreservices.data.AbstractDocument;
import com.readerbench.coreservices.data.Word;
import com.readerbench.datasourceprovider.commons.ReadProperty;
import com.readerbench.datasourceprovider.pojo.Lang;
import com.readerbench.textualcomplexity.ComplexityIndex;

import java.io.*;
import java.util.ArrayList;
Expand All @@ -17,6 +19,7 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;

Expand All @@ -27,7 +30,7 @@
public class WordValences {

private static final Map<Lang, Map<String, Map<String, Double>>> WORD_VALENCE_MAP = new EnumMap<>(Lang.class);
private static final Map<Lang, List<String>> VALENCES_FOR_LANG = new EnumMap<>(Lang.class);
private static final Map<Lang, Map<String, String>> VALENCES_FOR_LANG = new EnumMap<>(Lang.class);
private static final Properties PROPERTIES = ReadProperty.getProperties("textual_complexity_paths.properties");
private static final String PROPERTY_VALENCES_NAME = "VALENCES_%s_PATH";
public static final List<Lang> SUPPORTED_LANGUAGES = Arrays.asList(Lang.en, Lang.fr, Lang.es);
Expand All @@ -44,9 +47,9 @@ private static void initLang(Lang lang) {
header = in.readLine();
}
String[] splitHeader = header.split(";");
ArrayList<String> valences = new ArrayList<>();
Map<String, String> valences = new HashMap<>();
for (int i = 1; i < splitHeader.length; i++) {
valences.add(splitHeader[i]);
valences.put(splitHeader[i], ResourceBundle.getBundle("sentiment_valences_descriptions", lang.getLocale()).getString(splitHeader[i]));
}
VALENCES_FOR_LANG.put(lang, valences);
String line;
Expand Down Expand Up @@ -74,7 +77,7 @@ public static Double getValenceForWord(Word word, String valence) {
.getOrDefault(valence, 0.);
}

public static List<String> getValences(Lang lang) {
public static Map<String, String> getValences(Lang lang) {
if (!VALENCES_FOR_LANG.containsKey(lang)) {
initLang(lang);
}
Expand Down