slw: Combine single letter words

Description Usage Arguments Value

Description

A function to combine words in which the letters have been separated with spaces to avoid content moderation. It was inspired by Hosseini et al.'s paper on deceiving the Perspective API, available here: https://arxiv.org/pdf/1702.08138.pdf

Usage

1
slw(temp)

Arguments

pattern

vector containing one or more regular expressions (or character string for fixed = TRUE) to be matched in the given character vectors.

replacement

vector containing one or more replacements for matched pattern. Must be the same length as pattern.

x

a character vector where matches are sought, or an object which can be coerced by as.character to a character vector.

Value

vector with substituted values


bvidgen/tc documentation built on May 9, 2019, 2:21 a.m.