smmry_api: R API to access the SMMRY web service

Description Usage Arguments Examples

Description

SMMRY offers a service to automatically summarize a webpage or simply text. smmry_api allows to access this service from within R. To use it you need a SMMRY API Key (http://smmry.com/api) that has to be set as a environment variable SMMRY_PAT.

Usage

1
2
smmry_api(x = NULL, quick = TRUE, isurl = NULL, length = NULL,
  keywords = NULL, quote_avoid = FALSE, breaks = FALSE)

Arguments

x

string. text or url of the webpage to summarize - uses data from clipboard, if x is not set

quick

boolean. switch to decide if the result should be just the reduced text (default = TRUE), or a comprehensiv list of the API output (FALSE)

isurl

boolean. switch to decide if x should be treated as text (FALSE) or url (TRUE). If nothing is set (default = NULL), the function decides autonomously

length

integer. number of sentences returned by SMMRY, (default = 7)

keywords

integer. number of top keywords returned by SMMRY

quote_avoid

boolean. switch to decide if the SMMRY result should (default = FALSE) or shouldn't (TRUE) include quotations

breaks

boolean. switch to decide if the SMMRY result should (TRUE) or shouldn't (default = FALSE) contain the string "[BREAK]" between each sentence

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
lorem_ipsum <- "Lorem ipsum dolor sit amet, consetetur 
                sadipscing elitr, sed diam nonumy eirmod 
                tempor invidunt ut labore et dolore magna 
                aliquyam erat, sed diam voluptua. At vero 
                eos et accusam et justo duo dolores et ea 
                rebum. Stet clita kasd gubergren, no sea 
                takimata sanctus est Lorem ipsum dolor sit 
                amet. Lorem ipsum dolor sit amet, consetetur 
                sadipscing elitr, sed diam nonumy eirmod 
                tempor invidunt ut labore et dolore magna 
                aliquyam erat, sed diam voluptua. At vero 
                eos et accusam et justo duo dolores et ea 
                rebum. Stet clita kasd gubergren, no sea 
                takimata sanctus est Lorem ipsum dolor sit 
                amet."

testurl <- "https://en.wikipedia.org/wiki/Aregund"


  smmry_api(x = lorem_ipsum)
  smmry_api(x = lorem_ipsum, quick = FALSE)
  smmry_api(x = testurl)
  smmry_api(x = testurl, quick = FALSE)

nevrome/Rsmmry documentation built on May 23, 2019, 4:27 p.m.