preprocess_text {text2emotion}R Documentation

Preprocess Text with Slang Handling

Description

This function performs multi-stage text preprocessing, including lowercasing, HTML cleaning, punctuation normalization, contraction expansion, internet slang replacement, emoticon replacement, and final standardization.

Usage

preprocess_text(text, use_textclean = TRUE, custom_slang = NULL)

Arguments

text

A character vector of input texts.

use_textclean

Logical. Whether to use textclean for internet slang and emoticon replacement. Default is TRUE.

custom_slang

A named character vector providing user-defined slang mappings. Optional.

Details

The preprocessing pipeline includes:

Value

A character vector of cleaned and normalized text.

Examples

preprocess_text("I'm feeling lit rn!!!")
preprocess_text("I can't believe it... lol :)", use_textclean = TRUE)


[Package text2emotion version 0.1.0 Index]