Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chmberl opened this issue Aug 22, 2016 · 1 comment
Open

Comments

@chmberl
Copy link

chmberl commented Aug 22, 2016

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)
@andelf
Copy link
Owner

andelf commented Mar 4, 2017

求提PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants