Skip to main content

profanity_replace_request

Function profanity_replace_request 

Source
pub fn profanity_replace_request(
    api_key: &str,
    region: Region,
    text: &str,
    replace_text: &str,
) -> Result<Request<Vec<u8>>, RequestError>
Expand description

WebPurify replaces matched profanities, PII etc with a given symbol. This function only returns a request object, you need to do the actual HTTP request yourself.

Extend the function when more languages are required. Documentation: https://www.webpurify.com/documentation/additional/language/

§Arguments

  • api_key - a string slice that holds your WebPurify API Key

  • region - the regional WebPurify API to use

  • text - a string slice you want to be moderated by WebPurify

  • replace_text - a string slice to replace profanities in text with

§Examples

use tame_webpurify::client;
let res = client::profanity_replace_request("some-api-key", client::Region::Europe, "my filthy user-input string", "*");