knitr::opts_chunk$set(
  collapse=TRUE,
  comment="#>",
  # fig.path="man/figures/README-",
  out.width="100%"
)
options(tibble.print_min = 5, tibble.print_max = 5)

klartext

R Github All Releases

This package is under active development. Things might change without backwards compatibility.

Overview

klartext is a collection of tools to clean and normalize text.

Installation

# install.packages("remotes")
remotes::install_github("m-pilarski/klartext")

Usage

# reticulate::use_condaenv("r-reticulate")
# klartext:::check_num2words(.do_install=TRUE)
library(klartext)

example_emoji <- "πŸ˜€ πŸ˜† 😑 πŸ’€"
str_describe_emoji(example_emoji, .resolution="name")
str_describe_emoji(example_emoji, .resolution="subgroup")
str_describe_emoji(example_emoji, .resolution="group")


str_convert_nonascii("Ε¦ΓͺΕ›Ε₯ – - β€” β…› … Γ†Γ„ΓΆΓœ ?ΒΏ")


str_unify_spacing(c(
  "This    @test_at that\n #test_hash <test-no-tag>", 
  "<TEST_TAG> test!?!? An URL www.example.com/test ."
))


str_blur_numbers(c(
  "The two thousand and twenty United States presidential",
  "election was the 59th quadrennial presidential election",
  "held on Tuesday, November third, 2020. #2020"
))


# str_describe_numbers(c(
#   "The 2020 United States presidential election was the", 
#   "59th quadrennial presidential election held on Tuesday,",
#   "November 3rd, 2020."
# ))


m-pilarski/klartext documentation built on June 16, 2024, 1:35 p.m.