update bible word counter
This commit is contained in:
1 file changed
+4
-2
@@ -37,7 +37,9 @@ public class WordCounter {
|
||||
lineScan.useDelimiter(" ");
|
||||
|
||||
while (lineScan.hasNext()) {
|
||||
String word = lineScan.next().toLowerCase();
|
||||
String word = lineScan.next().
|
||||
toLowerCase().
|
||||
replaceAll("[^a-z]", "");
|
||||
|
||||
boolean exists = false;
|
||||
for (int i = 0; i < words.size() && !exists; i++) {
|
||||
@@ -48,7 +50,7 @@ public class WordCounter {
|
||||
}
|
||||
}
|
||||
|
||||
if (!exists && Pattern.matches("^[a-zA-Z]+", word)) {
|
||||
if (!exists && Pattern.matches("^[a-z]+", word)) {
|
||||
words.add(new Word(word));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user