blob: f057006448967bdd9bcbebdce866c9d4ec27f2f4 [file] [log] [blame]
Akron2e211f62022-03-01 15:18:36 +01001use std::env;
2use std::fs;
3
4fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let splitter =
6 nnsplit::NNSplit::load("de", nnsplit::NNSplitOptions::default())?;
7
8 let args: Vec<String> = env::args().collect();
9 let filename = &args[1];
10
11 let contents = fs::read_to_string(filename)
12 .expect("Something went wrong reading the file");
13
14 let input: Vec<&str> = vec![&contents];
15 let splits = &splitter.split(&input)[0];
16
17 for sentence in splits.iter() {
18 println!("{}", sentence.text());
19 }
20
21 Ok(())
22}