Code Explainers

Code explainers tagged #text-processing

python
import re
from collections import Counter
from pathlib import Path
 

Ranking the top words in a PDF

text-processing regex counting
Intermediate 6 steps
rust
use std::collections::HashMap;
 
pub fn word_frequencies(text: &str) -> HashMap<String, usize> {
    let mut counts: HashMap<String, usize> = HashMap::new();

Counting and ranking words in Rust

hashmap iterators sorting
Intermediate 7 steps