Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
felldo committed Mar 9, 2024
1 parent df1f254 commit d13ceda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion emoji_source_files/emojiterra-emoji-definition.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins {
`java-library`
`maven-publish`
signing
id("com.github.ben-manes.versions") version "0.50.0"
id("com.github.ben-manes.versions") version "0.51.0"
id("com.github.johnrengelman.shadow") version "8.1.1"
//https://github.com/melix/jmh-gradle-plugin
id("me.champeau.jmh") version "0.7.2"
Expand Down Expand Up @@ -319,7 +319,7 @@ buildscript {
classpath("com.squareup.okhttp3:okhttp:4.9.3")

classpath("org.jsoup:jsoup:1.17.2")
classpath("com.github.javaparser:javaparser-symbol-solver-core:3.25.8")
classpath("com.github.javaparser:javaparser-symbol-solver-core:3.25.9")
classpath(files(project.rootDir.path + "\\libs\\jemoji.jar"))
}
}
Expand Down
10 changes: 2 additions & 8 deletions lib/src/main/java/net/fellbaum/jemoji/EmojiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ public final class EmojiManager {
private static final Map<EmojiDescriptionLanguage, Map<String, String>> EMOJI_DESCRIPTION_LANGUAGE_MAP = new HashMap<>();

static {
// final String fileContent = readFileAsString();
// try {
// final List<Emoji> emojis = new ObjectMapper().readValue(fileContent, new TypeReference<List<Emoji>>() {});
//TODO: Automate somehow loading the emoji loader files?
final Set<Emoji> emojis = new HashSet<>();
emojis.addAll(EmojiLoaderA.EMOJI_LIST);
Expand All @@ -49,9 +46,6 @@ public final class EmojiManager {
EMOJIS_LENGTH_DESCENDING = Collections.unmodifiableList(emojis.stream().sorted(Comparator.reverseOrder()).collect(Collectors.toList()));

EMOJI_FIRST_CODEPOINT_TO_EMOJIS_ORDER_CODEPOINT_LENGTH_DESCENDING = emojis.stream().collect(getEmojiLinkedHashMapCollector());
// } catch (final JsonProcessingException e) {
// throw new RuntimeException(e);
// }
}

private static Collector<Emoji, ?, LinkedHashMap<Integer, List<Emoji>>> getEmojiLinkedHashMapCollector() {
Expand All @@ -68,10 +62,10 @@ public final class EmojiManager {
);
}

private static String readFileAsString(String filePathName) {
private static String readFileAsString(final String filePathName) {
try {
try (final InputStream is = EmojiManager.class.getResourceAsStream(filePathName)) {
if (is == null) return null;
if (null == is) return null;
try (final InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8);
final BufferedReader reader = new BufferedReader(isr)) {
return reader.lines().collect(Collectors.joining(System.lineSeparator()));
Expand Down

0 comments on commit d13ceda

Please sign in to comment.