示例#1
0
文件: app.py 项目: JNazare/ElizaBot
	def post(self):
		result = flask.request.form['expression']
		count = session.get("count", 0)
		session["count"] = count + 1
		if count == 0:
			res = matcher.hi_eliza(result)
			flask.flash(res)
			print count
		elif count >= 1 and count < 10:
			res = matcher.main(result)
			flask.flash(res)
			print count
		elif count >= 10:
			res = matcher.stop_eliza()
			flask.flash(res)
			print count
		return flask.render_template('index.html')
示例#2
0
文件: eliza.py 项目: JNazare/ElizaBot
	def post(self):
		result = flask.request.form['expression']
		count = incr()
		if count == 0:
			res = matcher.hi_eliza(result)
			flask.flash(res)
			count = incr()
			print count
		elif count > 1 and count < 20:
			res = matcher.main(result)
			flask.flash(res)
			count = incr()
			print count
		elif count >= 20:
			res = matcher.stop_eliza()
			flask.flash(res)
			count = incr()
			print count
		return self.get()