def goRogueOnSub(session, df, subreddit='test', submission_limit=100, comment_limit=300, wordmin=5, charmin=12, scoremax=1, replymax=0): caughtObj, caughtTxt = catch.do(session, subreddit, submission_limit, comment_limit) print(fnt.bS + 'New posts recorded for /r/%s.' % (subreddit) + fnt.End) reply.do(session, df, caughtObj, caughtTxt, wordmin, charmin, scoremax, replymax) print(fnt.bS + 'Finished replies on /r/%s.' % (subreddit) + fnt.End)
def generator(): #sched = scheduler.Scheduler() #sched.schedule() u = LoadUserData(conf_path) table, footer = readReplyTable.read(exec_path + "/common/replyTable.json") dbSession = model.startSession(u) if False: #if( sched.has_schedule() ): str = doSchedule(sched) else: rep = dbSession.query(model.RetQueue) if (rep.count() > 0): sentence, reply_id = reply.do(table, rep, dbSession) else: #try: # 予定もreplyもないならhotでも取り出してマルコフ連鎖する # str,sl = CreateMarkovSentenceWithHot(dbSession) #except: # print "Unexpected error:", sys.exc_info()[0] str, sl = vsearch.depthFirstSearch2("yystart", "yyend", 15) print_d(str) print_d(len(sl)) asl = afterEffect(sl, footer) sentence = "" reply_id = -1 for i in asl: sentence += i sendMessage(sentence, reply_id)
def generator(): #sched = scheduler.Scheduler() #sched.schedule() u = LoadUserData(conf_path) table, footer= readReplyTable.read(exec_path+"/common/replyTable.json") dbSession = model.startSession(u) if False: #if( sched.has_schedule() ): str = doSchedule(sched) else: rep = dbSession.query(model.RetQueue) if( rep.count() > 0 ): sentence, reply_id = reply.do(table, rep, dbSession) else: #try: # 予定もreplyもないならhotでも取り出してマルコフ連鎖する # str,sl = CreateMarkovSentenceWithHot(dbSession) #except: # print "Unexpected error:", sys.exc_info()[0] str,sl = vsearch.depthFirstSearch2("yystart","yyend",15) print_d(str) print_d(len(sl)) asl = afterEffect(sl,footer) sentence = "" reply_id = -1 for i in asl: sentence += i sendMessage(sentence, reply_id)
def quickGenerate(): #sched = scheduler.Scheduler() #sched.schedule() u = LoadUserData(conf_path) table, footer= readReplyTable.read(exec_path+"/common/replyTable.json") dbSession = model.startSession(u) if False: if( sched.has_schedule() ): str = doSchedule(sched) else: rep = dbSession.query(model.RetQueue) if( rep.count() > 0 ): str, reply_id = reply.do(table, rep,dbSession) sendMessage(str,reply_id)