% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/token_index.R
\name{token_index}
\alias{token_index}
\title{Build an index of tokens and documents}
\usage{
token_index(corpus, min_doc_count = 2, max_doc_count = Inf)
}
\arguments{
\item{corpus}{A \code{\link{TextReuseCorpus}} with retained tokens.}

\item{min_doc_count}{Minimum number of documents a token must appear in to
be retained. Increase this to remove rare tokens.}

\item{max_doc_count}{Maximum number of documents a token may appear in to be
retained. Decrease this to remove very common tokens.}
}
\value{
A \code{textreuse_token_index} data frame with columns \code{token},
  \code{docs}, and \code{n_docs}.
}
\description{
Build an inverted index from tokens to the documents that contain them. This
is useful for finding document pairs that share one or more n-grams without
comparing every document pair. The corpus must be created with
\code{keep_tokens = TRUE}.
}
