Skip to contents

Reduces text to its consonant skeleton by removing vowels (A, E, I, O, U, including accented variants). Two spellings that differ only in their vowels, such as "MEYER" and "MAYER" or "MUELLER" and "MULLER", collapse to the same skeleton, so they match despite the difference. It is a lighter-weight alternative to the phonetic encoders (as_soundex(), as_metaphone()) when you only want to ignore vowel variation.

Usage

strip_vowels(text)

Arguments

text

A character vector.

Value

A character vector with vowels removed, upper-cased and ASCII-folded.

Details

Returns text, so it goes ahead of a token generator in a pipeline.

See also

as_soundex() and as_metaphone() for full phonetic encoding.

Other text normalizers: normalize_street(), normalize_text()

Examples

strip_vowels("Mueller")   # "MLLR"
#> [1] "MLLR"
strip_vowels("Cafe Noir") # "CF NR"
#> [1] "CF NR"
strip_vowels(c("Anna", "Peter"))
#> [1] "NN"  "PTR"