diff --git a/src/Text.java b/src/Text.java index df37cb9..ad66600 100644 --- a/src/Text.java +++ b/src/Text.java @@ -35,7 +35,7 @@ public class Text { */ public boolean add(int paragraphNumber, String newText) { if (paragraphExists(paragraphNumber)) { - text.add((paragraphNumber - 1), newText); + text.add((paragraphNumber - 1), newText.replaceAll("[^A-Za-z0-9 .,:?!\"'-]", "")); return true; } return false; @@ -164,7 +164,7 @@ public class Text { /** * This method counts all words in text and adds the count together with the paragraph where the word has been used to a Hashmap. * - * @param wordbook + * @param wordbook the HashMap Object which should be edited */ private void createWordlist(HashMap> wordbook) { ArrayList numbersList;