Skip to content

Commit fc528d4

Browse files
committed
inst : verbose text file names for testing in dp_tf()
1 parent d338ea2 commit fc528d4

File tree

11 files changed

+1066
-24
lines changed

11 files changed

+1066
-24
lines changed

R/rtext.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ rtext <-
260260
}
261261
}
262262

263+
#### Tokenize
264+
private$tokenize()
265+
266+
263267
##### ID
264268
if( is.null(id) ){
265269
self$id <- dp_hash(self)

benchmarks/benchmark_expanding_spans.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ library(diffrprojects)
22
library(magrittr)
33
library(microbenchmark)
44

5-
dings <- rtext$new(text_file=dp_tf(1), verbose=TRUE)
5+
dings <- rtext$new(text_file=dp_tf("rc_1.txt"), verbose=TRUE)
66
dings$get("char_data")
77

88
dings$char_data_set("pimpf", 1, 1)

benchmarks/benchmark_rtext_char_code.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ source("benchmarks/rtext_char_code1.R")
66
source("benchmarks/rtext_char_code2.R")
77

88
init1 <- function(){
9-
tmp1 <- rtext_char_chode1$new(text_file=dp_tf(3))
9+
tmp1 <- rtext_char_chode1$new(text_file=dp_tf("rc_3.txt"))
1010
for(i in 1:100){
1111
tmp1$char_code("hodor", sample(1:10, 1000, replace=TRUE), sample(tmp1$info()$character, 1000) )
1212
}
1313
cat(".")
1414
}
1515

1616
init2 <- function(){
17-
tmp2 <- rtext_char_chode2$new(text_file=dp_tf(3))
17+
tmp2 <- rtext_char_chode2$new(text_file=dp_tf("rc_3.txt"))
1818
for(i in 1:100){
1919
tmp2$char_code("hodor", sample(1:10, 1000, replace=TRUE), sample(tmp2$info()$character, 1000) )
2020
}

benchmarks/benchmark_text_tokenize.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ library(diffrprojects)
77
x1 <- "Daniel Defoe: Robinson Crusoe\n\n* Quelle"
88
x2 <- "Daniel Defoe: Robinson Crusoe\n\n* Quelle: "
99
x3 <- " Daniel Defoe: Robinson Crusoe\n\n* Quelle: "
10-
xfull <- text_read(dp_tf(1))
10+
xfull <- text_read(dp_tf("rc_1.txt"))
1111

1212
x <- x3
1313
regex <- "\\W+"
@@ -113,7 +113,7 @@ text_tokenize_5 <-
113113
x1 <- "Daniel Defoe: Robinson Crusoe\n\n* Quelle"
114114
x2 <- "Daniel Defoe: Robinson Crusoe\n\n* Quelle: "
115115
x3 <- " Daniel Defoe: Robinson Crusoe\n\n* Quelle: "
116-
xfull <- text_read(dp_tf(1))
116+
xfull <- text_read(dp_tf("rc_1.txt"))
117117

118118
x <- xfull
119119
regex <- "\\W+"
@@ -236,7 +236,7 @@ fixed=FALSE
236236
useBytes=FALSE
237237
group=c("words", "lines", "paragraphs")
238238

239-
xfull <- text_read(dp_tf(1))
239+
xfull <- text_read(dp_tf("rc_1.txt"))
240240
RES <- list()
241241
stime <- Sys.time()
242242

File renamed without changes.

inst/testfiles/rc_1_ch1.txt

Lines changed: 485 additions & 0 deletions
Large diffs are not rendered by default.

inst/testfiles/robinson_crusoe_fullbooks.txt renamed to inst/testfiles/rc_2.txt

File renamed without changes.

inst/testfiles/rc_2_ch1.txt

Lines changed: 64 additions & 0 deletions
Large diffs are not rendered by default.

inst/testfiles/robinson_crusoe_gutenberg.txt renamed to inst/testfiles/rc_3.txt

File renamed without changes.

inst/testfiles/rc_3_ch1.txt

Lines changed: 489 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)