correction in the add method of Text.java
This commit is contained in:
parent
d2361e870b
commit
6ba8ab23af
|
@ -35,7 +35,7 @@ public class Text {
|
||||||
*/
|
*/
|
||||||
public boolean add(int paragraphNumber, String newText) {
|
public boolean add(int paragraphNumber, String newText) {
|
||||||
if (paragraphExists(paragraphNumber)) {
|
if (paragraphExists(paragraphNumber)) {
|
||||||
text.add((paragraphNumber - 1), newText);
|
text.add((paragraphNumber - 1), newText.replaceAll("[^A-Za-z0-9 .,:?!\"'-]", ""));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
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.
|
* 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<String, ArrayList<Integer>> wordbook) {
|
private void createWordlist(HashMap<String, ArrayList<Integer>> wordbook) {
|
||||||
ArrayList<Integer> numbersList;
|
ArrayList<Integer> numbersList;
|
||||||
|
|
Loading…
Reference in New Issue