Skip to content

Commit

Permalink
update to CRAN version 1.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampros committed Oct 29, 2021
1 parent db0da11 commit 5760c74
Show file tree
Hide file tree
Showing 9 changed files with 807 additions and 709 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: textTinyR
Type: Package
Title: Text Processing for Small or Big Data Files
Version: 1.1.4
Date: 2021-05-05
Version: 1.1.7
Date: 2021-10-29
Authors@R: c( person(given = "Lampros", family = "Mouselimis", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "https://orcid.org/0000-0002-8024-1546")))
BugReports: https://github.com/mlampros/textTinyR/issues
URL: https://github.com/mlampros/textTinyR
Expand All @@ -16,6 +16,6 @@ Imports: Rcpp (>= 0.12.10), R6, data.table, utils
LinkingTo: Rcpp, RcppArmadillo (>= 0.7.8), BH
Suggests: testthat, covr, knitr, rmarkdown
VignetteBuilder: knitr
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
NeedsCompilation: yes
Packaged: 2017-04-01 13:56:22 UTC; lampros
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@


## textTinyR 1.1.7

* I've included a function to omit a test for the Solaris OS during checking because I can not reproduce the error with the rhub solaris patched image


## textTinyR 1.1.6

* I've included a function to omit a test for the Solaris OS during checking


## textTinyR 1.1.5

* I modified the *functionality_of_textTinyR_package.Rmd* vignette in lines 732-746 based on a notification of the [knitr package maintainer](https://github.com/yihui/knitr/issues/2057). I mistakenly had 4 chunk delimiters rather than 3.


## textTinyR 1.1.4

* I modified the *inner_cm()* function to return a correlation of 0.0 in case that the output is NA or +/- Inf
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ to access the Rstudio console in order to give your username and password.

### **Citation:**

If you use the code of this repository in your paper or research please cite both **textTinyR** and the **original software** [https://cran.r-project.org/web/packages/textTinyR/citation.html](https://cran.r-project.org/web/packages/textTinyR/citation.html):
If you use the code of this repository in your paper or research please cite both **textTinyR** and the **original software** [https://CRAN.R-project.org/package=textTinyR/citation.html](https://CRAN.R-project.org/package=textTinyR/citation.html):

<br>

Expand All @@ -144,7 +144,7 @@ If you use the code of this repository in your paper or research please cite bot
title = {{textTinyR}: Text Processing for Small or Big Data Files},
author = {Lampros Mouselimis},
year = {2021},
note = {R package version 1.1.4},
note = {R package version 1.1.7},
url = {https://CRAN.R-project.org/package=textTinyR},
}
```
Expand Down
5 changes: 5 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// Path_2vector
std::vector<std::string> Path_2vector(std::string path_2folder, std::string path_2file);
RcppExport SEXP _textTinyR_Path_2vector(SEXP path_2folderSEXP, SEXP path_2fileSEXP) {
Expand Down
130 changes: 101 additions & 29 deletions tests/testthat/helper-function_for_tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,73 +8,145 @@ cnt_tsts <- 1


#-----------------------------------------------------------------------------------------------------
# exception for the Linux-debian-clang distribution because I get an error in the following languages
# exception for the Linux-debian-clang distribution because I get an error in the following languages
# due to the fact that the input text I use to test these functions includes apostrophes or dashes.
# This cannot be changed, therefore I'll skip these tests for the debian distribution
#
# greek, russian, bulgarian, arabic, armenian, bengali, estonian, hebrew, hindi, hungarian,
# greek, russian, bulgarian, arabic, armenian, bengali, estonian, hebrew, hindi, hungarian,
# irish, marathi, persian, spanish
#
# SEE also the e-mail that I received from CRAN at the end of this file.
#-----------------------------------------------------------------------------------------------------


exception_latin1_locale_debian = function() {

run_test = TRUE

if (Sys.info()[['sysname']] == 'Linux') {

extract_distribution = system2(command = "lsb_release", args = c("-i"), stdout = TRUE, stderr = TRUE) # https://www.cyberciti.biz/faq/find-linux-distribution-name-version-number/

find_debian = strsplit(extract_distribution, "\t")[[1]][2]

if (find_debian == "Debian") {

run_test = FALSE
}
}

return(run_test)
}


#========================================================================================================================================================================================
# message I received from CRAN on 11th April 2019:
#=================================================
#
#
# Prof Brian Ripley
# 11 Apr 2019, 09:00 (3 days ago)
# to Jeffrey, Emmanuel, Max, Hadley, David, Jim, Eugene, Bob, Erik, Shinya, Oliver, Kirill, Philippe, Scott, Noam, Gábor, Elin, Malte, Lorenz, Lionel, Sean, me, Florian, Edzer, CRAN
#
#
# This concerns packages
#
# CHNOSZ SARP.moodle caret dplyr fpeek fs gestalt hyphenatr incadata
# jpndistrict lobstr lucr pillar postGIStools rbison rchie rcmdcheck
# rcrossref rdatacite rerddap rgbif rplos skimr snakecase styler svglite
#
# CHNOSZ SARP.moodle caret dplyr fpeek fs gestalt hyphenatr incadata
# jpndistrict lobstr lucr pillar postGIStools rbison rchie rcmdcheck
# rcrossref rdatacite rerddap rgbif rplos skimr snakecase styler svglite
# swirl swirlify taxize testthat textTinyR traitdataform units urltools
#
# which are failing their checks in a strict Latin-1 locale: see the
#
# which are failing their checks in a strict Latin-1 locale: see the
# debian-clang results. (Several of these seem to stem from vcr.)
#
# On Linux, such a locale can be ensured via LC_CTYPE=en_US (which may
# need installing for distros that micro-package). AFAWK it cannot be
#
# On Linux, such a locale can be ensured via LC_CTYPE=en_US (which may
# need installing for distros that micro-package). AFAWK it cannot be
# done on Windows.
#
#
# 1) The character in don't is an (ASCII) apostrophe, not a right quote:
#
#
# don’t
#
# (with a right quote) is used in packages CHNOSZ dplyr ptstem skimr
#
# (with a right quote) is used in packages CHNOSZ dplyr ptstem skimr
# styler text2vec textTinyR (and others not failing).
#
#
# 2) en and em dashes are not portable, found in packages
# CHNOSZ SARP.moodle caret dplyr gestalt ptstem quanteda rchie rcrossref
# CHNOSZ SARP.moodle caret dplyr gestalt ptstem quanteda rchie rcrossref
# rdatacite rerddap rgbif rplos taxize textTinyR traitdataform units .
#
# 3) Using \uxxxx coding for non-ASCII chars in R character strings should
#
# 3) Using \uxxxx coding for non-ASCII chars in R character strings should
# help in some cases (see 'Writing R Extensions').
#
#
# Please correct before May 10 to safely retain the package on CRAN.
#========================================================================================================================================================================================
# message I received from CRAN on 13th Oct 2021:
#===============================================
#
# Prof Brian Ripley
#
# Dear maintainer,
#
# Please see the problems shown on
# <https://cran.r-project.org/web/checks/check_results_textTinyR.html>.
#
# Please correct before 2021-10-27 to safely retain your package on CRAN.
#
# The CRAN Team
#................................................

# The error occurred in:
# .
# .
# test-doc2vec.R : test id 112
#
# *** caught segfault ***
# address 28, cause 'memory not mapped'
#
# Traceback:
# 1: word_vectors_methods(private$pre_proc, self$token_list, self$word_vector_FILE, method, private$unq_tok, private$inp_wv_dims, gtw_terms, gtw_weights, self$print_every_rows, self$verbose, threads, self$copy_data)
# 2: INIT$doc2vec_methods(method = "sum_sqrt")
# 3: eval(code, test_env)
# 4: eval(code, test_env)
# 5: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
# 6: doTryCatch(return(expr), name, parentenv, handler)
# 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
# 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
# 9: doTryCatch(return(expr), name, parentenv, handler)
# 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
# 11: tryCatchList(expr, classes, parentenv, handlers)
# 12: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
# 13: test_code(desc, code, env = parent.frame(), reporter = reporter)
# 14: testthat::test_that("in case that the method parameter is 'sum_sqrt', it returns the correct output [ copy_data = TRUE ]", { INIT = Doc2Vec$new(token_list = tok_text, word_vector_FILE = PATH, copy_data = T) res = INIT$doc2vec_methods(method = "sum_sqrt") cat("test-doc2vec.R : test id", cnt_tsts, "\n") cnt_tsts <<- cnt_tsts + 1 testthat::expect_true(is.matrix(res) && nrow(res) == length(tok_text)) })
# 15: eval(code, test_env)
# 16: eval(code, test_env)
# 17: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
# 18: doTryCatch(return(expr), name, parentenv, handler)
# 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
# 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
# 21: doTryCatch(return(expr), name, parentenv, handler)
# 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
# 23: tryCatchList(expr, classes, parentenv, handlers)
# 24: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
# 25: test_code(NULL, exprs, env)
# 26: source_file(path, child_env(env), wrap = wrap)
# 27: FUN(X[[i]], ...)
# 28: lapply(test_paths, test_one_file, env = env, wrap = wrap)
# 29: doTryCatch(return(expr), name, parentenv, handler)
# 30: tryCatchOne(expr, names, parentenv, handlers[[1L]])
# 31: tryCatchList(expr, classes, parentenv, handlers)
# 32: tryCatch(code, testthat_abort_reporter = function(cnd) { cat(conditionMessage(cnd), "\n") NULL})
# 33: with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, wrap = wrap))
# 34: test_files(test_dir = test_dir, test_package = test_package, test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, wrap = wrap, load_package = load_package)
# 35: test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, wrap = wrap, load_package = load_package, parallel = parallel)
# 36: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
# 37: test_check("textTinyR")
# An irrecoverable exception occurred. R is aborting now ...
# Flavor: r-patched-solaris-x86
#................................................

# I omitted the test with id 328 from solaris testing:

is_solaris = function() {
return(grepl('SunOS', Sys.info()['sysname'])) # see: https://stackoverflow.com/a/23840917
}

# ========================================================================================================================================================================================

Loading

0 comments on commit 5760c74

Please sign in to comment.