create_bow: Create a bag of words

Description Usage Arguments Value Author(s) See Also

View source: R/create_bow.R

Description

Create bags of words from either an analysis of syntactic relationships or a character string.

Usage

1
2
3
4
5
create_bow(
  text = NULL,
  basis = "lemma",
  keep_pos = c("NOUN", "PROPN", "ADJ", "VERB", "ADV")
)

Arguments

text

Tibble or character string. Either syntactic relationships for one document, as returned by create_syntrel after grouping per document, or one document as a single simplified (see clean_letters) and ideally lemmatized string (see clean_replace and dat_en_lemmas).

basis

Character string. Whether a bag of "word", a bag of "lemma", or a bag of "stem" should be returned (only for create_syntrel output).

keep_pos

Character vector. Parts of speech which should be kept to build the bags of words (only for create_syntrel output)

Value

A tibble simplified into a bag of words.

Author(s)

Nicolas Mangin

See Also

create_syntrel

clean_letters

clean_replace

dat_en_lemmas


NicolasJBM/lexR documentation built on Feb. 4, 2021, 6:43 p.m.