How do you implement a good profanity filter?

后端 未结 21 2645
误落风尘
误落风尘 2020-11-22 04:27

Many of us need to deal with user input, search queries, and situations where the input text can potentially contain profanity or undesirable language. Oftentimes this needs

21条回答
  •  耶瑟儿~
    2020-11-22 05:23

    Beware of localization issues: what is a swearword in one language might be a perfectly normal word in another.

    One current example of this: ebay uses a dictionary approach to filter "bad words" from feedback. If you try to enter the german translation of "this was a perfect transaction" ("das war eine perfekte Transaktion"), ebay will reject the feedback due to bad words.

    Why? Because the german word for "was" is "war", and "war" is in ebay dictionary of "bad words".

    So beware of localisation issues.

提交回复
热议问题