% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/orm_dedup.R
\name{orm_dedup}
\alias{orm_dedup}
\title{Automatic deduplication of bibliographic records}
\usage{
orm_dedup(
  refs,
  fuzzy_threshold = 0.9,
  lang = getOption("orisma.lang", "en"),
  verbose = getOption("orisma.verbose", TRUE),
  save_log = TRUE
)
}
\arguments{
\item{refs}{An \code{orisma_refs} object returned by \code{\link[=orm_load]{orm_load()}}.}

\item{fuzzy_threshold}{Numeric (0–1). Similarity threshold for fuzzy
matching. Default \code{0.90} (90\% similarity = duplicate). Increase for
stricter matching, decrease for more aggressive deduplication.}

\item{lang}{Character. \code{"en"} or \code{"es"}. Overrides \code{orisma.lang} option.}

\item{verbose}{Logical. Print progress? Default \code{TRUE}.}

\item{save_log}{Logical. Save \code{dedup_log.csv} to working directory?
Default \code{TRUE}.}
}
\value{
An \code{orisma_refs} tibble with duplicates removed. Attributes record
deduplication statistics for inclusion in the PRISMA log.
}
\description{
\code{orm_dedup()} removes duplicate records using a \strong{three-step progressive
pipeline}:
\enumerate{
\item \strong{Exact DOI match} — most reliable signal; decisive for records with DOIs.
\item \strong{Normalised title match} — removes punctuation, accents, case, and extra
spaces before comparing; catches the same article listed with minor
typographic differences across databases.
\item \strong{Fuzzy match} — compares title + year + first author using
Optimal String Alignment distance; catches near-identical records that
escape exact matching (e.g. different journal abbreviations, truncated
author lists).
}

Only records that remain ambiguous after all three steps are flagged for
optional manual review. These are saved to \code{dedup_log.csv}.
}
\examples{
\dontrun{
refs    <- orm_load("my_references/")
deduped <- orm_dedup(refs)

# More aggressive fuzzy matching
deduped <- orm_dedup(refs, fuzzy_threshold = 0.85)

# Spanish messages, no log file
deduped <- orm_dedup(refs, lang = "es", save_log = FALSE)
}

}
