--- a +++ b/man/int_to_n_gram.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/preprocess.R +\name{int_to_n_gram} +\alias{int_to_n_gram} +\title{Encode sequence of integers to sequence of n-gram} +\usage{ +int_to_n_gram(int_seq, n, voc_size = 4) +} +\arguments{ +\item{int_seq}{Integer sequence} + +\item{n}{Length of n-gram aggregation} + +\item{voc_size}{Size of vocabulary.} +} +\value{ +A numeric vector. +} +\description{ +Input is sequence of integers from vocabulary of size \code{voc_size}. +Returns vector of integers corresponding to n-gram encoding. +Integers greater than \code{voc_size} get encoded as \code{voc_size^n + 1}. +} +\examples{ +int_to_n_gram(int_seq = c(1,1,2,4,4), n = 2, voc_size = 4) + +}