forked from kent/consciousness
Reduce pub visibility: hippocampus, subconscious internals
hippocampus: cursor navigation, transcript parsing, similarity functions to pub(crate). counters::open() made private. subconscious: all format_* prompts helpers to pub(super), load_defs and keys_to_replay_items made private, consolidate_full_with_progress made private. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
9737641c86
commit
1f873140ae
7 changed files with 20 additions and 20 deletions
|
|
@ -14,7 +14,7 @@ use std::collections::HashMap;
|
|||
/// with a reversed-suffix trie: single pass from the end of the word
|
||||
/// matches the longest applicable suffix in O(suffix_len) instead of
|
||||
/// O(n_rules).
|
||||
pub fn stem(word: &str) -> String {
|
||||
pub(crate) fn stem(word: &str) -> String {
|
||||
let mut w = word.to_lowercase();
|
||||
if w.len() <= 3 { return w; }
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ fn strip_suffix_inplace(word: &mut String, suffix: &str, replacement: &str) {
|
|||
}
|
||||
|
||||
/// Tokenize and stem a text into a term frequency map
|
||||
pub fn term_frequencies(text: &str) -> HashMap<String, u32> {
|
||||
pub(crate) fn term_frequencies(text: &str) -> HashMap<String, u32> {
|
||||
let mut tf = HashMap::new();
|
||||
for word in text.split(|c: char| !c.is_alphanumeric()) {
|
||||
if word.len() > 2 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue