[][src]Function hyperpolyglot::get_language_breakdown

pub fn get_language_breakdown<P: AsRef<Path>>(
    path: P
) -> HashMap<&'static str, Vec<(Detection, PathBuf)>>

Walks the path provided and tallies the programming languages detected in the given path

Returns a map from the programming languages to a Vec of the files that were detected and the strategy used

Examples

use hyperpolyglot::get_language_breakdown;
let breakdown = get_language_breakdown("src/");
let total_detections = breakdown.iter().fold(0, |sum, (language, detections)| sum + detections.len());
println!("Total files detected: {}", total_detections);