Skip to content

Commit

Permalink
Merge pull request #36 from rosette-api/no-jira-jsonlite-cannot-use-hash
Browse files Browse the repository at this point in the history
NO-JIRA:  jsonlist::toJSON works with list and not hash.
  • Loading branch information
seth-mg authored Apr 9, 2019
2 parents 1bb370a + ffcad6d commit 0c8ad95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ git:
repos:
CRAN: https://cloud.r-project.org
r_packages:
- devtools
- httr
- jsonlite
- testthat
- optparse
- knitr
- optparse
- roxygen2
- testthat
after_install:
- cd rosetteApi
warnings_are_errors: true
Expand Down
7 changes: 3 additions & 4 deletions examples/similar_terms.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
source("../R/Api.R")
library(hash)
library(jsonlite)
library("optparse")
library(optparse)

option_list = list( make_option(c("-k", "--key"), action="store", default=NA, type='character',
help="Rosette API key"), make_option(c("-u", "--url"), action="store", default=NA, type='character',
Expand All @@ -10,7 +9,7 @@ opt_parser = OptionParser(option_list=option_list)
opt = parse_args(opt_parser)

similar_terms_data <- "spy"
opts <- hash()
opts <- list()
opts[["resultLanguages"]] <- list("deu", "spa", "jpn")

parameters <- list()
Expand All @@ -23,4 +22,4 @@ if (is.na(opt$url)){
result <- api(opt$key, "semantics/similar", parameters, NULL, NULL, opt$url)
}
print(jsonlite::toJSON(result$header, pretty = TRUE))
print(jsonlite::toJSON(result$content, pretty = TRUE))
print(jsonlite::toJSON(result$content, pretty = TRUE))

0 comments on commit 0c8ad95

Please sign in to comment.