indexTest method added to TextTest

This commit is contained in:
Andrin Fassbind
2021-11-10 18:19:40 +01:00
parent 77cabcf39a
commit 549444b63c
4 changed files with 47 additions and 11 deletions
+2
View File
@@ -172,10 +172,12 @@ public class Text {
for (int i = 0; i < text.size(); i++) {
String[] words = text.get(i).trim().toLowerCase().split("[ :;.,!?><'/\n]+");
for (String word : words) {
//Words get formatted consistently
counter = 1;
firstLetter = word.substring(0, 1);
restLetters = word.substring(1);
word = firstLetter.toUpperCase() + restLetters;
//Words are beeing counted
if (wordbook.containsKey(word)) {
numbersList = wordbook.get(word);
counter = numbersList.get(0);
+1
View File
@@ -3,6 +3,7 @@ public class TextEditor {
public static void main(String[] args) {
TextLogik t = new TextLogik();
}
}