Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andylokandy/simsearch-rs
A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here).
https://github.com/andylokandy/simsearch-rs
Last synced: 5 days ago
JSON representation
A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here).
- Host: GitHub
- URL: https://github.com/andylokandy/simsearch-rs
- Owner: andylokandy
- License: mit
- Created: 2019-04-15T15:44:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-19T07:09:15.000Z (9 months ago)
- Last Synced: 2025-01-01T11:04:46.260Z (12 days ago)
- Language: Rust
- Size: 112 KB
- Stars: 172
- Watchers: 4
- Forks: 26
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-cn - andylokandy/simsearch-rs - A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (Libraries / Text search)
- awesome-rust - andylokandy/simsearch-rs - A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (Libraries / Text search)
- awesome-rust - andylokandy/simsearch-rs
- awesome-rust-cn - andylokandy/simsearch-rs
- awesome-rust-zh - andylokandy/simsearch-rs - 简单,小巧的模拟查询引擎,内存工作,相似字符串查询 (库 / 文本搜索)
README
# `simsearch`
[![Build Status](https://travis-ci.com/andylokandy/simsearch-rs.svg?branch=master)](https://travis-ci.com/andylokandy/simsearch-rs)
[![crates.io](https://img.shields.io/crates/v/simsearch.svg)](https://crates.io/crates/simsearch)
[![docs.rs](https://docs.rs/simsearch/badge.svg)](https://docs.rs/simsearch)A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here).
### [**Documentation**](https://docs.rs/simsearch)
## Usage
Add the following to your `Cargo.toml`:
```toml
[dependencies]
simsearch = "0.2"
```## Example
```rust
use simsearch::SimSearch;let mut engine: SimSearch = SimSearch::new();
engine.insert(1, "Things Fall Apart");
engine.insert(2, "The Old Man and the Sea");
engine.insert(3, "James Joyce");let results: Vec = engine.search("thngs");
assert_eq!(results, &[1]);
```By default, Jaro-Winkler distance is used. An alternative Levenshtein distance,
which is SIMD-accelerated but only works for ASCII byte strings, can be specified
with custom `SearchOptions`:```rust
use simsearch::{SimSearch, SearchOptions};let options = SearchOptions::new().levenshtein(true);
let mut engine: SimSearch = SimSearch::new_with(options);
```Also try the interactive demo by:
```
$ cargo run --release --example books
```## Contribution
All kinds of contribution are welcomed.
- **Issus.** Feel free to open an issue when you find typos, bugs, or have any question.
- **Pull requests**. New collection, better implementation, more tests, more documents and typo fixes are all welcomed.## License
Licensed under MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)