最近在做cs3214 project, 编forum时有一个过滤器的问题不能解决, 请大侠们帮忙,万分感激。
requirement: E-moderator: Vulgar words or phrases are automatically replaced with hexes (‘###’). Strictly bans any occurrence of words/phrases that appear in the banned-words list, even if users deliberately join them together with other
words/punctuation to try and escape the ban.
就是说,不论是"shit", "s h i t" 还是"s^h#i*t", 都会被变成相对应的"####", "# # # #", or "#^###*#".
自己想来想去也找不到好算法,就靠各位高手们帮忙啦。如果能提供一些相关code最耗,不管怎样,小弟先谢过了。