<commit_before>#include "trie.h"

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

void run_loop(Trie *trie)
{
    char buffer[1024];
    while (fgets(buffer, sizeof buffer, stdin)) {
        char *pch = strchr(buffer, '\n');
        *pch = 0;
        char *data = trie_lookup(trie, buffer);
        if (data) {
            puts(data);
            free(data);
        } else {
            puts("Not found");
        }
    }
}

int main(int argc, char *argv[])
{
    if (argc != 2) {
        fprintf(stderr, "Usage: %s FILE\n", argv[0]);
        return 1;
    }
    Trie *trie = trie_load(argv[1]);
    if (!trie) {
        fprintf(stderr, "Failed to load trie\n");
        return 2;
    }

    run_loop(trie);

    trie_free(trie);

    return 0;
}<commit_msg>Add help to list-query<commit_after>#include "trie.h"

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>

void run_loop(Trie *trie)
{
    char buffer[1024];
    while (fgets(buffer, sizeof buffer, stdin)) {
        char *pch = strchr(buffer, '\n');
        *pch = 0;
        char *data = trie_lookup(trie, buffer);
        if (data) {
            puts(data);
            free(data);
        } else {
            puts("Not found");
        }
    }
}

int main(int argc, char *argv[])
{
    if (argc != 2) {
        fprintf(stderr, "Usage: %s FILE\n", argv[0]);
        return 1;
    }
    if (strcmp(argv[1], "-h") == 0) {
        printf("Usage: %s FILE\n", argv[0]);
        puts("This program has no other options.");
        return 0;
    }
    Trie *trie = trie_load(argv[1]);
    if (!trie) {
        fprintf(stderr, "Failed to load trie\n");
        return 2;
    }

    run_loop(trie);

    trie_free(trie);

    return 0;
}
{'fraction_non_alphanumeric': 0.16473988439306358, 'fraction_numerical': 0.015028901734104046, 'mean_word_length': 2.0052083333333335, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '5468301', 'n_tokens_mistral': 656, 'n_tokens_neox': 638, 'n_words': 153}