use super::Claim;
use super::text::normalise;
pub(super) const DERIVATIVE_MARKERS: &[&str] = &[
"reply",
"erratum",
"errata",
"corrigendum",
"correction",
"comment on",
"response to",
"in response",
"faculty opinions recommendation",
"retraction of",
"expression of concern",
];
pub fn is_derivative(title: &str) -> bool {
let words = format!(" {} ", normalise(title));
DERIVATIVE_MARKERS
.iter()
.any(|m| words.contains(&format!(" {m} ")))
}
pub(super) fn claim_mentions_derivative(claim: &Claim) -> bool {
[claim.text.as_deref(), claim.title.as_deref()]
.into_iter()
.flatten()
.any(is_derivative)
}