label_parts_of_speech: Add a column with the parts of speech for each word in a...

Description Usage Arguments Value Examples

View source: R/text.table.R

Description

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

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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"
)

textTools documentation built on Feb. 5, 2021, 5:07 p.m.