Skip to contents

Lists of stop words for extract_ngrams() and score_collocations(). English (the default of these functions) uses the list of the tidytext package (tidytext::stop_words, 1,149 words from the onix, SMART and snowball lexicons). Other languages use the stopwords package: the snowball lists (short, function words only) by default, or the larger stopwords-iso lists.

Usage

get_stop_words(language = "en", source = c("snowball", "stopwords-iso"), ...)

Arguments

language

Character vector of ISO 639-1 codes ("en", "fr", "de"...), e.g. the languages found by detect_language().

source

Source of the non-English lists in the stopwords package: "snowball" or "stopwords-iso" (more languages, longer lists). Use "stopwords-iso" for English too to get its list instead of tidytext's.

...

Not used: an argument renamed in the development version of mintR gives an error naming its replacement, any other one an error.

Value

A character vector for one language; a named list (one vector per language) for several, to give to extract_ngrams() with language_col, so that each text is filtered with the stop words of its language.

Examples

head(get_stop_words("fr"))
#> [1] "au"   "aux"  "avec" "ce"   "ces"  "dans"
str(get_stop_words(c("en", "de")))
#> List of 2
#>  $ en: chr [1:728] "a" "a's" "able" "about" ...
#>  $ de: chr [1:231] "aber" "alle" "allem" "allen" ...