Foros de discusión

RE: Profanity check for wall posts.

thumbnail
Sachin Mane, modificado hace 11 años.

Profanity check for wall posts.

Junior Member Mensajes: 76 Fecha de incorporación: 10/04/12 Mensajes recientes
Hello,

Is there any way we can implement profanity check for wall posts to remove bad words with something like %$$T^#?

Is there any open source library available which can be used?

Regards,
Sachin
thumbnail
Sandeep Nair, modificado hace 11 años.

RE: Profanity check for wall posts.

Liferay Legend Mensajes: 1744 Fecha de incorporación: 6/11/08 Mensajes recientes
You can achieve the same using Sanitizers in Liferay
thumbnail
Sachin Mane, modificado hace 11 años.

RE: Profanity check for wall posts.

Junior Member Mensajes: 76 Fecha de incorporación: 10/04/12 Mensajes recientes
Thanks Sandeep.
I looked at the Sanitizers but there is no usesable OOTB SanitizerImpl in liferay. It just provides a hook where we have to write our own implementation.
The DefaultSanitizerImpl returns the original string back without any modifications.

Is there any ready made implementation available?

Regards,
Sachin.
thumbnail
Sachin Mane, modificado hace 11 años.

RE: Profanity check for wall posts.

Junior Member Mensajes: 76 Fecha de incorporación: 10/04/12 Mensajes recientes
Okay. I think i will have to deploy antisamy hook and check if provides any Sanitizer impl.
thumbnail
Sandeep Nair, modificado hace 11 años.

RE: Profanity check for wall posts.

Liferay Legend Mensajes: 1744 Fecha de incorporación: 6/11/08 Mensajes recientes
Antisamy hook can be used as reference. You can also create your own santizer implementation class, by just setting the property in the hook
thumbnail
Sachin Mane, modificado hace 11 años.

RE: Profanity check for wall posts.

Junior Member Mensajes: 76 Fecha de incorporación: 10/04/12 Mensajes recientes
I tried AntiSamy hook. but i think it is only meant to remove malicious code from the content and not for removing bad words.
If a custom sanitizer is to be implemented, i will have to refer to some repository of bad words. It also needs to be able to filter the content based on the context in which the word is used.

Something similar is required to filter out offensive images to be uploaded.