e_highlights: Get highlighted terms

Description Usage Arguments Examples

Description

Extract highlighted terms

Usage

1
2
3
4
5
6
7
whe_highlights(wh, flatten = FALSE)

## S3 method for class 'data.frame'
whe_highlights(wh, flatten = FALSE)

## S3 method for class 'character'
whe_highlights(wh, flatten = FALSE)

Arguments

wh

highlighted object returned by wh_collect, see examples.

flatten

whether to flatten ngrams.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
library(webhose)
token <- wh_token("xXX-x0X0xX0X-00X")

token %>%
  wh_news(q = '"R programming language"') %>%  # use highlight!
  wh_collect() -> rstats # collect results

rstats %>%
  whe_highlights() -> highlights

highlights <- rstats %>%
  dplyr::mutate(
    nparagraphs = whe_highlights(text)
  )

## End(Not run)

JohnCoene/webhoserx documentation built on June 15, 2019, 3:48 p.m.