Esempio n. 1
0
def main():
    parser = create_parser()
    handler = parser.getContentHandler()
    handler.setEncoding("utf-8")

    for key, tem in handler.categories.items():
        print("Key = %s, tem = %s" % (key, tem))
Esempio n. 2
0
def main():
    parser = create_parser()
    handler = parser.getContentHandler()
    handler.setEncoding("utf-8")
    try:
        parser.parse("self-test.aiml")
    except xml.sax.SAXException as msg:
        err = "\nFATAL PARSE ERROR in file :\n%s\n" % (msg)
        sys.stderr.write(err)

    for key, tem in handler.categories.items():
        print("Key = %s, tem = %s" % (key, tem))
Esempio n. 3
0
def main():
    parser = create_parser()
    handler = parser.getContentHandler()
    handler.setEncoding("utf-8")
    try:
        parser.parse("C:\\Users\\jason\\My Workspaces.new\\In-House\\pyaiml-3\\test.aiml")
    except xml.sax.SAXException as msg:
        err = "\nFATAL PARSE ERROR in file :\n%s\n" % (msg)
        sys.stderr.write(err)

    for key, tem in handler.categories.items():
        print("Key = %s, tem = %s" % (key, tem))