Skip to content

Commit a6b21b9

Browse files
committed
feat: added cli
1 parent b0a0891 commit a6b21b9

12 files changed

Lines changed: 879 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 185 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ categories = ["text-processing"]
1212
homepage = "https://github.com/PyDataBlog/simstring_rs"
1313
readme = "README.md"
1414

15+
[[bin]]
16+
name = "simstring"
17+
path = "src/bin/simstring.rs"
18+
1519
[lib]
1620
name = "simstring_rust"
1721
path = "src/lib.rs"
@@ -26,12 +30,14 @@ rustc-hash = "2.1"
2630
pyo3 = { version = "0.27", features = ["extension-module", "abi3-py37"] }
2731
serde = { version = "1.0", features = ["derive"] }
2832
serde_json = "1.0"
33+
clap = { version = "4", features = ["derive"] }
2934

3035
[build-dependencies]
3136
pyo3-build-config = "0.27"
3237

3338
[dev-dependencies]
3439
num_cpus = "1.17"
40+
tempfile = "3"
3541

3642
[[bench]]
3743
name = "bench"

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,22 @@ A native Rust implementation of the CPMerge algorithm, designed for approximate
1515
- ✅ Fast algorithm for string matching
1616
- ✅ 100% exact retrieval
1717
- ✅ Support for Unicode
18-
- [ ] Support for building databases directly from text files
18+
- ✅ Support for building databases directly from text files
19+
- ✅ CLI tool for building and searching databases
1920
- [ ] Mecab-based tokenizer support
2021

22+
## CLI Usage
23+
24+
This crate provides a `simstring` CLI tool.
25+
26+
```bash
27+
# Build
28+
simstring build -d phrases.db phrases.txt
29+
30+
# Search
31+
simstring search -d phrases.db --source phrases.txt "query"
32+
```
33+
2134
## Supported String Similarity Measures
2235

2336
- ✅ Dice coefficient

0 commit comments

Comments
 (0)