This repository has been archived by the owner on Oct 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ea5eaa1
Showing
19 changed files
with
2,725 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.swp | ||
*~ | ||
*.pyc | ||
*.pyo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/python2 | ||
# -*- coding: utf8 -*- | ||
import aiml | ||
import os | ||
import config as cfg | ||
|
||
class TalkBot(aiml.Kernel): | ||
def __init__(self,properties=cfg.BOT_PROPERTIES): | ||
aiml.Kernel.__init__(self) | ||
self.verbose(cfg.DEBUG) | ||
if os.path.isfile("xdtuxbot.brn"): | ||
self.bootstrap(brainFile = "xdtuxbot.brn") | ||
else: | ||
self.init_bot() | ||
self.saveBrain("xdtuxbot.brn") | ||
for p in properties: | ||
self.setBotPredicate( p, properties[p] ) | ||
|
||
def init_bot(self): | ||
for file in os.listdir(cfg.AIML_SET): | ||
if file[-4::]=="aiml": | ||
self.learn(os.path.join(cfg.AIML_SET,file) ) | ||
|
||
|
||
if __name__=="__main__": | ||
bot = TalkBot() | ||
while True: print bot.respond(raw_input("> ")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__all__ = [] | ||
from TalkBot import TalkBot |
Oops, something went wrong.