Exemple #1
0
 def message_received(self, passport_id, display_name, text, charset):
     print "%s %s" % (display_name, text)
     self.chat.send_message(k.respond(text), charset)
Exemple #2
0
def prestart():
    loadlearnfiles(k, loadfiles)
    k.respond(u'加载系统标签')
Exemple #3
0
# -*- coding: utf-8 -*-

import aiml
import sys
from aiml.Kernel import k

# from xml.dom import minidom

loadfiles = ["aisen/main.xml", "client.aiml"]


def loadlearnfiles(kernel, files):
    for file in files:
        kernel.learn(file)


if __name__ == "__main__":
    loadlearnfiles(k, loadfiles)
    print k.respond(u"加载系统标签")
    while True:
        print k.respond(raw_input(">"))  # .encode(sys.argv[1], 'ignore').decode('utf8'))
Exemple #4
0
# -*- coding: utf-8 -*-

import aiml
import sys
from aiml.Kernel import k
#from xml.dom import minidom

loadfiles = ['aisen/main.xml', 'client.aiml']


def loadlearnfiles(kernel, files):
    for file in files:
        kernel.learn(file)


if __name__ == '__main__':
    loadlearnfiles(k, loadfiles)
    print k.respond(u"加载系统标签")
    while True:
        print k.respond(
            raw_input('>'))  #.encode(sys.argv[1], 'ignore').decode('utf8'))
Exemple #5
0
	def message_received(self, passport_id, display_name, text, charset):
		print "%s %s" % (display_name, text)
		self.chat.send_message(k.respond(text), charset)
Exemple #6
0
def prestart():
	loadlearnfiles(k, loadfiles)
	k.respond(u'加载系统标签')