<commit_before>use vqa_parser::audio::CodecState;
use vqa_parser::{form_chunk, snd2_chunk, vqa_header};
use vqa_parser::{SND2Chunk, VQAHeader};

use cpal::traits::{EventLoopTrait, HostTrait};

use nom::bytes::complete::{tag, take_until};
use nom::multi::many0;
use nom::IResult;

use cpal::StreamData;
use std::collections::VecDeque;
use std::fs::File;
use std::io::Read;

fn parse_vqaheader(input: &[u8]) -> IResult<&[u8], VQAHeader> {
    let (input, _) = form_chunk(input)?;
    let (input, _) = tag(b"WVQA")(input)?;
    let (input, vqaheader) = vqa_header(input)?;

    Ok((input, vqaheader))
}

fn next_snd2_chunk(input: &[u8]) -> IResult<&[u8], SND2Chunk> {
    let (input, _) = take_until("SND2")(input)?;
    let (input, chunk) = snd2_chunk(input)?;

    Ok((input, chunk))
}

fn all_snd2_chunks(input: &[u8]) -> IResult<&[u8], Vec<SND2Chunk>> {
    let (input, chunks) = many0(next_snd2_chunk)(input)?;

    Ok((input, chunks))
}

fn main() {
    let mut args = std::env::args();
    if args.len() != 2 {
        println!("usage: {} <vqa file>", args.nth(0).unwrap());
        return;
    }<commit_msg>play.rs: consistent tagging type<commit_after>use vqa_parser::audio::CodecState;
use vqa_parser::{form_chunk, snd2_chunk, vqa_header};
use vqa_parser::{SND2Chunk, VQAHeader};

use cpal::traits::{EventLoopTrait, HostTrait};

use nom::bytes::complete::{tag, take_until};
use nom::multi::many0;
use nom::IResult;

use cpal::StreamData;
use std::collections::VecDeque;
use std::fs::File;
use std::io::Read;

fn parse_vqaheader(input: &[u8]) -> IResult<&[u8], VQAHeader> {
    let (input, _) = form_chunk(input)?;
    let (input, _) = tag("WVQA")(input)?;
    let (input, vqaheader) = vqa_header(input)?;

    Ok((input, vqaheader))
}

fn next_snd2_chunk(input: &[u8]) -> IResult<&[u8], SND2Chunk> {
    let (input, _) = take_until("SND2")(input)?;
    let (input, chunk) = snd2_chunk(input)?;

    Ok((input, chunk))
}

fn all_snd2_chunks(input: &[u8]) -> IResult<&[u8], Vec<SND2Chunk>> {
    let (input, chunks) = many0(next_snd2_chunk)(input)?;

    Ok((input, chunks))
}

fn main() {
    let mut args = std::env::args();
    if args.len() != 2 {
        println!("usage: {} <vqa file>", args.nth(0).unwrap());
        return;
    }
{'fraction_non_alphanumeric': 0.2016057091882248, 'fraction_numerical': 0.01694915254237288, 'mean_word_length': 4.949602122015915, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '5727026', 'n_tokens_mistral': 894, 'n_tokens_neox': 897, 'n_words': 169}