diff --git a/src/Text.java b/src/Text.java index 1811f7b..d801203 100644 --- a/src/Text.java +++ b/src/Text.java @@ -137,10 +137,11 @@ public class Text { wordbook = createWordlist(); String input; ArrayList output = new ArrayList<>(); + ArrayList values; for (Map.Entry> entry : wordbook.entrySet()) { input = ""; String key = entry.getKey(); - ArrayList values = entry.getValue(); + values = entry.getValue(); if (values.get(0) >= 3) { input += key + " "; for (int i = 1; i < values.size(); i++) { @@ -167,7 +168,7 @@ public class Text { String firstLetter; String restLetters; for (int i = 0; i < text.size(); i++) { - String[] words = text.get(i).trim().toLowerCase().split("[ :;.,!?><'/]+"); + String[] words = text.get(i).trim().toLowerCase().split("[ :;.,!?><'/\n]+"); for (String word : words) { counter = 1; firstLetter = word.substring(0, 1);