Example #1
0
	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')
Example #2
0
	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()