# Language and Profanity Filter Unity Asset

- Link: https://saguiitay.com/unity/language-and-profanity-filter/
- Published: 2018-09-25T20:32:05+03:00
- Author: Itay

## Overview

[Language and Profanity Filter](https://assetstore.unity.com/packages/slug/121901?aid=1101lS3S)
is the ultimate text filter for your project. Monitoring and controlling user generated
content is one of the main challenges when creating online games. With in-game chats
and forums, player-to-player (P2P) interaction and web/game integration being very
common these days, it’s the game developer’s responsibility to ensure a safe and(
usually) children-friendly environment.

With that in mind, I’d like to introduce my latest Unity Asset – [Language and Profanity Filter](https://assetstore.unity.com/packages/slug/121901?aid=1101lS3S).
Language and Profanity Filter is the ultimate text filter for your project. It provides
developers with a variety of filters to filter out unwanted content from their games,
thus providing a safer and friendlier user experience. Language and Profanity Filter
comes with a set of predefined filters, including bad words and profanities filters.
These filters come with support for various languages, such as English, German, 
French and Russian. Those filters come with a set of predefined blocked words, and
developers can easily add more words, or even create their own languages.

**[Purchase Language and Profanity Filter from the Unity Assets Store here >>](https://assetstore.unity.com/packages/slug/121901?aid=1101lS3S)**

In addition, several additional filters are provided out-of-the-box, such as emails
and web addresses filters, a punctuation filter (to prevent ASCII arts and excessive!!!
punctuation!!! usage!!!)

Finally, the asset comes with a generic regular expression (regex) filter, allowing
developers to identify and filter any unwanted content.

Language and Profanity Filter supports replacing filtered content with a placeholder(
e.g., ***) or by adding a prefix/suffix (such as `<b>` and `</b>`).

## Screenshots

![Language and Profanity Filter Screenshot](https://i0.wp.com/saguiitay.com/wp-content/
uploads/Screenshot4-11.png?resize=275%2C333&ssl=1 "Language and Profanity Filter
Unity Asset 1")

![Language and Profanity Filter Screenshot 3](https://i0.wp.com/saguiitay.com/wp-
content/uploads/Screenshot3-20.png?resize=276%2C151&ssl=1 "Language and Profanity
Filter Unity Asset 2")

![Language and Profanity Filter Screenshot 2](https://i0.wp.com/saguiitay.com/wp-
content/uploads/Screenshot2-21.png?resize=280%2C135&ssl=1 "Language and Profanity
Filter Unity Asset 3")

![Language and Profanity Filter Screenshot 1](https://i0.wp.com/saguiitay.com/wp-
content/uploads/Screenshot1-21.png?resize=805%2C330&ssl=1 "Language and Profanity
Filter Unity Asset 4")

![Language and Profanity Filter 9](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-9.png?resize=277%2C137&ssl=1 "Language and Profanity
Filter Unity Asset 5")

![Language and Profanity Filter 8](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-8.png?resize=273%2C280&ssl=1 "Language and Profanity
Filter Unity Asset 6")

![Language and Profanity Filter 7](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-7.png?resize=276%2C277&ssl=1 "Language and Profanity
Filter Unity Asset 7")

![Language and Profanity Filter 6](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-6.png?resize=275%2C333&ssl=1 "Language and Profanity
Filter Unity Asset 8")

![Language and Profanity Filter 5](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-5.png?resize=276%2C190&ssl=1 "Language and Profanity
Filter Unity Asset 9")

![Language and Profanity Filter 4](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-4.png?resize=544%2C579&ssl=1 "Language and Profanity
Filter Unity Asset 10")

## Supported Languages

Language and Profanity Filter supports multiple languages, and comes out of the 
box with the following list of supported languages (each language has its own list
of blocked words):

 * Arabic
 * Chinese
 * Czech
 * Danish
 * Dutch
 * English
 * Esperanto
 * Finnish
 * French
 * German
 * Hindi
 * Hungarian
 * Italian
 * Japanese
 * Korean
 * Norwegian
 * Persian
 * Polish
 * Portuguese
 * Russian
 * Spanish
 * Swedish
 * Thai
 * Turkish

In addition, Language and Profanity Filter supports [Leet language](https://en.wikipedia.org/wiki/Leet).

## Documentation

### How to use Language and Profanity Filter

![Language and Profanity Filter 1](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-1.png?resize=280%2C135&ssl=1 "Language and Profanity
Filter Unity Asset 11")

#### In Place mode

Add the `InPlaceFilter` script to an `InputField` object.

Add one or more `Filter` objects.

Text will be automatically filtered when the input changes in the `InputField`

![Language and Profanity Filter 2](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-2.png?resize=276%2C151&ssl=1 "Language and Profanity
Filter Unity Asset 12")

#### On Demand mode

Add the `OnDemandFilter` field to an object.

Assign an `InputField` and a target `Text` object.

From your scripts, or in the `OnClick` event of a button, invoke the `Filter()` 
method.

### Types of Filters

The component supports a variety of filters – Language, Email, Web Addresses, Punctuation
and Regex.

![Language and Profanity Filter 3](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-3.png?resize=805%2C330&ssl=1 "Language and Profanity
Filter Unity Asset 13")

#### Language

Language profanity filters support filtering a list of words. The filter uses a 
Language `ScriptableObject` that contains the list of unallowed words. The asset
comes with a list of 24 languages out of the box. It also supports custom languages.

![Language and Profanity Filter 4](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-4.png?resize=544%2C579&ssl=1 "Language and Profanity
Filter Unity Asset 10")

![Language and Profanity Filter 5](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-5.png?resize=276%2C190&ssl=1 "Language and Profanity
Filter Unity Asset 9")

Each Language filter can be assigned one or more Language objects:

![Language and Profanity Filter 6](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-6.png?resize=275%2C333&ssl=1 "Language and Profanity
Filter Unity Asset 16")

#### Emails

The Emails profanity filter is based on the more generic RegEx profanity filter,
and identifies email addresses.

![Language and Profanity Filter 7](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-7.png?resize=276%2C277&ssl=1 "Language and Profanity
Filter Unity Asset 17")

#### Web Sites

The Web Sites profanity filter is based on the more generic RegEx profanity filter,
and identifies web addresses.

![Language and Profanity Filter 8](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-8.png?resize=273%2C280&ssl=1 "Language and Profanity
Filter Unity Asset 18")

#### Punctuation

The Punctuation profanity filter allows identifying repeated punctuation signs and
prevent multiple repetitions.

![Language and Profanity Filter 9](https://i0.wp.com/saguiitay.com/wp-content/uploads/
Language-and-Profanity-Filter-9.png?resize=277%2C137&ssl=1 "Language and Profanity
Filter Unity Asset 19")

#### RegEx

The RegEx profanity filter is a generic filter, that allows identifying any regular
expression.
