Skip to content

Commit

Permalink
feat: dont deduplicate tokens (#16)
Browse files Browse the repository at this point in the history
* feat: dont deduplicate tokens

* bump version 0.2.5
  • Loading branch information
andylokandy authored Apr 19, 2024
1 parent 5cd7020 commit 6a98939
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["andylokandy <[email protected]>"]
edition = "2018"
name = "simsearch"
version = "0.2.4"
version = "0.2.5"
license = "MIT/Apache-2.0"

description = "A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here)."
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ where

let mut tokens = self.tokenize(tokens);
tokens.sort();
tokens.dedup();

for token in tokens.clone() {
self.reverse_map
Expand Down Expand Up @@ -214,7 +213,6 @@ where
pub fn search_tokens(&self, pattern_tokens: &[&str]) -> Vec<Id> {
let mut pattern_tokens = self.tokenize(pattern_tokens);
pattern_tokens.sort();
pattern_tokens.dedup();

let mut token_scores: HashMap<&str, f64> = HashMap::new();

Expand Down

0 comments on commit 6a98939

Please sign in to comment.