hyphenate: Hyphenate a character vector of words

Description Usage Arguments Value Note Examples

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

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

1
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

1
2
3
4
5
6
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;")

hyphenatr documentation built on May 2, 2019, 5:58 a.m.