From 11a7e88b95b6f236c1f92072255a0e4a15e75484 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 24 Mar 2021 09:41:36 +0100 Subject: [PATCH] Start a workspace --- instant-segment/Cargo.toml | 29 +++++++++++++++++++ {benches => instant-segment/benches}/bench.rs | 0 {src => instant-segment/src}/lib.rs | 0 {src => instant-segment/src}/test_cases.rs | 0 {src => instant-segment/src}/test_data.rs | 2 +- 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 instant-segment/Cargo.toml rename {benches => instant-segment/benches}/bench.rs (100%) rename {src => instant-segment/src}/lib.rs (100%) rename {src => instant-segment/src}/test_cases.rs (100%) rename {src => instant-segment/src}/test_data.rs (95%) diff --git a/instant-segment/Cargo.toml b/instant-segment/Cargo.toml new file mode 100644 index 0000000..24f1ca0 --- /dev/null +++ b/instant-segment/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "instant-segment" +version = "0.7.1" +authors = ["Dirkjan Ochtman "] +edition = "2018" +license = "Apache-2.0" +description = "Fast English word segmentation" +homepage = "https://github.com/InstantDomainSearch/instant-segment" +repository = "https://github.com/InstantDomainSearch/instant-segment" +documentation = "https://docs.rs/instant-segment" +readme = "../README.md" + +[features] +__test_data = ["test-cases"] +test-cases = [] +with-serde = ["serde", "ahash/serde", "smartstring/serde"] + +[dependencies] +ahash = "0.7.0" +smartstring = "0.2.5" +serde = { version = "1.0.123", features = ["derive"], optional = true } + +[dev-dependencies] +bencher = "0.1.5" +once_cell = "1.4" + +[[bench]] +name = "bench" +harness = false diff --git a/benches/bench.rs b/instant-segment/benches/bench.rs similarity index 100% rename from benches/bench.rs rename to instant-segment/benches/bench.rs diff --git a/src/lib.rs b/instant-segment/src/lib.rs similarity index 100% rename from src/lib.rs rename to instant-segment/src/lib.rs diff --git a/src/test_cases.rs b/instant-segment/src/test_cases.rs similarity index 100% rename from src/test_cases.rs rename to instant-segment/src/test_cases.rs diff --git a/src/test_data.rs b/instant-segment/src/test_data.rs similarity index 95% rename from src/test_data.rs rename to instant-segment/src/test_data.rs index bd86c1d..d15b1ad 100644 --- a/src/test_data.rs +++ b/instant-segment/src/test_data.rs @@ -13,7 +13,7 @@ fn test_data() { } pub fn segmenter() -> Segmenter { - let dir = PathBuf::from(format!("{}/data", env!("CARGO_MANIFEST_DIR"))); + let dir = PathBuf::from(format!("{}/../data", env!("CARGO_MANIFEST_DIR"))); let uni_file = dir.join("unigrams.txt"); let reader = BufReader::new(File::open(&uni_file).unwrap());