provenant/copyright/
mod.rs1use std::time::Duration;
14
15mod candidates;
16mod credits;
17mod detector;
18mod detector_input_normalization;
19pub mod golden_utils;
20mod grammar;
21mod hints;
22mod lexer;
23mod line_tracking;
24mod parser;
25mod patterns;
26mod prepare;
27mod refiner;
28mod types;
29
30pub use credits::{detect_credits_authors, is_credits_file};
31pub use types::{AuthorDetection, CopyrightDetection, HolderDetection};
32
33pub fn detect_copyrights(
34 content: &str,
35 max_runtime: Option<Duration>,
36) -> (
37 Vec<CopyrightDetection>,
38 Vec<HolderDetection>,
39 Vec<AuthorDetection>,
40) {
41 if let Some(max_runtime) = max_runtime {
42 detector::detect_copyrights_from_text_with_deadline(content, Some(max_runtime))
43 } else {
44 detector::detect_copyrights_from_text(content)
45 }
46}