use std::collections::HashSet;
use std::sync::LazyLock;
use regex::Regex;
use super::candidates::strip_balanced_edge_parens;
use super::prepare::prepare_text_line;
mod authors_junk_patterns;
mod copyrights_junk_patterns;
mod holders_junk_patterns;
use authors_junk_patterns::AUTHORS_JUNK_PATTERNS;
use copyrights_junk_patterns::COPYRIGHTS_JUNK_PATTERNS;
use holders_junk_patterns::HOLDERS_JUNK_PATTERNS;
mod constants;
mod copyright;
mod copyright_clauses;
mod holder;
mod junk;
use constants::*;
use copyright::*;
use copyright_clauses::*;
use holder::*;
use junk::*;
mod author;
mod utils;
pub(crate) use author::looks_like_name_with_parenthesized_url;
pub use author::refine_author;
pub use utils::{
remove_dupe_copyright_words, remove_some_extra_words_and_punct, strip_all_unbalanced_parens,
strip_prefixes, strip_solo_quotes, strip_some_punct, strip_suffixes, strip_trailing_period,
};
pub use copyright::refine_copyright;
pub use holder::{refine_holder, refine_holder_in_copyright_context};
pub use junk::is_junk_copyright;
pub(crate) use junk::{is_junk_holder, is_path_like_code_fragment};
fn compile_static_regex(pattern: &'static str) -> Regex {
Regex::new(pattern)
.unwrap_or_else(|err| panic!("invalid static refiner regex `{pattern}`: {err}"))
}
#[cfg(test)]
use self::utils::{strip_leading_numbers, strip_unbalanced_parens};
use self::author::{normalize_angle_bracket_comma_spacing, strip_trailing_company_co_ltd};
use self::utils::{
normalize_comma_spacing, normalize_whitespace, refine_names, remove_dupe_holder,
strip_repeated_leading_holder_prefix, strip_trailing_incomplete_as_represented_by,
strip_trailing_url, strip_trailing_url_slash, truncate_long_words,
};
#[cfg(test)]
mod tests;