use super::tags::Tag; use super::dl_list::DLListItem; use super::section::Section; use std::collections::HashMap; #[derive(Debug)] pub struct Names { pub romaji: String, pub japanese: String, pub aliases: Vec, } #[derive(Debug)] pub struct Images { pub thumb: String, pub full: String, } #[derive(Debug)] pub struct Traits { pub official: Vec, pub indexed: Vec, } #[derive(Debug)] pub struct Character { pub name: Names, pub image: Images, pub tags: Vec, pub traits: Traits, pub extra: Vec, pub role: Option } pub fn get_sections() -> HashMap { let mut s: HashMap = HashMap::new(); s.insert("name".into(), Section::new("name", r#"(?is)Romaji Name.*?(.*?)\s?.*?Japanese Name.*?(.*?)\s?.*?Aliases.*?(.*?)\s?"#, vec!["romaji", "japanese", "aliases"])); s.insert("misc".into(), Section::new("misc", r#"(?is)Role.*?(.*?)\s?"#, vec!["role"])); s.insert("image".into(), Section::new("image", r#"(?is)

.*.*?

View Full Size Image"#, vec!["thumb", "full"])); s.insert("tags".into(), Section::new("tags", r#"(?is)tagged as

.*?(.*?)"#, vec!["tags_raw"])); s.insert("traits".into(), Section::new("traits", r#"(?is)indexed traits

.*?
(.*?)
.*?official traits\s?

.*?
(.*?)
"#, vec!["indexed_raw", "official_raw"])); s }