blob: 5c3f8ebfdf703cd778a3efadc9330fad15e30c8e [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() {
Akron049e5262022-03-18 09:59:34 +010018 println!("{}</eos>", sentence.text());
Akron2e211f62022-03-01 15:18:36 +010019 }
20
21 Ok(())
22}