hyphenate: Hyphenate a character vector of words

View source: R/hyphen.r View source: R/RcppExports.R

hyphenateR Documentation

Hyphenate a character vector of words

Description

Given a character vector (one word per element), this function will hyphenate the strings or return a list of separated hyphenated string components.

Usage

hyphenate(words, simplify = TRUE)

Arguments

words

character vector of words

simplify

if TRUE, will return words with = as the hyphen character. If FALSE, will return a list of separated, hyphenated word components. If a string (e.g. "-", "­" or '­") will use that character for the hyphen character.)

Value

a character vector or a list depending on the value of simplify.

Note

The en_US hyphenation rules dictionary is loaded by default

Examples

dat <- readLines(system.file("extdata/top10000en.txt", package="hyphenatr"))

out1 <- hyphenate(dat)
out2 <- hyphenate(dat, simplify=FALSE)
out3 <- hyphenate(dat, simplify="-")
out4 <- hyphenate(dat, simplify="&shy;")

hrbrmstr/hyphenatr documentation built on July 28, 2023, 8:03 p.m.