library(dplyr) library(glue) lang_counts <- load_langs()
Sweary is an R package that contains a database of swear words from different languages, cherry picked by native speakers.
The development version of this package can be installed using devtools:
devtools::install_github("pdrhlik/sweary")
| Language | Language code | Number of swear words |
| ------------- | ------------- | --------------------- |
r glue_collapse(lang_counts$label_row, sep = "\n")
| Total | r nrow(lang_counts)
langs | r sum(lang_counts$n)
|
All languages are stored in a swear_words
data frame.
library(sweary) head(swear_words)
You can only extract one language that you are interested in.
en_swear_words <- get_swearwords("en") head(en_swear_words)
If you are not comfortable with git
and pull requests, you can just follow steps 1-3. After you create the file, send it to me via email with a subject New sweary language: {LANG_CODE}. We will acknowledge you in the README after we approve of the changes.
data-raw/swear-word-lists/{LANG_CODE}_{LANG_NAME}
.\
Examples:\data-raw/swear-word-lists/en_English
data-raw/swear-word-lists/fr-CA_French (Canada)
\
Note that spaces and parentheses in file names are allowed.build_sweary()
. It becomes available when you git clone
the repository and call devtools::load_all()
. Or pressing Ctrl+Shift+L
in RStudio. Learn more about calling this function using ?build_sweary
.The idea first appeared after the South Park text analysis lightning talk at the Why R? 2018 conference in Wrocław. All the contributors will be acknowledged as the work progresses.
Here we would like to say BIG THANKS to native speakers that help us with swear words dictionaries:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.