-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcbf45a
commit 5184000
Showing
7 changed files
with
100 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::{fs, path::PathBuf}; | ||
|
||
use text_utils_prefix::adaptive_radix_trie::AdaptiveRadixTrie; | ||
|
||
fn main() { | ||
let dir = env!("CARGO_MANIFEST_DIR"); | ||
let index = fs::read_to_string(PathBuf::from(dir).join("resources/test/index.txt")) | ||
.expect("failed to read file"); | ||
let n = 10_000_000; | ||
let words: Vec<_> = index.lines().map(|s| s.as_bytes()).take(n).collect(); | ||
|
||
let trie: AdaptiveRadixTrie<_> = words.iter().enumerate().map(|(i, w)| (w, i)).collect(); | ||
let stats = trie.stats(); | ||
println!("{stats:#?}"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::{fs, path::PathBuf}; | ||
|
||
use text_utils_prefix::patricia_trie::PatriciaTrie; | ||
|
||
fn main() { | ||
let dir = env!("CARGO_MANIFEST_DIR"); | ||
let index = fs::read_to_string(PathBuf::from(dir).join("resources/test/index.txt")) | ||
.expect("failed to read file"); | ||
let n = 1_000_000; | ||
let words: Vec<_> = index.lines().map(|s| s.as_bytes()).take(n).collect(); | ||
|
||
let trie: PatriciaTrie<_> = words.iter().enumerate().map(|(i, w)| (w, i)).collect(); | ||
let stats = trie.stats(); | ||
println!("{stats:#?}"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::{fs, path::PathBuf}; | ||
|
||
use text_utils_prefix::trie::Trie; | ||
|
||
fn main() { | ||
let dir = env!("CARGO_MANIFEST_DIR"); | ||
let index = fs::read_to_string(PathBuf::from(dir).join("resources/test/index.txt")) | ||
.expect("failed to read file"); | ||
let n = 100_000; | ||
let words: Vec<_> = index.lines().map(|s| s.as_bytes()).take(n).collect(); | ||
|
||
let trie: Trie<_> = words.iter().enumerate().map(|(i, w)| (w, i)).collect(); | ||
let stats = trie.stats(); | ||
println!("{stats:#?}"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters