Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Clone in Desktop Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (17 sloc) 404 Bytes
import sys
import os.path
import aiml
import re
k = aiml.Kernel()
k.verbose(False)
def load_brain():
files = os.listdir('./aiml/')
for aiml in files:
if aiml != "._DS_Store":
k.learn('./aiml/' + aiml)
k.saveBrain('alice.brn')
def generate_alice_text(query):
k.loadBrain('alice.brn')
response = k.respond(query)
sys.stdout.write(response)
generate_alice_text(sys.argv[1])
Jump to Line
Something went wrong with that request. Please try again.