label_parts_of_speech {textTools}R Documentation

Add a column with the parts of speech for each word in a text.table

Description

Add a column with the parts of speech for each word in a text.table

Usage

label_parts_of_speech(x, text)

Arguments

x

A text.table created by as.text.table().

text

A string, the name of the column in x to label the parts of speech.

Value

A text.table, with columns added for the matching part of speech and for flagging if the part of speech is for a multi-word phrase.

Examples

label_parts_of_speech(
as.text.table(
  x = as.data.table(
    list(
      col1 = c(
        "a",
        "b"
      ),
      col2 = c(
        tolower("The dog is nice because it picked up the newspaper."),
        tolower("The dog is extremely nice because it does the dishes.")
      )
    )
  ),
  text = "col2",
  split = " "
),
text = "col2"
)

[Package textTools version 0.1.0 Index]