<commit_before>extern crate cursive;

use cursive::Cursive;
use cursive::view::{TextView,Dialog};

use std::fs::File;
use std::io::Read;

fn main() {
    let mut siv = Cursive::new();

    // Read some long text from a file.
    let mut file = File::open("assets/lorem.txt").unwrap();
    let mut content = String::new();
    file.read_to_string(&mut content).unwrap();

    // We can quit by pressing q
    siv.add_global_callback('q' as i32, |s| s.quit());

    // The text is too long to fit on a line, so the view will wrap lines,
    // and will adapt to the terminal size.
    siv.add_layer(TextView::new(&content));
    // Show a popup on top of the view.
    siv.add_layer(Dialog::new(TextView::new("Try resizing the terminal!\n(Press 'q' to quit when you're done.)"))
                  .dismiss_button("Ok"));

    siv.run();
}

<commit_msg>Update lorem example<commit_after>extern crate cursive;

use cursive::Cursive;
use cursive::view::{TextView,Dialog};

use std::fs::File;
use std::io::Read;

fn main() {
    // Read some long text from a file.
    let mut file = File::open("assets/lorem.txt").unwrap();
    let mut content = String::new();
    file.read_to_string(&mut content).unwrap();

    let mut siv = Cursive::new();

    // We can quit by pressing q
    siv.add_global_callback('q' as i32, |s| s.quit());

    // The text is too long to fit on a line, so the view will wrap lines,
    // and will adapt to the terminal size.
    siv.add_layer(TextView::new(&content));
    // Show a popup on top of the view.
    siv.add_layer(Dialog::new(TextView::new("Try resizing the terminal!\n(Press 'q' to quit when you're done.)"))
                  .dismiss_button("Ok"));

    siv.run();
}


{'fraction_non_alphanumeric': 0.15114235500878734, 'fraction_numerical': 0.0023432923257176333, 'mean_word_length': 3.176039119804401, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2176977', 'n_tokens_mistral': 580, 'n_tokens_neox': 556, 'n_words': 180}