<commit_before>town = open("TLK/BRITAIN.TLK").read()

KEY = ["Name", "Pronoun", "Look", "Job", "Health", "Keyword 1", "Keyword 2",
    "Question", "Yes", "No"]

for char in range(16):
    char_data = town[0x120 * char:0x120 * (char + 1)]

    print "\ncharacter %d" % char
    print ord(char_data[0]), ord(char_data[1]), ord(char_data[2])

    start = 0x3
    for i in range(10):
        length = char_data[start:].find("\0")
        print KEY[i], repr(char_data[start:start + length])
        start += length + 1
<commit_msg>make town_talk executable that takes talk file<commit_after>#!/usr/bin/env python

import sys

if len(sys.argv) != 2:
    print "usage: {} <TLK FILE>".format(sys.argv[0])
else:
    with open(sys.argv[1]) as talk_file:
        talk_data = talk_file.read()

        KEY = ["Name", "Pronoun", "Look", "Job", "Health", "Keyword 1", "Keyword 2",
            "Question", "Yes", "No"]

        for char in range(16):
            char_data = talk_data[0x120 * char:0x120 * (char + 1)]

            print "\ncharacter %d" % char
            print ord(char_data[0]), ord(char_data[1]), ord(char_data[2])

            start = 0x3
            for i in range(10):
                length = char_data[start:].find("\0")
                print KEY[i], repr(char_data[start:start + length])
                start += length + 1

{'fraction_non_alphanumeric': 0.17153558052434456, 'fraction_numerical': 0.03520599250936329, 'mean_word_length': 2.610810810810811, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3654435', 'n_tokens_mistral': 490, 'n_tokens_neox': 458, 'n_words': 116}