MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / tokenize_for_fts

Function tokenize_for_fts

atomic-core/src/pristine/tables.rs:742–748  ·  view source on GitHub ↗

Tokenize text for the FTS inverted index. Extracts lowercase alphanumeric words of length >= 3, filtering out stop words (common English + programming terms) that match too many nodes to be useful for ranking.

(text: &str)

Source from the content-addressed store, hash-verified

740/// stop words (common English + programming terms) that match too many
741/// nodes to be useful for ranking.
742pub fn tokenize_for_fts(text: &str) -> Vec<String> {
743 text.split(|c: char| !c.is_alphanumeric() && c != '_')
744 .filter(|w| w.len() >= 3)
745 .map(|w| w.to_lowercase())
746 .filter(|w| !FTS_STOP_WORDS.contains(&w.as_str()))
747 .collect()
748}
749
750/// Encode an embedding key as "path\0chunk_idx".
751#[inline]

Callers 13

search_termsFunction · 0.85
test_tokenize_for_ftsFunction · 0.85
kg_fts_searchMethod · 0.85
kg_fts_match_idsMethod · 0.85
ensure_kg_fts_schemaMethod · 0.85
add_kg_fts_entriesMethod · 0.85
kg_fts_searchMethod · 0.85
kg_fts_match_idsMethod · 0.85
vault_kg_searchMethod · 0.85
kg_node_fts_hit_countFunction · 0.85

Calls 3

lenMethod · 0.45
containsMethod · 0.45
as_strMethod · 0.45