<commit_before>pub mod header;
pub mod utils;

pub mod spec {
    use storage::file::header::spec::FileHeaderSpec as FHS;

    pub fn named_text(name: &str) -> FHS {
        FHS::Key { name: String::from(name), value_type: Box::new(FHS::Text) }
    }

    pub fn named_text_array(name: &str) -> FHS {
        FHS::Key { name: String::from(name), value_type: Box::new(text_array()) }
    }

    pub fn text_array() -> FHS {
        FHS::Array { allowed_types: vec![FHS::Text] }
    }

}
<commit_msg>Add doc to module helpers<commit_after>/*!
 * Utility helpers for modules
 */

pub mod header;
pub mod utils;

/**
 * Helpers for header specs
 */
pub mod spec {
    use storage::file::header::spec::FileHeaderSpec as FHS;

    /**
     * Helper to get a spec for a Key-Value for a named text:
     *
     *  { '<name>': "<Text>" }
     */
    pub fn named_text(name: &str) -> FHS {
        FHS::Key { name: String::from(name), value_type: Box::new(FHS::Text) }
    }

    /**
     * Helper to get a spec for a Key-Value for a named array:
     *
     *  { '<name>': [ "<Text>", ...] }
     */
    pub fn named_text_array(name: &str) -> FHS {
        FHS::Key { name: String::from(name), value_type: Box::new(text_array()) }
    }

    /**
     * Helper to get a spec for Array<Text>:
     *
     *  [ "<Text>", ...]
     */
    pub fn text_array() -> FHS {
        FHS::Array { allowed_types: vec![FHS::Text] }
    }

}

{'fraction_non_alphanumeric': 0.17277856135401976, 'fraction_numerical': 0.0, 'mean_word_length': 2.4609756097560975, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2101435', 'n_tokens_mistral': 511, 'n_tokens_neox': 504, 'n_words': 129}