<commit_before>/*************************************************
 * Solution to question 1.6 - String Compression
 *
 * Status: INCOMPLETE
 *
 * Assumptions:
 *   - Strings are ASCII
 *   - Strings are alphabetical only
 *   - Case insensitive
*************************************************/

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

#include "common.h"

struct str {
    char *data;
    size_t length;
};


int main(int argc, char *argv[]) {
    if (argc < 2 || !isstring(argv[1])) {
        fprintf(stderr, "Please enter two strings on the command line\n");
        return EXIT_FAILURE;
    }

    fprintf(stdout, "Compressed string: ");

    struct str s1 = {
        .data = argv[1],
        .length = strlen(argv[1])
    };<commit_msg>Added TODO to C 11 solution to question 1.6<commit_after>/*************************************************
 * Solution to question 1.6 - String Compression
 *
 * Status: INCOMPLETE
 *
 * Assumptions:
 *   - Strings are ASCII
 *   - Strings are alphabetical only
 *   - Case insensitive
 *
 * TODO:
 *   - Handle counts > 9
*************************************************/

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

#include "common.h"

struct str {
    char *data;
    size_t length;
};


int main(int argc, char *argv[]) {
    if (argc < 2 || !isstring(argv[1])) {
        fprintf(stderr, "Please enter two strings on the command line\n");
        return EXIT_FAILURE;
    }

    fprintf(stdout, "Compressed string: ");

    struct str s1 = {
        .data = argv[1],
        .length = strlen(argv[1])
    };
{'fraction_non_alphanumeric': 0.24168236032642812, 'fraction_numerical': 0.011927181418706842, 'mean_word_length': 3.0767263427109977, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3430807', 'n_tokens_mistral': 503, 'n_tokens_neox': 482, 'n_words': 138}