Skip to content

kernel.bootstrap(learnFiles="std-startup.xml", commands="你好") #5

Description

@chmberl

kernel.bootstrap方法不支持中文

Loading std-startup.xml... done (0.03 seconds)
WARNING: No match found for input: 你好

Kernel bootstrap completed in 0.03 seconds
Saving brain to bot_brain.brn... done (0.00 seconds)

简单处理:

if isinstance(commands, (list,)):
        for command in commands:
                command = command.decode(self._textEncoding)
                cmds = Utils.sentences(command)
                for cmd in cmds:
                    print self._respond(cmd, self._globalSessionID)
 else:
            commands = commands.decode(self._textEncoding)
            cmds = Utils.sentences(commands)
            for cmd in cmds:
                print self._respond(cmd, self._globalSessionID)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions