<commit_before>#!/usr/bin/python
import init_twit as tw
import markovgen, time, os, re

# make a separate file for these reusable functions: bot.py
# main bot-specific app logic in app.py

corpus_file = 'corpus.txt'
with open(corpus_file) as text:
	markov = markovgen.Markov(text)

def log(msg):
	with open('log','a') as f:
		f.write(msg+"\n")
	print msg

def genTweet():
	return markov.generate_markov_text(size=18)

def tweet(status,irtsi=None,at=None): 
	try:
		if at and irtsi:
			status = "@"+at+" "+status
			tw.poster.statuses.update(status=status,in_reply_to_status_id=irtsi)
		else:
			pass
			tw.poster.statuses.update(status=status)<commit_msg>Randomizing the number of words per tweet to between 7 and 18 words.<commit_after>#!/usr/bin/python
import init_twit as tw
import markovgen, time, re, random

# make a separate file for these reusable functions: bot.py
# main bot-specific app logic in app.py

corpus_file = 'corpus.txt'
with open(corpus_file) as text:
	markov = markovgen.Markov(text)

def log(msg):
	with open('log','a') as f:
		f.write(msg+"\n")
	print msg

def genTweet():
	wc = random.randint(7,18)
	return markov.generate_markov_text(size=wc)

def tweet(status,irtsi=None,at=None): 
	try:
		if at and irtsi:
			status = "@"+at+" "+status
			tw.poster.statuses.update(status=status,in_reply_to_status_id=irtsi)
		else:
			pass
			tw.poster.statuses.update(status=status)
{'fraction_non_alphanumeric': 0.12750716332378223, 'fraction_numerical': 0.0057306590257879654, 'mean_word_length': 4.845188284518828, 'pattern_counts': {'":': 0, '<': 3, '<?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': '686975', 'n_tokens_mistral': 563, 'n_tokens_neox': 527, 'n_words': 133}