use crate::parser::NodeRef;
use crate::node_ext::NodeScoreStore;
use std::collections::HashSet;
#[derive(Debug, Clone)]
pub struct Metadata {
pub title: String,
pub by_line: String,
pub sitename: String,
pub excerpt: String,
pub published_time: String,
}
#[derive(Debug, Clone, Default)]
pub struct Product {
pub title: String,
pub content: Option<NodeRef>,
pub by_line: String,
pub dir: String,
pub sitename: String,
pub excerpt: String,
pub published_time: String,
pub score_store: NodeScoreStore,
}
#[derive(Debug, Clone)]
pub struct ExtractOptions {
pub debug: bool,
pub remove_style_tags: bool,
pub ready_for_epub: bool,
pub strip_unlikelys: bool,
pub weight_classes: bool,
pub keep_classes: bool,
pub classes_to_preserve: HashSet<String>,
pub clean_conditionally: bool,
pub max_elements_to_parse: u16,
pub n_top_candidates: u16,
pub char_threshold: u16,
pub link_density_modifier: f64,
}
impl Default for ExtractOptions {
fn default() -> ExtractOptions {
ExtractOptions {
debug: false,
remove_style_tags: true,
ready_for_epub: false,
strip_unlikelys: true,
weight_classes: true,
keep_classes: true,
classes_to_preserve: HashSet::new(),
clean_conditionally: true,
max_elements_to_parse: 0,
n_top_candidates: 5,
char_threshold: 500,
link_density_modifier: 0.0,
}
}
}