diff --git a/README.md b/README.md index 32e9d41..0749d37 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ RISolve ## Tests - Getting paragraphs from `law_id` (`risparser::overview::test::parse()`) - Create file `law_id` in `./data/expected/overview` (then run tests to get current output + save in file) +- Parsing paragraphs: add test in `src/risparser/paragraph/mod.rs` +- # Features (to be moved to lib.rs one-by-one) diff --git a/src/law/mod.rs b/src/law/mod.rs index 93f0035..e9147d0 100644 --- a/src/law/mod.rs +++ b/src/law/mod.rs @@ -135,32 +135,6 @@ impl PartialEq for LawBuilder { } impl LawBuilder { - //#[cfg(test)] - //pub fn test(name: &str) -> Self { - // let mut classifiers = Vec::new(); - - // if name == "new" { - // classifiers.push(Classifier::new("a", Arc::new(&contains)).root()); - // classifiers.push(Classifier::new("b", Arc::new(&contains))); - // classifiers.push(Classifier::new("c", Arc::new(&contains))); - // classifiers.push(Classifier::new("d", Arc::new(&contains))); - // } else if name == "UrhG" { - // classifiers.push(Classifier::new("Hauptstück", Arc::new(&contains)).root()); - // classifiers.push(Classifier::new("Abschnitt", Arc::new(&contains))); - // classifiers.push(Classifier::new("Number", Arc::new(&starts_with_number))); - // } - - // Self { - // name: name.into(), - // classifiers, - // header: Vec::new(), - // next_para_header: None, - // last_instance: None, - // #[cfg(test)] - // history: Vec::new(), - // } - //} - /// Creates a new law builder. Adds classifier for known law texts. pub fn new(name: &str) -> Self { Self { @@ -172,15 +146,6 @@ impl LawBuilder { #[cfg(test)] history: Vec::new(), } - - //let paragraphs = overview::parse(law_id.unwrap()).unwrap(); - - //for paragraph in tqdm::tqdm(paragraphs.into_iter()) { - // let cont = paragraph::parse(¶graph, &mut builder).unwrap(); - // if !cont { - // break; - // } - //} } pub fn add_classifier(&mut self, classifier: Classifier) { @@ -460,95 +425,3 @@ impl Display for Content { } } } - -//#[cfg(test)] -//mod tests { -// use pretty_assertions::assert_eq; -// use std::{ -// fs::File, -// io::{self, BufRead, Read}, -// path::Path, -// }; -// -// use super::*; -// -// fn read_lines
(filename: P) -> io::Result