transl33t: transl33t translates text into leet slang.

View source: R/text_fun.R

transl33tR Documentation

transl33t translates text into leet slang.

Description

transl33t translates text into leet (or l33t) slang given a set of rules.

Usage

transl33t(txt, rules = l33t_rul35, in_case = "no", out_case = "no")

Arguments

txt

The text (character string) to translate.

rules

Rules which existing character in txt is to be replaced by which new character (as a named character vector). Default: rules = l33t_rul35.

in_case

Change case of input string txt. Default: in_case = "no". Set to "lo" or "up" for lower or uppercase, respectively.

out_case

Change case of output string. Default: out_case = "no". Set to "lo" or "up" for lower or uppercase, respectively.

Details

The current version of transl33t only uses base R commands, rather than the stringr package.

Value

A character vector.

See Also

l33t_rul35 for default rules used; invert_rules for inverting rules.

Other text objects and functions: Umlaut, capitalize(), caseflip(), cclass, chars_to_text(), collapse_chars(), count_chars_words(), count_chars(), count_words(), invert_rules(), l33t_rul35, map_text_chars(), map_text_coord(), map_text_regex(), metachar, read_ascii(), text_to_chars(), text_to_sentences(), text_to_words(), words_to_text()

Examples

# Use defaults:
transl33t(txt = "hello world")
transl33t(txt = c(letters))
transl33t(txt = c(LETTERS))

# Specify rules:
transl33t(txt = "hello world", 
          rules = c("e" = "3", "l" = "1", "o" = "0"))

# Set input and output case:
transl33t(txt = "hello world", in_case = "up", 
          rules = c("e" = "3", "l" = "1", "o" = "0"))  # e only capitalized
transl33t(txt = "hEllo world", in_case = "lo", out_case = "up", 
          rules = c("e" = "3", "l" = "1", "o" = "0"))  # e transl33ted


ds4psy documentation built on Sept. 15, 2023, 9:08 a.m.