Added nnsplit
Change-Id: Iee46144b8b128773bc9e3f8cff0941ed7154236d
diff --git a/nnsplit_bench/src/main.rs b/nnsplit_bench/src/main.rs
new file mode 100644
index 0000000..f057006
--- /dev/null
+++ b/nnsplit_bench/src/main.rs
@@ -0,0 +1,22 @@
+use std::env;
+use std::fs;
+
+fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let splitter =
+ nnsplit::NNSplit::load("de", nnsplit::NNSplitOptions::default())?;
+
+ let args: Vec<String> = env::args().collect();
+ let filename = &args[1];
+
+ let contents = fs::read_to_string(filename)
+ .expect("Something went wrong reading the file");
+
+ let input: Vec<&str> = vec![&contents];
+ let splits = &splitter.split(&input)[0];
+
+ for sentence in splits.iter() {
+ println!("{}", sentence.text());
+ }
+
+ Ok(())
+}
\ No newline at end of file