% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ngrams.R
\name{get_tuple}
\alias{get_tuple}
\title{Compatibility wrapper for \code{jiebaR::get_tuple()}}
\usage{
get_tuple(x, size = 2, dataframe = TRUE)
}
\arguments{
\item{x}{A character vector of tokens or a list of character vectors.}

\item{size}{A single integer >= 2. The compatibility semantics count all
contiguous n-grams from 2 up to \code{size}.}

\item{dataframe}{Whether to return a data frame. If \code{FALSE}, a named integer
vector is returned.}
}
\value{
If \code{dataframe = TRUE}, a data frame with \code{name} and \code{count} columns,
sorted by descending count. Otherwise, a named integer vector.
}
\description{
\code{get_tuple()} is kept only for compatibility with \code{jiebaR}. New code should
use \code{\link[=count_ngrams]{count_ngrams()}} instead.
}
\details{
This function is deprecated and should not be used in new code.
It is provided only as a compatibility wrapper around \code{\link[=count_ngrams]{count_ngrams()}}
and replicates the behavior of \code{jiebaR::get_tuple()}.

Prefer \code{\link[=count_ngrams]{count_ngrams()}} because the original \code{jiebaR::get_tuple()} interface
has several design problems:
\enumerate{
\item Its n-gram extraction behavior does not match the most obvious reading of
the argument name: \code{size = n} counts all contiguous n-grams from \code{2:n},
not just the exact size \code{n}.
\item Its documentation says it accepts list input, but the original exported
implementation does not reliably support lists.
\item It concatenates tokens without a separator, which makes tuple boundaries
ambiguous.
}
}
\examples{
suppressWarnings(get_tuple(c("sd", "sd", "sd", "rd"), 2))
}
\seealso{
\code{\link[=count_ngrams]{count_ngrams()}}
}
