detect_lang: Detect language of text

View source: R/text_preprocessing.R

detect_langR Documentation

Detect language of text

Description

This function attempts to detect the language of a text string. It implements a simple n-gram based approach that doesn't require additional packages.

Usage

detect_lang(text, sample_size = 1000)

Arguments

text

Text string to analyze

sample_size

Maximum number of characters to sample for language detection

Value

Character string containing the ISO 639-1 language code


LBDiscover documentation built on June 16, 2025, 5:09 p.m.