llo all,* im trying to build a simple software to modify words. from undesirable content from the internet for example : f*cking into sexual intercourse or something like that im very new into programming so any ideas would help me a lot. thanks
clarisaduta
0
Newbie Poster
Recommended Answers
Jump to Poste a database, or a list of words
Well for simple replacements you can maintain a hash table with keys are words to be replaced.
But for complex string systems you could research into semantic web and queries.
Jump to Postpublic String changeBadWords(String string, Collection<String> badWords) { for (String badWord : badWords) { string = changeBadWord(string, badWord); } return string; } private String changeBadWord(String sentence, String badWord) { return sentence.replace(badWord, censor(badWord)); } private String censor(String badWord) { for (String vowel : Arrays.asList("A", "E", "U", "O", "I", …
All 8 Replies
zw_jvdijk83
0
Newbie Poster
clarisaduta
0
Newbie Poster
crash1989
0
Newbie Poster
zw_jvdijk83
0
Newbie Poster
clarisaduta
0
Newbie Poster
clarisaduta
0
Newbie Poster
clarisaduta
0
Newbie Poster
Lucaci Andrew
140
Za s|n
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.