inst/benchmarks/rbenchmark.r

library(rbenchmark)
library(tau)
library(ngram)

x <- ngram::rcorpus(50000)

reps <- 15
cols <- c("test", "replications", "elapsed", "relative")

benchmark(tau=textcnt(x, n=3, split=" ", method="string"), ngram=get.phrasetable(ngram(x, n=3)), replications=reps, columns=cols)

Try the ngram package in your browser

Any scripts or data that you put into this service are public.

ngram documentation built on Nov. 1, 2022, 1:06 a.m.