Skip to content

Commit

Permalink
Change underscore to space in word splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
bear101 committed Oct 24, 2023
1 parent c4e7cd4 commit a1695c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Client/jSpamBot/src/BadWords.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ boolean loadFile(String language, String filename) {
Vector<String> badwords_lower = new Vector<>();
for (String w : badwords)
badwords_lower.add(w.toLowerCase());

lang_badwords.put(language, badwords_lower);
return true;
}

boolean contains(String language, String sentence) {
sentence = sentence.toLowerCase();
sentence = sentence.toLowerCase().replace('_', ' ');

String[] words = sentence.split("\\W");
for (String word : words) {
if (word.isEmpty())
Expand Down
2 changes: 1 addition & 1 deletion Client/jSpamBot/src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
badwords.loadFile("french", "badwords_french.txt");

var bannetworks = IPBan.loadFile("vpnips.txt");

var sessions = new Vector<SpamBotSession>();
var lastServers = new Vector<TeamTalkServer>();
var serverlistUpdateTimeout = System.nanoTime();
Expand Down

0 comments on commit a1695c5

Please sign in to comment.