<commit_before># vim: set fileencoding=utf-8

import sys

if sys.version_info.major < 3:
    print("This program is for python version 3 only.")
    sys.exit(3)

import lexer
import execute

while True:
    instr = input("» ")
    toks = lexer.to_toks(instr)
    rpn = lexer.to_rpn(toks)

    result = execute.eval_rpn(rpn)

    if result is not None:
        print(result)
<commit_msg>Re-add readline.<commit_after># vim: set fileencoding=utf-8

import sys

try:
    import readline
    # No idea if this is a license violation. Hope it isn't.
except ImportError:
    print("Could not find readline, you will likely get no line editing functionality")

if sys.version_info.major < 3:
    print("This program is for python version 3 only.")
    sys.exit(3)

import lexer
import execute

while True:
    instr = input("» ")
    toks = lexer.to_toks(instr)
    rpn = lexer.to_rpn(toks)

    result = execute.eval_rpn(rpn)

    if result is not None:
        print(result)

{'fraction_non_alphanumeric': 0.0979381443298969, 'fraction_numerical': 0.008247422680412371, 'mean_word_length': 3.114406779661017, 'pattern_counts': {'":': 0, '<': 5, '<?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': '160542', 'n_tokens_mistral': 346, 'n_tokens_neox': 330, 'n_words': 107}